Skip to content

Commit 45559a5

Browse files
committed
Backport 67c4a0826babb55ce56acf2b3b289b51d9d5529e
1 parent 06a5a17 commit 45559a5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2216,6 +2216,12 @@ private TypeAnnotationSymbolVisitor(List<Attribute.TypeCompound> attributes) {
22162216
this.attributes = attributes;
22172217
}
22182218

2219+
/**
2220+
* A supertype_index value of 65535 specifies that the annotation appears on the superclass
2221+
* in an extends clause of a class declaration, see JVMS 4.7.20.1
2222+
*/
2223+
public static final int SUPERCLASS_INDEX = 65535;
2224+
22192225
@Override
22202226
public Void visitClassSymbol(Symbol.ClassSymbol s, Void unused) {
22212227
ClassType t = (ClassType) s.type;
@@ -2225,7 +2231,7 @@ public Void visitClassSymbol(Symbol.ClassSymbol s, Void unused) {
22252231
interfaces.add(addTypeAnnotations(itf, classExtends(i++)));
22262232
}
22272233
t.interfaces_field = interfaces.toList();
2228-
t.supertype_field = addTypeAnnotations(t.supertype_field, classExtends(65535));
2234+
t.supertype_field = addTypeAnnotations(t.supertype_field, classExtends(SUPERCLASS_INDEX));
22292235
if (t.typarams_field != null) {
22302236
t.typarams_field =
22312237
rewriteTypeParameters(

0 commit comments

Comments
 (0)