RFR: 8368856: Add methods for saturating Duration arithmetic to Instant [v7]
Pavel Rappo
prappo at openjdk.org
Thu Oct 9 10:34:06 UTC 2025
On Wed, 8 Oct 2025 20:01:15 GMT, Pavel Rappo <prappo at openjdk.org> wrote:
>> We're defining the values of MIN and MAX and they *could* be defined to be the negation of the other.
>> The defined use case is a sentinels and the exact value is less significant.
>> It just a different kind of oddity compared to twos-complement numbers that have their own asymmetry.
>
> Hm... I imagine it would be confusing if we did that. Should we ask about it on that recent core-libs-dev discussion thread?
Thinking about it more. Roger, I don't think we should define `Duration.MIN` as `Duration.MAX.negated()` now. We missed that opportunity long ago. `Duration` could've **initially** had the minimum addressable value as that.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27549#discussion_r2416324715
More information about the core-libs-dev
mailing list