RFR: 8273401: Disable JarIndex support in URLClassPath [v2]

Alan Bateman alanb at openjdk.java.net
Thu Sep 16 11:11:49 UTC 2021


On Thu, 16 Sep 2021 01:29:12 GMT, wxiang <github.com+53162078+shiyuexw at openjdk.org> wrote:

>> There is a bug for URLClassPath.findResources with JarIndex.
>> Currently, there was agreement on dropping the support from the URLClassLoader implementation but it was suggested that it should be disabled for a release or two before the code is removed. 
>> A system property can be used to re-enable JarIndex support in URLClassPath.
>> 
>> The PR includes:
>> Disable JarIndex support in URLClassPath by default.
>> Add system property jdk.net.URLClassPath.enableJarIndex to re-enable JarIndex support.
>
> wxiang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add isEmpty check

src/java.base/share/classes/jdk/internal/loader/URLClassPath.java line 949:

> 947:                 return checkResource(name, check, entry);
> 948: 
> 949:             if (index == null || !ENABLE_JAR_INDEX)

Is this needed? When ENABLE_JAR_INDEX is false then I assume index will always be null. I'm only asking is that it would be nice if ENABLE_JAR_INDEX was checked in one place rather than two.

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

PR: https://git.openjdk.java.net/jdk/pull/5524


More information about the core-libs-dev mailing list