diff options
author | Paul Phillips <paulp@improving.org> | 2011-11-03 04:51:52 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-11-03 04:51:52 +0000 |
commit | 938eab16f841fee67b2e34c983a7a2a6a5998127 (patch) | |
tree | 0c576763abf934891b519c61dfe5889541955f71 /src/compiler/scala/tools/nsc/Global.scala | |
parent | b6778be91900b8161e705dc2598ef7af86842b0b (diff) | |
download | scala-938eab16f841fee67b2e34c983a7a2a6a5998127.tar.gz scala-938eab16f841fee67b2e34c983a7a2a6a5998127.tar.bz2 scala-938eab16f841fee67b2e34c983a7a2a6a5998127.zip |
ScalaClassLoader changes.
Lots of fiddling in the interests of a better classloading future.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index b798fe71ba..602ff6bf0e 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -1325,10 +1325,11 @@ object Global { // !!! The classpath isn't known until the Global is created, which is too // late, so we have to duplicate it here. Classpath is too tightly coupled, // it is a construct external to the compiler and should be treated as such. - val loader = ScalaClassLoader.fromURLs(new PathResolver(settings).result.asURLs) - val name = settings.globalClass.value - val clazz = Class.forName(name, true, loader) - val cons = clazz.getConstructor(classOf[Settings], classOf[Reporter]) + val parentLoader = settings.explicitParentLoader getOrElse getClass.getClassLoader + val loader = ScalaClassLoader.fromURLs(new PathResolver(settings).result.asURLs, parentLoader) + val name = settings.globalClass.value + val clazz = Class.forName(name, true, loader) + val cons = clazz.getConstructor(classOf[Settings], classOf[Reporter]) cons.newInstance(settings, reporter).asInstanceOf[Global] } |