RFR: 8341914: The j.u.Formatter doc for TemporalAccessor should be enhanced [v4]
Roger Riggs
rriggs at openjdk.org
Fri Dec 12 17:37:54 UTC 2025
On Fri, 12 Dec 2025 10:46:43 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:
>> Doc only change.
>
> Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove unused import.
src/java.base/share/classes/java/util/Formatter.java line 442:
> 440: * Not all subtypes of {@link TemporalAccessor} carry a time zone, though,
> 441: * so in such cases this conversion throws an {@link IllegalFormatConversionException}.
> 442: *
A more complete description would helpful before the table at line 388 and also
just after the mention of TemporalAccessor at line 1627, I'd suggest a sentence or paragraph with something like:
The `java.time` types such as `LocalDateTime `or `MonthDay` are TemporalAccessors.
Each of the formatting character uses fields from the TemporalAccessor but not all accessors have all of the field. For example, the timezone is not available from LocalDateTime. If a field is not available an IllegalFormatConversionException is thrown.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27830#discussion_r2615056459
More information about the core-libs-dev
mailing list