RFC: 8132359: JarURLConnection.getJarFile() resource leak when file is not found

Alex Kashchenko akashche at redhat.com
Sat Mar 14 00:08:11 UTC 2020


Based on these maillist threads:


I am looking for comments and suggestions, whether the following change 
to JarURLConnection.getJarFile() behaviour may be acceptable:

If, during connect() call, jarFile itself was created successfully, but 
access to (non-existent) jarEntry failed - return this jarFile to caller 
instead of throwing exception.

bug: https://bugs.openjdk.java.net/browse/JDK-8132359
webrev: http://cr.openjdk.java.net/~akasko/jdk/8132359/webrev.00/

This change also allows to fix JDK-8232854 with the minimal change to 
URLClassPath (included with the patch).

This change doesn't cause regression failures in java/net.

This change causes one compatibility failure, when getManifest() doesn't 
throw expected IOException when URL points to non-existent class inside JAR.


More information about the core-libs-dev mailing list