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

Remove unnecessary check made obsolete by JDK-8261941

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 19
    • Fix Version/s: 19
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b18

      Description

      The second "if" block below was added in JDK-8267347

      https://github.com/openjdk/jdk/blob/1864481df10d2f616cbfdecebf3bebbae04de5e1/src/hotspot/share/classfile/systemDictionaryShared.cpp#L1047

      SystemDictionaryShared::record_linking_constraint() {
        ....

        if (!is_system_class_loader(klass_loader) &&
            !is_platform_class_loader(klass_loader)) {
           ...
          return;
        }

        if (DumpSharedSpaces && !is_builtin(klass)) {
          // During static dump, unregistered classes (those intended for
          // custom loaders) are loaded by the boot loader. Need to
          // exclude these for the same reason as above.
          // This should be fixed by JDK-8261941.
          return;
        }

      Since JDK-8261941, unregistered classes are loaded by URLClassLoaders created by UnregisteredClasses::create_url_classloader(). Thus, they will be covered by the first "if" block.

      So the second "if" block can be removed and replaced with

          assert(is_builtin(klass), "must be");

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ccheung Calvin Cheung
              Reporter:
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: