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

Remove unnecessary check made obsolete by JDK-8261941

XMLWordPrintable

    • b18

      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");

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

              Created:
              Updated:
              Resolved: