RFR: 8311032: Empty value for java.protocol.handler.pkgs system property can lead to unnecessary classloading attempts of protocol handlers

Jaikiran Pai jpai at openjdk.org
Wed Jun 28 11:22:15 UTC 2023


Can I please get a review for this change which proposes to address https://bugs.openjdk.org/browse/JDK-8311032?

The commit in this PR skips the class lookups when the package name prefix is empty, either due to the `java.protocol.handler.pkgs` system property value being empty or due to individual parts of the `|` delimited value being empty.

This avoids potentially expensive classloading attempts for a class name of the form `.foo.Handler`, which is bound to fail.

No new jtreg test has been added given the nature of the change. There's already an existing test `test/jdk/java/net/URL/HandlersPkgPrefix/HandlersPkgPrefix.java` which tests different values for the `java.protocol.handler.pkgs` system property (including empty value) and that test continues to pass with this change.

tier testing is currently in progress.

-------------

Commit messages:
 - 8311032: Empty value for java.protocol.handler.pkgs system property can lead to unnecessary classloading attempts of protocol handlers

Changes: https://git.openjdk.org/jdk/pull/14693/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14693&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8311032
  Stats: 5 lines in 1 file changed: 3 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/14693.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14693/head:pull/14693

PR: https://git.openjdk.org/jdk/pull/14693


More information about the net-dev mailing list