On Fri, 23 Jul 2021 19:37:44 GMT, Stephen Colebourne <scolebou...@openjdk.org> 
wrote:

>> Please review this PR to introduce `java.time.Duration.isPositive()` method. 
>> A CSR is also drafted.
>
> src/java.base/share/classes/java/time/Duration.java line 596:
> 
>> 594:      */
>> 595:     public boolean isPositive() {
>> 596:         return (seconds | nanos) > 0;
> 
> I had to think whether this logic is correct, but I believe it is because 
> `nanos` is 32 bits and positive so won't impact the negative bit of `seconds`.

Thanks, Stephen. Yes, `nanos` is even smaller, less than `1,000,000,000`.

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

PR: https://git.openjdk.java.net/jdk/pull/4892

Reply via email to