summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2008-08-28 16:54:37 +0000
committerIulian Dragos <jaguarul@gmail.com>2008-08-28 16:54:37 +0000
commit44bd48af53d309272941b79962490ec295f7a7ea (patch)
tree48d5f742274da8bf41348a609439604ba37ea84c /src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
parentf0ab2e175e6b64f3356e2472db81e2caad6684a5 (diff)
downloadscala-44bd48af53d309272941b79962490ec295f7a7ea.tar.gz
scala-44bd48af53d309272941b79962490ec295f7a7ea.tar.bz2
scala-44bd48af53d309272941b79962490ec295f7a7ea.zip
Fixed #1271.
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index f469477d72..92e4f910ed 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -380,7 +380,6 @@ abstract class ClassfileParser {
val curbp = in.bp
skipMembers() // fields
skipMembers() // methods
- parseAttributes(clazz, classInfo)
if (!isScala) {
clazz.setFlag(sflags)
setPrivateWithin(clazz, jflags)
@@ -392,6 +391,9 @@ abstract class ClassfileParser {
staticModule.setInfo(statics.tpe)
staticModule.setFlag(JAVA)
staticModule.moduleClass.setFlag(JAVA)
+ // attributes now depend on having infos set already
+ parseAttributes(clazz, classInfo)
+
in.bp = curbp
val fieldCount = in.nextChar
for (i <- 0 until fieldCount) parseField()
@@ -420,7 +422,8 @@ abstract class ClassfileParser {
}
}
}
- }
+ } else
+ parseAttributes(clazz, classInfo)
}
/** Add type parameters of enclosing classes */
@@ -789,6 +792,7 @@ abstract class ClassfileParser {
else
Some(AnnotationInfo(attrType, List(), nvpairs.toList))
} catch {
+ case f: FatalError => throw f // don't eat fatal errors, they mean a class was not found
case ex: Throwable => None // ignore malformed annotations ==> t1135
}
@@ -832,7 +836,7 @@ abstract class ClassfileParser {
// create a new class member for immediate inner classes
if (entry.outerName == externalName) {
val file = global.classPath.lookupPath(
- entry.externalName.replace('.', java.io.File.separatorChar).toString, false)
+ entry.externalName.replace('.', java.io.File.separatorChar).toString, false)
assert(file ne null, entry.externalName)
enterClassAndModule(entry.originalName, new global.loaders.ClassfileLoader(file, null, null), entry.jflags)
}
@@ -852,6 +856,13 @@ abstract class ClassfileParser {
val attrName = pool.getName(in.nextChar)
val attrLen = in.nextInt
attrName match {
+ case nme.SignatureATTR =>
+ if (!isScala && global.settings.target.value == "jvm-1.5")
+ hasMeta = true
+ in.skip(attrLen)
+ case nme.JacoMetaATTR =>
+ this.hasMeta = true
+ in.skip(attrLen)
case nme.ScalaSignatureATTR =>
isScala = true
in.skip(attrLen)