RFR: 8367561: Getting some "header" property from a file:// URL causes a file descriptor leak [v3]

Jaikiran Pai jpai at openjdk.org
Wed Oct 8 10:10:58 UTC 2025


On Tue, 7 Oct 2025 09:00:59 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:

>> Jaikiran Pai has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>> 
>>  - Daniel's suggestion - don't repeat/copy code from super()
>>  - merge latest from master branch
>>  - missed pushing the change
>>  - 8367561: fix inputstream leak
>>  - 8367561: introduce tests
>
> src/java.base/share/classes/sun/net/www/protocol/file/FileURLConnection.java line 125:
> 
>> 123:             } else {
>> 124:                 try (var _ = new FileInputStream(file.getPath())) {
>> 125:                 }
> 
> *Nit:* You can consider shortening this to `new FileInputStream(file.getPath()).close()`.

Done, I've updated the PR to use this construct.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27633#discussion_r2413308770


More information about the net-dev mailing list