RFR 9: 8067796: (process) Process.waitFor(timeout, unit) doesn't throw NPE if timeout is less than, or equal to zero when unit == null

Chris Hegarty chris.hegarty at oracle.com
Mon Mar 23 11:28:34 UTC 2015


On 20/03/15 22:23, Martin Buchholz wrote:
> I probably implemented it the way it is intentionally.  I would leave it.
> ....
>
> Just move
>
> long remainingNanos = unit.toNanos(timeout);
>
> ...
>>
>> Webrev:
>>       ://cr.openjdk.java.net/~rriggs/webrev-npe-8067796/

Either change is fine with me. I do like the explicitness of 
requiresNonNull, but I guess with the addition of the test then this is 
unlikely to creep back in.

-Chris.



More information about the core-libs-dev mailing list