On Mon, 3 Nov 2025 14:10:47 GMT, Volkan Yazici <[email protected]> wrote:

>> Introduce necessary fixes to address exceptions thrown when excessive 
>> `Duration`s are provided to `Duration`-accepting `HttpClient` public APIs.
>
> Volkan Yazici has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains seven additional 
> commits since the last revision:
> 
>  - Merge remote-tracking branch 'upstream/master' into bigDuration
>  - Merge remote-tracking branch 'upstream/master' into bigDuration
>  - Simplify exception handling in `Deadline::between`
>    
>    Co-authored-by: Daniel Fuchs <[email protected]>
>  - Move `delta == 0` in `until()` to the catch block
>  - Add `DeadlineOverflowTest`
>  - Fix duration overflows
>  - Add `DurationOverflowTest`

src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 
43:

> 41:  * numeric overflow, {@link #plus(Duration) plus()} will return
> 42:  * {@link Deadline#MAX} if the provided duration is positive,
> 43:  * {@link Deadline#MIN} otherwise.

Instead of speaking of overflow I wonder if we should say:


Operations that add durations to a {@code Deadline}, whether represented as
a `Duration` or as a `long` time increment (such as seconds or nano seconds) do
not throw if the resulting {@code Deadline} would exceed {@link #MAX} or be less
than {@link #MIN}. Instead, {@code MAX} or {@code MIN} are returned, 
respectively.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2486686631

Reply via email to