-
Enhancement
-
Resolution: Fixed
-
P4
-
20
-
b02
In Class loading, SystemDictionary::resolve_super_or_fail calls resolve_instance_class_or_null_helper which strips off class name envelope of L<name>;. All super class names come from the constant pool or from InstanceKlass->name(), which are already checked that they don't have envelopes. The class format checker checks that super class names don't have envelopes and throws a LinkageError if so. This extra stripping is unnecessary and resolve_super_or_fail() should call resolve_instance_class_or_null() directly.
$ java A
Error: LinkageError occurred while loading main class A
java.lang.ClassFormatError: Illegal class name "LB;" in class file A
It was changed from resolve_or_null() inJDK-8208999: Some use of Klass* should be replaced by InstanceKlass*
Which preserved its behavior but it doesn't need to parse the envelope for the super-class name.
- Klass* superk = SystemDictionary::resolve_or_null(class_name,
- class_loader,
- protection_domain,
- THREAD);
+ InstanceKlass* superk =
+ SystemDictionary::resolve_instance_class_or_null_helper(super_name,
+ class_loader,
+ protection_domain,
+ THREAD);
$ java A
Error: LinkageError occurred while loading main class A
java.lang.ClassFormatError: Illegal class name "LB;" in class file A
It was changed from resolve_or_null() in
Which preserved its behavior but it doesn't need to parse the envelope for the super-class name.
- Klass* superk = SystemDictionary::resolve_or_null(class_name,
- class_loader,
- protection_domain,
- THREAD);
+ InstanceKlass* superk =
+ SystemDictionary::resolve_instance_class_or_null_helper(super_name,
+ class_loader,
+ protection_domain,
+ THREAD);