diff --git a/src/java.base/share/classes/java/util/Calendar.java b/src/java.base/share/classes/java/util/Calendar.java index c9b9dc41ec9..0414eebda8e 100644 --- a/src/java.base/share/classes/java/util/Calendar.java +++ b/src/java.base/share/classes/java/util/Calendar.java @@ -105,6 +105,10 @@ import sun.util.spi.CalendarProvider; * the Epoch) or values of the calendar fields. Calling the * {@code get}, {@code getTimeInMillis}, {@code getTime}, * {@code add} and {@code roll} involves such calculation. + * Unless otherwise specified, any {@code Calendar} method containing the + * parameter {@code int field} will throw an {@code ArrayIndexOutOfBoundsException} + * if the specified field is out of range ({@code field} < 0 || + * {@code field} >= {@link #FIELD_COUNT}). * *

Leniency

* @@ -1844,8 +1848,8 @@ public abstract class Calendar implements Serializable, Cloneable, Comparablefield < 0 || field >= FIELD_COUNT). + * @throws IllegalArgumentException if this {@code Calendar} is non-lenient and any + * of the calendar fields have invalid values. * @see #set(int,int) * @see #complete() */ @@ -1873,8 +1877,6 @@ public abstract class Calendar implements Serializable, Cloneable, Comparablefield < 0 || field >= FIELD_COUNT). * @see #areFieldsSet * @see #isTimeSet * @see #areAllFieldsSet @@ -1891,9 +1893,6 @@ public abstract class Calendar implements Serializable, Cloneable, Comparablefield < 0 || field >= FIELD_COUNT). - * in non-lenient mode. * @see #set(int,int,int) * @see #set(int,int,int,int,int) * @see #set(int,int,int,int,int,int) @@ -2816,6 +2815,9 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable