summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-09-24 22:11:31 +0200
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-09-24 22:11:31 +0200
commit5695588407bd1f2b6c7ef3bdcf52d7b0e1063d67 (patch)
treeb506bc21d954bea92b66785c91ac123f05a53725
parent269cb7bb875447304278db579dd8c41adcdb1689 (diff)
parentea2ec79dabf6e03c34a595255d884628c2bcc7ff (diff)
downloadscala-5695588407bd1f2b6c7ef3bdcf52d7b0e1063d67.tar.gz
scala-5695588407bd1f2b6c7ef3bdcf52d7b0e1063d67.tar.bz2
scala-5695588407bd1f2b6c7ef3bdcf52d7b0e1063d67.zip
Merge pull request #3999 from mpociecha/classpath-findSourceFile-method-renaming
Rename ClassPath.findSourceFile and delete Platform.doLoad
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala4
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala2
-rw-r--r--src/compiler/scala/tools/nsc/util/ClassPath.scala2
-rw-r--r--test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala1
4 files changed, 4 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index d7cd92adf2..14be8374b9 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -352,7 +352,7 @@ abstract class ClassfileParser {
}
private def loadClassSymbol(name: Name): Symbol = {
- val file = classPath findSourceFile ("" +name) getOrElse {
+ val file = classPath findClassFile ("" +name) getOrElse {
// SI-5593 Scaladoc's current strategy is to visit all packages in search of user code that can be documented
// therefore, it will rummage through the classpath triggering errors whenever it encounters package objects
// that are not in their correct place (see bug for details)
@@ -1047,7 +1047,7 @@ abstract class ClassfileParser {
for (entry <- innerClasses.entries) {
// create a new class member for immediate inner classes
if (entry.outerName == currentClass) {
- val file = classPath.findSourceFile(entry.externalName.toString) getOrElse {
+ val file = classPath.findClassFile(entry.externalName.toString) getOrElse {
throw new AssertionError(entry.externalName)
}
enterClassAndModule(entry, file)
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
index 149b4fe446..cbe427775a 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
@@ -130,7 +130,7 @@ abstract class ICodeReader extends ClassfileParser {
log("ICodeReader reading " + cls)
val name = cls.javaClassName
- classPath.findSourceFile(name) match {
+ classPath.findClassFile(name) match {
case Some(classFile) => parse(classFile, cls)
case _ => MissingRequirementError.notFound("Could not find bytecode for " + cls)
}
diff --git a/src/compiler/scala/tools/nsc/util/ClassPath.scala b/src/compiler/scala/tools/nsc/util/ClassPath.scala
index d2ba61cc0b..e89f08ec6b 100644
--- a/src/compiler/scala/tools/nsc/util/ClassPath.scala
+++ b/src/compiler/scala/tools/nsc/util/ClassPath.scala
@@ -231,7 +231,7 @@ abstract class ClassPath[T] {
classes find (_.name == name)
}
- def findSourceFile(name: String): Option[AbstractFile] =
+ def findClassFile(name: String): Option[AbstractFile] =
findClass(name) match {
case Some(ClassRep(Some(x: AbstractFile), _)) => Some(x)
case _ => None
diff --git a/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala b/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala
index 91868a5683..e4be42ac96 100644
--- a/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala
+++ b/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala
@@ -33,7 +33,6 @@ class SymbolTableForUnitTesting extends SymbolTable {
lazy val loaders: SymbolTableForUnitTesting.this.loaders.type = SymbolTableForUnitTesting.this.loaders
def platformPhases: List[SubComponent] = Nil
val classPath: ClassPath[AbstractFile] = new PathResolver(settings).result
- def doLoad(cls: ClassPath[AbstractFile]#ClassRep): Boolean = true
def isMaybeBoxed(sym: Symbol): Boolean = ???
def needCompile(bin: AbstractFile, src: AbstractFile): Boolean = ???
def externalEquals: Symbol = ???