RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v2]
Daniel Fuchs
dfuchs at openjdk.org
Thu Oct 30 10:45:45 UTC 2025
On Wed, 29 Oct 2025 20:40:59 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:
>> 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.
Oh - yes we don't take Temporal but Deadline as paramater which eliminates the possibility of overflow.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2477384162
More information about the net-dev
mailing list