<i18n dev> RFR: 8367704: Fix minor documentation issues in java.time.** [v6]

Pavel Rappo prappo at openjdk.org
Wed Sep 17 14:40:06 UTC 2025


On Wed, 17 Sep 2025 13:58:03 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> I don't understand. Let's consider an example:
>> 
>>     jshell> import java.time.*
>>     
>>     jshell> var i = Instant.now();
>>     i ==> 2025-09-16T21:44:06.464393Z
>>     
>>     jshell> Duration.between(i, i).abs().isPositive()
>>     $3 ==> false
>> 
>> So, `abs()` does not translate any duration into positive duration. There exists duration `d` such that `!d.abs().isPositive()`. Any duration for which `d.equals(Duration.ZERO)` is like that.
>
> Joe's suggestion of "non-negative" (instead of positive) is probably the best replacement.
> 
> Mentioning using `abs()` with a zero argument didn't parse well.

Okay, but don't we need some verbiage -- however little -- on what "non-negative" means for Duration, or we consider it self-evident? (Genuine question.)

Can we also tie this change with "positive or negative" for primitive components?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27296#discussion_r2355757830


More information about the i18n-dev mailing list