RFR: 8344908: URLClassPath should not propagate IllegalArgumentException when finding resources in classpath URLs [v4]

Jaikiran Pai jpai at openjdk.org
Tue Nov 26 06:56:28 UTC 2024


> Can I please get a review of this change that proposes to address the issue noted in https://bugs.openjdk.org/browse/JDK-8344908?
> 
> With this change, the URLClassPath will no longer propagate the `IllegalArgumentException` thrown when constructing a resource loader. The URL which caused the issue will continue to not be able to serve resources through that URLClassPath but the URLClassPath itself will now be functionally usable for locating resources through rest of the URLs. 
> 
> While at it, the internal class `FileURLMapper` which gets used in this code flow has been updated to be more confined by making it package private.
> 
> For addressing the underlying issue with ParseUtil we have https://bugs.openjdk.org/browse/JDK-8258246 which I plan to look into separately. There are also a few other usages of `ParseUtil.decode()` in various other places outside of this code flow which I plan to look into separately.
> 
> A new jtreg test has been introduced which reproduces the issue and verifies the fix. This test and other existing tests in tier1, tier2 and tier3 continue to pass with this change.

Jaikiran Pai has updated the pull request incrementally with three additional commits since the last revision:

 - minor code comment change
 - Files.createFile() instead of Files.writeString()
 - use Assumptions.abort() in test

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/22351/files
  - new: https://git.openjdk.org/jdk/pull/22351/files/20674bdc..c3482720

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=22351&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22351&range=02-03

  Stats: 6 lines in 1 file changed: 0 ins; 1 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/22351.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22351/head:pull/22351

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


More information about the core-libs-dev mailing list