RFR: 8369595: HttpClient: HttpHeaders.firstValueAsLong failures should be converted to ProtocolException [v2]

Volkan Yazici vyazici at openjdk.org
Tue Nov 25 21:10:44 UTC 2025


On Tue, 25 Nov 2025 12:54:55 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java line 338:
>> 
>>> 336:         // expect-continue reads headers and body twice.
>>> 337:         // if we reach here, we must reset the headersReader state.
>>> 338:         finally {
>> 
>> Is this `finally` necessary? The `ProtocolException` is supposed to kill the connection anyway, so its internal state shouldn't matter much.
>> 
>> If it does matter, please move the `finally` to the closing brace of the `catch`; it looks odd now.
>
> Agreed.

Removed `finally` in 0c384717700.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28431#discussion_r2561403840


More information about the net-dev mailing list