Clean up ClassLoader::package_from_class_name API

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P4
    • 15
    • Affects Version/s: 15
    • Component/s: hotspot

      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

            Assignee:
            Claes Redestad
            Reporter:
            Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: