RFR: 8273369: Computing micros between two instants unexpectedly overflows for some cases [v5]

Naoto Sato naoto at openjdk.java.net
Wed Sep 8 15:38:10 UTC 2021

On Wed, 8 Sep 2021 13:58:59 GMT, Stephen Colebourne <scolebourne at openjdk.org> wrote:

> This change looks fine, but I think you also need a `millisUntil` private method to fix the identical overflow problem with millis (which might as well be fixed now).

`until()` for millis simply subtracts its `toEpochMilli()` from the end Instant's, so I am not sure that would cause the same false `ArithmeticException`. Can you please elaborate more?


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

More information about the core-libs-dev mailing list