-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b18
This line in ClassReader uses a literal 65535, which encodes the supertype_index of a superclass:
t.supertype_field = addTypeAnnotations(t.supertype_field, classExtends(65535));
https://github.com/openjdk/jdk/blob/7f1dae12e5e24d204a70cf610a8c482996556931/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L2364
The constant is defined in the JVMS:
> A supertype_index value of 65535 specifies that the annotation appears on the superclass in an extends clause of a class declaration.
https://docs.oracle.com/javase/specs/jvms/se21/html/jvms-4.html#jvms-4.7.20.1
Vicente observed that extracting that value to a documented constant would improve the readability of the code.
t.supertype_field = addTypeAnnotations(t.supertype_field, classExtends(65535));
https://github.com/openjdk/jdk/blob/7f1dae12e5e24d204a70cf610a8c482996556931/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L2364
The constant is defined in the JVMS:
> A supertype_index value of 65535 specifies that the annotation appears on the superclass in an extends clause of a class declaration.
https://docs.oracle.com/javase/specs/jvms/se21/html/jvms-4.html#jvms-4.7.20.1
Vicente observed that extracting that value to a documented constant would improve the readability of the code.
- links to
-
Commit(master) openjdk/jdk/68c4f368
-
Review(master) openjdk/jdk/20970