RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v2]
Volkan Yazici
vyazici at openjdk.org
Wed Oct 29 20:53:24 UTC 2025
On Wed, 29 Oct 2025 19:03:19 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Move `delta == 0` in `until()` to the catch block
>
> src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 233:
>
>> 231: public long until(Deadline endExclusive, TemporalUnit unit) {
>> 232: int delta = compareTo(endExclusive);
>> 233: if (delta == 0) return 0;
>
> I'd suggest moving these two lines into the catch clause. We only need the comparison when an exception is raised. I don't think the case where we would get 0 occurs very often, and it would be handled correctly (without throwing) by the regular path anyway.
Implemented in 856aea735cf.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2475406481
More information about the net-dev
mailing list