On Wed, 18 Oct 2023 14:48:04 GMT, Conor Cleary <[email protected]> wrote:

>> src/java.net.http/share/classes/jdk/internal/net/http/Http2ClientImpl.java 
>> line 234:
>> 
>>> 232:                 connections.values().forEach(this::close);
>>> 233:                 connections.remove(entry.getKey(), entry.getValue());
>>> 234:             }
>> 
>> I'd suggest to change `this::close(Http2Connection)` to return boolean 
>> (instead of void) and make it always return`true`, and then use `removeIf` 
>> instead of forEach:
>> 
>> 
>> connections.values().removeIf(this::close);
>
> So effect of your suggested changes is to remove the connection if close 
> returns `true` as supposed to just removing all connections
> 
> This change is not entirely related to this PR. I will revert it and create a 
> seperate issue. Though the suggestion is good and I will apply it to the give 
> fix for that issue.

https://bugs.openjdk.org/browse/JDK-8318492

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15664#discussion_r1365584980

Reply via email to