-
Enhancement
-
Resolution: Won't Fix
-
P4
-
15
In ClassLoader::package_from_name, which takes a fully qualified class name, we check for and skip initial '['s. It seems to me this might be code that is asserting against accidental use of class signatures, which use leading ['s - e.g., "[Ljava/lang/String;"
According to JLS 6.7[1] the fully qualified class name for String should be "java.lang.String[]", transformed into internal form java/lang/String[] as described in JVMS 4.2.1[2].
I think the entire block testing for leading '['s can be replaced by an assert - or simplified.
[1] https://docs.oracle.com/javase/specs/jls/se14/html/jls-6.html#jls-6.7
[2] https://docs.oracle.com/javase/specs/jvms/se14/html/jvms-4.html#jvms-4.2.1
According to JLS 6.7[1] the fully qualified class name for String should be "java.lang.String[]", transformed into internal form java/lang/String[] as described in JVMS 4.2.1[2].
I think the entire block testing for leading '['s can be replaced by an assert - or simplified.
[1] https://docs.oracle.com/javase/specs/jls/se14/html/jls-6.html#jls-6.7
[2] https://docs.oracle.com/javase/specs/jvms/se14/html/jvms-4.html#jvms-4.2.1
- relates to
-
JDK-8237768 Refactor the class file parser's verification code into the signature API
-
- Closed
-