@@ -234,11 +234,13 @@ class ClassfileParser(
234
234
val member = newSymbol(
235
235
getOwner(jflags), preName.name, sflags, completer,
236
236
getPrivateWithin(jflags), coord = start)
237
- getScope(jflags).enter(member)
238
237
239
238
val pt = if sig.size == 1 then constantTagToType(sig(0 )) else WildcardType
240
239
val isVarargs = sflags.is(Flags .Method ) && (jflags & JAVA_ACC_VARARGS ) != 0
241
240
completer.attrCompleter = parseAttributes(member, pt, isVarargs)
241
+
242
+ getScope(jflags).enter(member)
243
+
242
244
}
243
245
else {
244
246
in.nextChar // info
@@ -610,6 +612,7 @@ class ClassfileParser(
610
612
}
611
613
612
614
abstract class AttributeCompleter {
615
+ var exceptions : List [NameOrString ] = Nil
613
616
def complete (tp : Type )(using Context ): Type
614
617
}
615
618
@@ -620,6 +623,10 @@ class ClassfileParser(
620
623
val res = new AttributeCompleter {
621
624
def complete (tp : Type )(using Context ): Type = {
622
625
val newType = if (typeUpdate.isEmpty) tp else typeUpdate.get
626
+ exceptions.foreach { ex =>
627
+ val cls = getClassSymbol(ex.name)
628
+ sym.addAnnotation(ThrowsAnnotation (cls.asClass))
629
+ }
623
630
cook.apply(newType)
624
631
}
625
632
}
@@ -692,8 +699,8 @@ class ClassfileParser(
692
699
val nClasses = in.nextChar
693
700
for (n <- 0 until nClasses) {
694
701
// FIXME: this performs an equivalent of getExceptionTypes instead of getGenericExceptionTypes (SI-7065)
695
- val cls = pool.getClassSymbol (in.nextChar.toInt)
696
- sym.addAnnotation( ThrowsAnnotation ( cls.asClass))
702
+ val cls = pool.getClassName (in.nextChar.toInt)
703
+ res.exceptions ::= cls
697
704
}
698
705
}
699
706
@@ -934,9 +941,9 @@ class ClassfileParser(
934
941
if (innerIndex != 0 && outerIndex != 0 && nameIndex != 0 ) {
935
942
val inner = pool.getClassName(innerIndex)
936
943
val outer = pool.getClassName(outerIndex)
937
- val name = pool.getClassName (nameIndex)
944
+ val name = pool.getName (nameIndex)
938
945
val entry = InnerClassEntry (inner, outer, name, jflags)
939
- innerClasses(pool.getClassName(innerIndex) .value) = entry
946
+ innerClasses(inner .value) = entry
940
947
}
941
948
}
942
949
}
0 commit comments