From ad451f4a55ad9cd3683ee571a9b4697ddb4d1bfa Mon Sep 17 00:00:00 2001 From: Geoffrey Washburn Date: Sat, 24 May 2008 12:41:30 +0000 Subject: Undo the changes for now. --- src/compiler/scala/tools/nsc/Interpreter.scala | 4 +++- src/compiler/scala/tools/nsc/InterpreterLoop.scala | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala index 0ccc4169f4..c5fbd57354 100644 --- a/src/compiler/scala/tools/nsc/Interpreter.scala +++ b/src/compiler/scala/tools/nsc/Interpreter.scala @@ -172,7 +172,9 @@ class Interpreter(val settings: Settings, out: PrintWriter) { Thread.currentThread.setContextClassLoader(classLoader) } - var parentClassLoader: ClassLoader = this.getClass.getClassLoader() + /** XXX Let's get rid of this. I believe the Eclipse plugin is + * the only user of it, so this should be doable. */ + protected def parentClassLoader: ClassLoader = null /** the previous requests this interpreter has processed */ private val prevRequests = new ArrayBuffer[Request]() diff --git a/src/compiler/scala/tools/nsc/InterpreterLoop.scala b/src/compiler/scala/tools/nsc/InterpreterLoop.scala index 8ba7a696b0..b15cc8c54c 100644 --- a/src/compiler/scala/tools/nsc/InterpreterLoop.scala +++ b/src/compiler/scala/tools/nsc/InterpreterLoop.scala @@ -65,12 +65,20 @@ class InterpreterLoop(in0: Option[BufferedReader], out: PrintWriter) { } } + /* As soon as the Eclipse plugin no longer needs it, delete uglinessxxx, + * parentClassLoader0, and the parentClassLoader method in Interpreter + */ + var uglinessxxx: ClassLoader = _ + def parentClassLoader0: ClassLoader = uglinessxxx + /** Create a new interpreter. Close the old one, if there * is one. */ def createInterpreter() { //closeInterpreter() - interpreter = new Interpreter(settings, out) + interpreter = new Interpreter(settings, out) { + override protected def parentClassLoader = parentClassLoader0 + } interpreter.setContextClassLoader() } @@ -284,6 +292,8 @@ class InterpreterLoop(in0: Option[BufferedReader], out: PrintWriter) { InteractiveReader.createDefault() } + uglinessxxx = classOf[InterpreterLoop].getClassLoader + createInterpreter() loadFiles(settings) -- cgit v1.2.3