summaryrefslogtreecommitdiff
path: root/src/repl/scala/tools/nsc/interpreter/ILoop.scala
diff options
context:
space:
mode:
authorHeather Miller <heather.miller@epfl.ch>2014-10-16 14:22:17 -0700
committerHeather Miller <heather.miller@epfl.ch>2014-11-05 10:56:52 -0800
commit04ee526ca7f9d8f786b4b3e5a8d7209ceaa698ba (patch)
tree5137be89c081a78c4012913cd0676854d4ceded1 /src/repl/scala/tools/nsc/interpreter/ILoop.scala
parentf65c43094141169c76c189ad97bfca32f4508284 (diff)
downloadscala-04ee526ca7f9d8f786b4b3e5a8d7209ceaa698ba.tar.gz
scala-04ee526ca7f9d8f786b4b3e5a8d7209ceaa698ba.tar.bz2
scala-04ee526ca7f9d8f786b4b3e5a8d7209ceaa698ba.zip
SI-6502 Addresses comments by @som-snytt
Diffstat (limited to 'src/repl/scala/tools/nsc/interpreter/ILoop.scala')
-rw-r--r--src/repl/scala/tools/nsc/interpreter/ILoop.scala12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/ILoop.scala b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
index c35de9a424..209e3f96bd 100644
--- a/src/repl/scala/tools/nsc/interpreter/ILoop.scala
+++ b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
@@ -652,8 +652,8 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
val jarFile = AbstractFile.getDirectory(new java.io.File(arg))
- def flatten(f: AbstractFile): Iterator[AbstractFile] =
- if (f.isClassContainer) f.iterator.flatMap(flatten)
+ def flatten(f: AbstractFile): Iterator[AbstractFile] =
+ if (f.isClassContainer) f.iterator.flatMap(flatten)
else Iterator(f)
val entries = flatten(jarFile)
@@ -669,13 +669,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
// read InputStream into Array[Byte]
val arr = readFully(is)
val clazz = cloader.classOf(arr)
- try {
- // pass initialize = false because we don't want to execute class initializers:
- Class.forName(clazz.getName(), false, intp.classLoader)
- exists = true
- } catch {
- case _: ClassNotFoundException => /* do nothing */
- }
+ if ((intp.classLoader tryToLoadClass clazz.getName).isDefined) exists = true
}
}