On Fri, 23 Jul 2021 17:27:27 GMT, Naoto Sato <na...@openjdk.org> wrote:

> Please review this PR to introduce `java.time.Duration.isPositive()` method. 
> A CSR is also drafted.

Marked as reviewed by scolebourne (Author).

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`.

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

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

Reply via email to