RFR: 8294226: Document missing UnsupportedTemporalTypeException

Roger Riggs rriggs at openjdk.org
Mon Jun 16 17:47:28 UTC 2025


On Mon, 16 Jun 2025 16:36:43 GMT, Gautham Krishnan <gkrishnan at openjdk.org> wrote:

> Some methods in the java.time.chrono interfaces—ChronoLocalDate, ChronoLocalDateTime, and ChronoZonedDateTime—override methods from the java.time.temporal.Temporal interface that are documented to throw UnsupportedTemporalTypeException when given unsupported fields or units.
> 
> These overridden methods include:
> 
> with(TemporalField, long)
> 
> plus(long, TemporalUnit)
> 
> minus(long, TemporalUnit)
> 
> However, their Javadoc in the chrono interfaces does not mention the possibility of this exception, resulting in incomplete or inconsistent documentation. This contrasts with the parent Temporal interface, which explicitly documents the exception.

Looks good.

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

Marked as reviewed by rriggs (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25836#pullrequestreview-2932969154


More information about the core-libs-dev mailing list