jdk/src/java.base/share/classes/sun
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
..
invoke 8310849: Pattern matching for instanceof and arrayType cleanup in j.l.invoke and j.l.reflect 2023-06-27 16:10:50 +00:00
launcher 8309670: java -help output for --module-path / -p is incomplete 2023-06-23 11:09:37 +00:00
net 6956385: URLConnection.getLastModified() leaks file handles for jar:file and file: URLs 2023-06-28 15:33:37 +00:00
nio 8167252: Some of Charset.availableCharsets() does not contain itself 2023-06-15 16:34:00 +00:00
reflect 8310849: Pattern matching for instanceof and arrayType cleanup in j.l.invoke and j.l.reflect 2023-06-27 16:10:50 +00:00
security 8279254: PKCS9Attribute SigningTime always encoded in UTFTime 2023-06-23 15:31:16 +00:00
text 8291660: Grapheme support in BreakIterator 2022-09-09 17:13:51 +00:00
util 8301492: Modernize equals() method of ResourceBundle.CacheKey and Bundles.CacheKey 2023-06-26 19:41:43 +00:00