RFR: 8361249: PlainHttpConnection connection logic can be simplified [v3]

Daniel Fuchs dfuchs at openjdk.org
Fri Jul 4 08:34:53 UTC 2025


On Thu, 3 Jul 2025 12:56:00 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> src/java.net.http/share/classes/jdk/internal/net/http/PlainHttpConnection.java line 1:
>> 
>>> 1: /*
>> 
>> Shouldn't we remove the following too?
>> 
>> 1. The `unsuccessfulAttempts` field
>> 2. `jdk.internal.net.http.common.TimeSource` import
>
> Good point.

Done.

>> src/java.net.http/share/classes/jdk/internal/net/http/PlainHttpConnection.java line 232:
>> 
>>> 230:         }
>>> 231:         return cf.thenApply((state)->{
>>> 232:             if (debug.on()) debug.log("%s: %s", label(), state);
>> 
>> AFAICT, this is the only place where a `ConnectState` is _read_. Alternatively, we can remove the `ConnectState` enum and add `debug.log()` statements where `ConnectState` were assigned.
>
> I know. I hesitated and eventually decided to keep it.

Now removed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26087#discussion_r2184725364
PR Review Comment: https://git.openjdk.org/jdk/pull/26087#discussion_r2184732569


More information about the net-dev mailing list