<i18n dev> RFR: 4737887: (cal) API: Calendar methods taking field should document exceptions

Naoto Sato naoto at openjdk.org
Fri Apr 14 21:11:34 UTC 2023


On Wed, 29 Mar 2023 22:04:08 GMT, Justin Lu <jlu at openjdk.org> wrote:

> Many Calendar methods that take in a field parameter should document that they throw an ArrayIndexOutOfBoundsException if field is not between 0 and `Calendar.FIELD_COUNT`.
> 
> This PR adds a clause to the class description to make the above apparent.
> 
> `Calendar.Roll(int, int)`, `Calendar.roll(int, boolean)`, and `Calendar.add(int, int)` should all be documented that they throw an `IllegalArgumentException` if any calendar fields have out-of-range values in non-lenient mode or if field is
> `Calendar.ZONE_OFFSET`, `Calendar.DST_OFFSET`, or unknown.

Looks good, Justin. Nit: copyright year -> 2023

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

Marked as reviewed by naoto (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13234#pullrequestreview-1386182763


More information about the i18n-dev mailing list