RFR: 8309939: HttpClient should not use Instant.now() as Instant source for deadlines [v4]

Daniel Fuchs dfuchs at openjdk.org
Wed Jun 14 15:39:13 UTC 2023


On Wed, 14 Jun 2023 13:47:17 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Daniel Fuchs has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - more cleanup
>>  - whitespaces
>
> src/java.net.http/share/classes/jdk/internal/net/http/common/TimeSource.java line 36:
> 
>> 34:  * caused by changes to the wall clock. Consequently, callers should use
>> 35:  * instants returned by this time source solely for the purpose of
>> 36:  * comparing them with other instants returned by this same time source.
> 
> Do not use `Instant` as the value from this time source. It is not comparable with the real Instants and would be misleading and cause bugs.

OK. Here is a version that uses a new class "Deadline" instead of "Instant".

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14450#discussion_r1229818891


More information about the net-dev mailing list