RFR: 8326568: jdk/test/com/sun/net/httpserver/bugs/B6431193.java should use try-with-resource and try-finally [v2]

Daniel Fuchs dfuchs at openjdk.org
Tue Apr 2 13:30:13 UTC 2024


On Wed, 27 Mar 2024 15:11:40 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Darragh Clarke has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   implemented feedback
>
> test/jdk/com/sun/net/httpserver/bugs/B6431193.java line 60:
> 
>> 58:                     t.sendResponseHeaders(200, response.length());
>> 59:                     os.write(response.getBytes());
>> 60:                     os.close();
> 
> no need to call `os.close()` here since it will be called by the `try ( ) { }` block.

line with `os.close()` should be removed

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18514#discussion_r1547882399


More information about the net-dev mailing list