RFR: JDK-6956385: URLConnection.getLastModified() leaks file handles for jar:file and file: URLs [v3]
Jesse Glick
duke at openjdk.org
Mon May 22 16:07:02 UTC 2023
On Mon, 22 May 2023 15:58:01 GMT, Bernd <duke at openjdk.org> wrote:
>> Jesse Glick has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Leaving `FileURLConnection.is` non-null, and claiming `connected`, even after `closeInputStream` https://github.com/openjdk/jdk/pull/12871#discussion_r1199085883
>
> src/java.base/share/classes/sun/net/www/protocol/jar/JarURLConnection.java line 97:
>
>> 95: }
>> 96: } finally {
>> 97: if (jarFileURLConnection instanceof FileURLConnection fileURLConnection) {
>
> I Wonder if closing all urlconnection types or the ones with a special interface instead of a specific type (which also introduces a dependency) would be the better way? what about other connections with even more temporary resources (like a temporary file copy?)
See discussion at https://github.com/openjdk/jdk/pull/12871#discussion_r1198932229.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/12871#discussion_r1200725883
More information about the net-dev
mailing list