RFR: 8303919: Instant.ofEpochMilli says it can throw an exception that it can't

Eamonn McManus emcmanus at openjdk.org
Thu Mar 9 21:26:46 UTC 2023


On Thu, 9 Mar 2023 21:03:38 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> You're picking on a fine point here that is data dependent, and there's not much value in changing it.

Could you elaborate on this a bit? The way I see it, the argument to `ofEpochMillis` is a `long` with the same meaning as `System.currentTimeMillis()` and the like. Every `long` value is valid, but the current spec implies otherwise. That means that people may waste their time trying to handle the documented exception even though it can never happen.

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

PR: https://git.openjdk.org/jdk/pull/12958


More information about the core-libs-dev mailing list