Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8288134

Super class names don't have envelopes

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 20
    • 20
    • hotspot
    • b02

    Description

      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() in JDK-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);

      Attachments

        Issue Links

          Activity

            People

              coleenp Coleen Phillimore
              coleenp Coleen Phillimore
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: