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

Justin Lu jlu at openjdk.org
Thu Apr 20 21:14:00 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.

This pull request has now been integrated.

Changeset: 174c1a6d
Author:    Justin Lu <jlu at openjdk.org>
Committer: Naoto Sato <naoto at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/174c1a6d53d3ea95649a511f4088c7807d80b59b
Stats:     20 lines in 1 file changed: 13 ins; 5 del; 2 mod

4737887: (cal) API: Calendar methods taking field should document exceptions

Reviewed-by: naoto

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

PR: https://git.openjdk.org/jdk/pull/13234


More information about the i18n-dev mailing list