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

InstanceKlass::set_classpath_index does not match comments

    XMLWordPrintable

    Details

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

      Description

      https://github.com/openjdk/jdk/blob/699a3cde74eac74fb54b2ade94d437c010449f89/src/hotspot/share/oops/instanceKlass.cpp#L2928

      There's no checks of "the package of the InstanceKlass is in the boot loader's package entry table" in the product build.

      // Function set_classpath_index checks if the package of the InstanceKlass is in the
      // boot loader's package entry table. If so, then it sets the classpath_index
      // in the package entry record.
      //
      // The classpath_index field is used to find the entry on the boot loader class
      // path for packages with classes loaded by the boot loader from -Xbootclasspath/a
      // in an unnamed module. It is also used to indicate (for all packages whose
      // classes are loaded by the boot loader) that at least one of the package's
      // classes has been loaded.
      void InstanceKlass::set_classpath_index(s2 path_index, TRAPS) {
        if (_package_entry != NULL) {
          DEBUG_ONLY(PackageEntryTable* pkg_entry_tbl = ClassLoaderData::the_null_class_loader_data()->packages();)
          assert(pkg_entry_tbl->lookup_only(_package_entry->name()) == _package_entry, "Should be same");
          assert(path_index != -1, "Unexpected classpath_index");
          _package_entry->set_classpath_index(path_index);
        }
      }

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: