summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-03-27 15:37:15 +0000
committerPaul Phillips <paulp@improving.org>2011-03-27 15:37:15 +0000
commitfbdda78887e6dc594d08bf2376d0bba164d14009 (patch)
tree7fa4366c43af4ef371263f67f952f2a4577a560e /src/compiler
parent40195b89b3d553e6c11a181c755f711d7bd38981 (diff)
downloadscala-fbdda78887e6dc594d08bf2376d0bba164d14009.tar.gz
scala-fbdda78887e6dc594d08bf2376d0bba164d14009.tar.bz2
scala-fbdda78887e6dc594d08bf2376d0bba164d14009.zip
Made :javap less crashy on windows, no review.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/ILoop.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/ILoop.scala b/src/compiler/scala/tools/nsc/interpreter/ILoop.scala
index e2214d363e..4541dc165b 100644
--- a/src/compiler/scala/tools/nsc/interpreter/ILoop.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/ILoop.scala
@@ -303,7 +303,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: PrintWriter)
}
}
- private object javap extends Javap(intp.classLoader, new IMain.ReplStrippingWriter(intp)) {
+ protected def newJavap() = new Javap(intp.classLoader, new IMain.ReplStrippingWriter(intp)) {
override def tryClass(path: String): Array[Byte] = {
// Look for Foo first, then Foo$, but if Foo$ is given explicitly,
// we have to drop the $ to find object Foo, then tack it back onto
@@ -316,6 +316,9 @@ class ILoop(in0: Option[BufferedReader], protected val out: PrintWriter)
else super.tryClass(moduleName)
}
}
+ private lazy val javap =
+ try newJavap()
+ catch { case _: Exception => null }
private def typeCommand(line: String): Result = {
intp.typeOfExpression(line) match {
@@ -325,6 +328,8 @@ class ILoop(in0: Option[BufferedReader], protected val out: PrintWriter)
}
private def javapCommand(line: String): Result = {
+ if (javap == null)
+ return ":javap unavailable on this platform."
if (line == "")
return ":javap [-lcsvp] [path1 path2 ...]"