On Wed, 29 Jul 2026 16:28:45 GMT, Daniel Jeliński <[email protected]> wrote:

>> src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java
>>  line 529:
>> 
>>> 527:                         requestMoreDataIfNeeded();
>>> 528:                         return;
>>> 529:                     }
>> 
>> Why are these lines removed, and also the two lines above that set the 
>> `handshaking` flag?
>
> they were flagged by IntelliJ as dead code; `handshaking` is always false. It 
> is initialized to `false` at the beginning of the `while` loop, and only set 
> to `true` immediately before `continue` or `break` (i. e. just before being 
> reset back to `false` or going out of scope).
> 
> I also tried changing this to `if (!complete)`, but that resulted in test 
> failures.

You are indeed right, this `if` block is dead code in its current form. I had a 
look at the history of this code and it looks like the `if` block ended up 
being dead code since the change in https://bugs.openjdk.org/browse/JDK-8204679.

However, this (dead code) was also updated through 
https://bugs.openjdk.org/browse/JDK-8231449 and that 
https://github.com/openjdk/jdk/commit/ecde34ee359b42bce7670cef3915a87fb8406bca 
introduced the call to `requestMoreDataIfNeeded();` in that `if` block. 

In its current form of course this code never executes, so it's OK to remove 
it. Separately we might have to understand if anything else needs to be done 
here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32089#discussion_r3680813097

Reply via email to