On Mon, 3 Feb 2025 07:59:02 GMT, Stephen Colebourne <scolebou...@openjdk.org> wrote:
>> Shaojin Wen has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - typo >> - bug fix, from @jodastephen >> - bug fix, from @jodastephen >> - typo > > src/java.base/share/classes/java/time/temporal/TemporalAccessor.java line 327: > >> 325: * @return the year, from MIN_YEAR to MAX_YEAR >> 326: */ >> 327: default int getYear() { > > The whole point of `TemporalAccessor` is that it does not have methods like > these - it does not assume anything about the temporal. If these methods are not added here, query will be called during formatting, which will incur some overhead. By providing these methods, if these Fields are not supported by the implementation of the TemporalAccessor, the error reporting behavior will remain the same as before. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23384#discussion_r1939350252