jdk/src/java.base
Jesse Glick 9f98136c3a 6956385: URLConnection.getLastModified() leaks file handles for jar:file and file: URLs
Define FileURLConnection.closeInputStream for use by JarURLInputStream.close.
JarURLConnection properly tracks any InputStream it itself opened,
and correspondingly closes the JarFile if necessary (when caches are disabled).
But if its underlying FileURLConnection was used to retrieve a header field,
that would have caused a FileInputStream to be opened
which never gets closed until it is garbage collected.
This means that an application which calls certain methods
on jar:file:/…something.jar!/… URLs will leak file handles,
even if URLConnection caches are supposed to be turned off.
This can delay release of system resources,
and on Windows can prevent the JAR file from being deleted
even after it is no longer in use (for example after URLClassLoader.close).

Reviewed-by: dfuchs, michaelm
2023-06-28 15:33:37 +00:00
..
aix 8309219: Fix xlc17 clang 15 warnings in java.base 2023-06-07 13:42:03 +00:00
linux 8305809: (fs) Review obsolete Linux kernel dependency on os.version (Unix kernel 2.6.39) 2023-04-11 16:59:11 +00:00
macosx 8310549: avoid potential leaks in KeystoreImpl.m related to JNU_CHECK_EXCEPTION early returns 2023-06-22 07:08:54 +00:00
share 6956385: URLConnection.getLastModified() leaks file handles for jar:file and file: URLs 2023-06-28 15:33:37 +00:00
unix 8310265: (process) jspawnhelper should not use argv[0] 2023-06-21 04:55:43 +00:00
windows 8308780: Fix the Java Integer types on Windows 2023-06-25 23:41:54 +00:00