RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values
Volkan Yazici
vyazici at openjdk.org
Wed Oct 29 20:44:01 UTC 2025
On Wed, 29 Oct 2025 19:16:03 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Introduce necessary fixes to address exceptions thrown when excessive `Duration`s are provided to `Duration`-accepting `HttpClient` public APIs.
>
> src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 321:
>
>> 319: }
>> 320: }
>> 321:
>
> Do we need to change this method? I would just revert them.
`Duration#between(Temporal,Temporal)` can throw `DateTimeException` and `ArithmeticException`, but not in our case due to the reason I elaborated in the comment. In this change, I've removed these two exceptions from the Javadoc, since they cannot happen.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2475376403
More information about the net-dev
mailing list