[9] RFR of 8069269: (spec) Defect in the System.nanoTime spec

Martin Buchholz martinrb at google.com
Tue Jan 27 00:59:16 UTC 2015


Looks good to me!  The best feature of the new code sample is that it not
only prevents overflow in the elapsed time computation, but also overflow
when adding to the timeout, and the latter is far more likely in practice
since users have good reasons to pick Integer.MAX_VALUE and MIN_VALUE as
"infinite" timeouts.  Of course, we paranoid folks know better and think
MAX_VALUE / 2 is plenty infinite enough!

On Mon, Jan 26, 2015 at 4:49 PM, Brian Burkhalter <
brian.burkhalter at oracle.com> wrote:

> Thanks, I think that reads better than the somewhat obscure verbiage we
> were discussing.
>
> It is formalized here:
>
> http://cr.openjdk.java.net/~bpb/8069269/webrev.01/
>
> On Jan 24, 2015, at 9:55 AM, Martin Buchholz <martinrb at google.com> wrote:
>
> How about:
>
> --- a/src/java.base/share/classes/java/lang/System.java
> +++ b/src/java.base/share/classes/java/lang/System.java
> @@ -376,19 +376,16 @@
>
>
>



More information about the core-libs-dev mailing list