On Wed, 31 Mar 2021 11:24:02 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:

>> Current fix tries to tackle an issue with URL connection referencing 
>> non-existing Jar file entries:
>> If an entry that doesn't exist is specified in an URL connection the 
>> underlying Jar file is still cached even if an exception is thrown after 
>> that. Such behavior prevents the caller, for instance, a `URLClassLoader`, 
>> from closing a Jar file.
>> 
>> The proposed fix checks if entry exists before caching a Jar file (only for 
>> cases with enabled caching):
>> - If entry exists - jar file is cached if it wasn't cached before
>> - If entry doesn't exist and jar file wasn't cached before - jar file is 
>> closed and exception is thrown
>> - If entry doesn't exist and jar file was cached before - jar file is kept 
>> cached and exception is thrown
>> 
>> 
>> The following tests have been used to verify the fix:
>> - New regression tests
>> - ``:jdk_core:`` tests
>> - `api/java_util`,`api/java_net` JCK tests
>
> Hi Aleksei, thanks for putting this together.
> 
> `test/jdk/sun/misc/URLClassPath/RemoveJar.java` seems to be an older version 
> of `test/jdk/java/net/URLClassLoader/RemoveJar.java`. The two tests are 
> almost identical - so `test/jdk/sun/misc/URLClassPath/RemoveJar.java` can 
> probably be removed from the PR.
> 
> Otherwise the proposed changes look good to me.

Thanks for the review, Daniel. It is correct that 
`test/jdk/sun/misc/URLClassPath/RemoveJar.java` is an old version. It is 
removed now.

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

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

Reply via email to