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

Pointless verification in get_package_entry_by_name

    XMLWordPrintable

    Details

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

      Description

      in modules.cpp:

      static PackageEntry* get_package_entry_by_name(Symbol* package,
                                                     Handle h_loader,
                                                     TRAPS) {
        if (package != NULL) {
          ResourceMark rm(THREAD);
          if (Modules::verify_package_name(package->as_C_string())) {
            PackageEntryTable* const package_entry_table =
              get_package_entry_table(h_loader);
            assert(package_entry_table != NULL, "Unexpected null package entry table");
            return package_entry_table->lookup_only(package);
          }
        }
        return NULL;
      }

      Since the package lookup would fail for any invalid package name, the call to verify_package_name appears pointless.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: