File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed
src/compiler/scala/tools/nsc/interpreter Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -394,20 +394,24 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
394
394
(install map (_.parent) flatMap jarAt) orElse
395
395
(jdkDir flatMap deeply)
396
396
}
397
- private def addToolsJarToLoader () = {
398
- val cl = platformTools match {
399
- case Some (tools) => ScalaClassLoader .fromURLs(Seq (tools.toURL), intp.classLoader)
400
- case _ => intp.classLoader
401
- }
402
- if (Javap .isAvailable(cl)) {
403
- repldbg(" :javap available." )
404
- cl
405
- }
406
- else {
407
- repldbg(" :javap unavailable: no tools.jar at " + jdkHome)
397
+ private def addToolsJarToLoader () = (
398
+ if (Javap isAvailable intp.classLoader) {
399
+ repldbg(" :javap available on interpreter class path." )
408
400
intp.classLoader
401
+ } else {
402
+ val cl = platformTools match {
403
+ case Some (tools) => ScalaClassLoader .fromURLs(Seq (tools.toURL), intp.classLoader)
404
+ case _ => intp.classLoader
405
+ }
406
+ if (Javap isAvailable cl) {
407
+ repldbg(" :javap available on extended class path." )
408
+ cl
409
+ } else {
410
+ repldbg(s " :javap unavailable: no tools.jar at $jdkHome" )
411
+ intp.classLoader
412
+ }
409
413
}
410
- }
414
+ )
411
415
412
416
protected def newJavap () = new JavapClass (addToolsJarToLoader(), new IMain .ReplStrippingWriter (intp)) {
413
417
override def tryClass (path : String ): Array [Byte ] = {
You can’t perform that action at this time.
0 commit comments