Re: RFR: 8171382: java.time.Duration missing isPositive method

2021-07-23 Thread Naoto Sato
On Fri, 23 Jul 2021 19:37:44 GMT, Stephen Colebourne  
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


Re: RFR: 8171382: java.time.Duration missing isPositive method

2021-07-23 Thread Stephen Colebourne
On Fri, 23 Jul 2021 17:27:27 GMT, Naoto Sato  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


Re: RFR: 8171382: java.time.Duration missing isPositive method

2021-07-23 Thread Brian Burkhalter
On Fri, 23 Jul 2021 17:27:27 GMT, Naoto Sato  wrote:

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

Marked as reviewed by bpb (Reviewer).

-

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


Re: RFR: 8171382: java.time.Duration missing isPositive method

2021-07-23 Thread Iris Clark
On Fri, 23 Jul 2021 17:27:27 GMT, Naoto Sato  wrote:

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

Looks good!  I've also Reviewed the associated CSR.

-

Marked as reviewed by iris (Reviewer).

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


Re: RFR: 8171382: java.time.Duration missing isPositive method

2021-07-23 Thread Joe Wang
On Fri, 23 Jul 2021 17:27:27 GMT, Naoto Sato  wrote:

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

Marked as reviewed by joehw (Reviewer).

-

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


Re: RFR: 8171382: java.time.Duration missing isPositive method

2021-07-23 Thread Naoto Sato
On Fri, 23 Jul 2021 17:27:27 GMT, Naoto Sato  wrote:

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

Thanks, Roger. Modified the CSR as suggested.

-

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


Re: RFR: 8171382: java.time.Duration missing isPositive method

2021-07-23 Thread Roger Riggs
On Fri, 23 Jul 2021 17:27:27 GMT, Naoto Sato  wrote:

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

In the CSR, I would omit the "which is odd" from the "Problem".
and in the Solution, replace "integrity" with "completeness".

-

Marked as reviewed by rriggs (Reviewer).

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


RFR: 8171382: java.time.Duration missing isPositive method

2021-07-23 Thread Naoto Sato
Please review this PR to introduce `java.time.Duration.isPositive()` method. A 
CSR is also drafted.

-

Commit messages:
 - 8171382: java.time.Duration missing isPositive method

Changes: https://git.openjdk.java.net/jdk/pull/4892/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=4892=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8171382
  Stats: 31 lines in 2 files changed: 30 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4892.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4892/head:pull/4892

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