RFR: 8303919: Instant.ofEpochMilli says it can throw an exception that it can't [v2]
Eamonn McManus
emcmanus at openjdk.org
Tue May 2 19:54:14 UTC 2023
> Instant.ofEpochMilli says this:
>
>
> @throws DateTimeException if the instant exceeds the maximum or minimum instant
>
>
> But that can't happen. Even given `Long.MIN_VALUE` or `Long.MAX_VALUE` it does not throw. That's already implicitly tested in [`TestInstant`](https://github.com/openjdk/jdk/blob/a9dba565688a29bef8626488c47519008dcadbe8/test/jdk/java/time/test/java/time/TestInstant.java#L84), which calls it with both those values.
Eamonn McManus has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
- Merge branch 'openjdk:master' into ofepochmilli
- 8303919: Instant.ofEpochMilli javadoc bug
Instant.ofEpochMilli says this:
```
@throws DateTimeException if the instant exceeds the maximum or minimum instant
```
But that can't happen. Even given `Long.MIN_VALUE` or `Long.MAX_VALUE`
it does not throw. That's already implicitly tested in
[`TestInstant`](https://github.com/openjdk/jdk/blob/a9dba565688a29bef8626488c47519008dcadbe8/test/jdk/java/time/test/java/time/TestInstant.java#L84),
which calls it with both those values.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/12958/files
- new: https://git.openjdk.org/jdk/pull/12958/files/a902d216..4ef7b053
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=12958&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=12958&range=00-01
Stats: 437214 lines in 4534 files changed: 333479 ins; 64197 del; 39538 mod
Patch: https://git.openjdk.org/jdk/pull/12958.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/12958/head:pull/12958
PR: https://git.openjdk.org/jdk/pull/12958
More information about the core-libs-dev
mailing list