summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
diff options
context:
space:
mode:
authorSébastien Doeraene <sjrdoeraene@gmail.com>2013-09-18 16:41:03 +0200
committerSébastien Doeraene <sjrdoeraene@gmail.com>2013-09-23 13:32:31 +0200
commit2399304b2a7be8a2b3f58d521042eb6eb3a2a4ce (patch)
tree3def9e8babd1bf00c9029851b9c254bd84b543be /src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
parentd45a3c8cc8e9f1d95d797d548a85abd8597f5bc7 (diff)
downloadscala-2399304b2a7be8a2b3f58d521042eb6eb3a2a4ce.tar.gz
scala-2399304b2a7be8a2b3f58d521042eb6eb3a2a4ce.tar.bz2
scala-2399304b2a7be8a2b3f58d521042eb6eb3a2a4ce.zip
Add back the newClassLoader hook in SymbolLoaders.
This was previously an overridable method of Platform. The loader creation was moved in afbee09c8e0e7b1a4da1f8517c723dad9f1adb6f directly in SymbolLoaders, but inside a method doing more logic, namely initializeFromClassPath(). This commit simply moves the actual creation of the class loader (`new ClassfileLoader(bin)`) into its own method `newClassLoader`, but in SymbolLoaders. This allows to override only that method in subclasses of SymbolLoaders.
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
index 6f27eb8660..8b739958ff 100644
--- a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
+++ b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
@@ -164,10 +164,17 @@ abstract class SymbolLoaders {
if (settings.verbose) inform("[symloader] no class, picked up source file for " + src.path)
enterToplevelsFromSource(owner, classRep.name, src)
case (Some(bin), _) =>
- enterClassAndModule(owner, classRep.name, new ClassfileLoader(bin))
+ enterClassAndModule(owner, classRep.name, newClassLoader(bin))
}
}
+ /** Create a new loader from a binary classfile.
+ * This is intented as a hook allowing to support loading symbols from
+ * files other than .class files.
+ */
+ protected def newClassLoader(bin: AbstractFile): SymbolLoader =
+ new ClassfileLoader(bin)
+
/**
* A lazy type that completes itself by calling parameter doComplete.
* Any linked modules/classes or module classes are also initialized.