< prev index next >

src/java.base/share/classes/java/util/Calendar.java

Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea

*** 2098,2112 **** * (any calendar types specified by {@code locale} are ignored) * @return the string representation of the given * {@code field} in the given {@code style}, or * {@code null} if no string representation is * applicable. ! * @exception IllegalArgumentException * if {@code field} or {@code style} is invalid, * or if this {@code Calendar} is non-lenient and any * of the calendar fields have invalid values ! * @exception NullPointerException * if {@code locale} is null * @since 1.6 */ public String getDisplayName(int field, int style, Locale locale) { if (!checkDisplayNameParams(field, style, SHORT, NARROW_FORMAT, locale, --- 2098,2112 ---- * (any calendar types specified by {@code locale} are ignored) * @return the string representation of the given * {@code field} in the given {@code style}, or * {@code null} if no string representation is * applicable. ! * @throws IllegalArgumentException * if {@code field} or {@code style} is invalid, * or if this {@code Calendar} is non-lenient and any * of the calendar fields have invalid values ! * @throws NullPointerException * if {@code locale} is null * @since 1.6 */ public String getDisplayName(int field, int style, Locale locale) { if (!checkDisplayNameParams(field, style, SHORT, NARROW_FORMAT, locale,
*** 2189,2203 **** * the locale for the display names * @return a {@code Map} containing all display names in * {@code style} and {@code locale} and their * field values, or {@code null} if no display names * are defined for {@code field} ! * @exception IllegalArgumentException * if {@code field} or {@code style} is invalid, * or if this {@code Calendar} is non-lenient and any * of the calendar fields have invalid values ! * @exception NullPointerException * if {@code locale} is null * @since 1.6 */ public Map<String, Integer> getDisplayNames(int field, int style, Locale locale) { if (!checkDisplayNameParams(field, style, ALL_STYLES, NARROW_FORMAT, locale, --- 2189,2203 ---- * the locale for the display names * @return a {@code Map} containing all display names in * {@code style} and {@code locale} and their * field values, or {@code null} if no display names * are defined for {@code field} ! * @throws IllegalArgumentException * if {@code field} or {@code style} is invalid, * or if this {@code Calendar} is non-lenient and any * of the calendar fields have invalid values ! * @throws NullPointerException * if {@code locale} is null * @since 1.6 */ public Map<String, Integer> getDisplayNames(int field, int style, Locale locale) { if (!checkDisplayNameParams(field, style, ALL_STYLES, NARROW_FORMAT, locale,
*** 2309,2319 **** * externally by calling one of the setter methods rather than by the * internal time calculation. * * @return <code>true</code> if the field has been set externally, * <code>false</code> otherwise. ! * @exception IndexOutOfBoundsException if the specified * <code>field</code> is out of range * (<code>field &lt; 0 || field &gt;= FIELD_COUNT</code>). * @see #selectFields() * @see #setFieldsComputed(int) */ --- 2309,2319 ---- * externally by calling one of the setter methods rather than by the * internal time calculation. * * @return <code>true</code> if the field has been set externally, * <code>false</code> otherwise. ! * @throws IndexOutOfBoundsException if the specified * <code>field</code> is out of range * (<code>field &lt; 0 || field &gt;= FIELD_COUNT</code>). * @see #selectFields() * @see #setFieldsComputed(int) */
*** 2342,2352 **** * <em>computed</em>. This state means that the specified calendar fields * have valid values that have been set by internal time calculation * rather than by calling one of the setter methods. * * @param fieldMask the field to be marked as computed. ! * @exception IndexOutOfBoundsException if the specified * <code>field</code> is out of range * (<code>field &lt; 0 || field &gt;= FIELD_COUNT</code>). * @see #isExternallySet(int) * @see #selectFields() */ --- 2342,2352 ---- * <em>computed</em>. This state means that the specified calendar fields * have valid values that have been set by internal time calculation * rather than by calling one of the setter methods. * * @param fieldMask the field to be marked as computed. ! * @throws IndexOutOfBoundsException if the specified * <code>field</code> is out of range * (<code>field &lt; 0 || field &gt;= FIELD_COUNT</code>). * @see #isExternallySet(int) * @see #selectFields() */
*** 2379,2389 **** * <code>Calendar</code> becomes that all the calendar fields are in sync * with the time value (millisecond offset from the Epoch). * * @param fieldMask the field mask indicating which calendar fields are in * sync with the time value. ! * @exception IndexOutOfBoundsException if the specified * <code>field</code> is out of range * (<code>field &lt; 0 || field &gt;= FIELD_COUNT</code>). * @see #isExternallySet(int) * @see #selectFields() */ --- 2379,2389 ---- * <code>Calendar</code> becomes that all the calendar fields are in sync * with the time value (millisecond offset from the Epoch). * * @param fieldMask the field mask indicating which calendar fields are in * sync with the time value. ! * @throws IndexOutOfBoundsException if the specified * <code>field</code> is out of range * (<code>field &lt; 0 || field &gt;= FIELD_COUNT</code>). * @see #isExternallySet(int) * @see #selectFields() */
*** 2804,2816 **** * is equal to the time represented by this <code>Calendar</code>; a value * less than <code>0</code> if the time of this <code>Calendar</code> is * before the time represented by the argument; and a value greater than * <code>0</code> if the time of this <code>Calendar</code> is after the * time represented by the argument. ! * @exception NullPointerException if the specified <code>Calendar</code> is * <code>null</code>. ! * @exception IllegalArgumentException if the time value of the * specified <code>Calendar</code> object can't be obtained due to * any invalid calendar values. * @since 1.5 */ @Override --- 2804,2816 ---- * is equal to the time represented by this <code>Calendar</code>; a value * less than <code>0</code> if the time of this <code>Calendar</code> is * before the time represented by the argument; and a value greater than * <code>0</code> if the time of this <code>Calendar</code> is after the * time represented by the argument. ! * @throws NullPointerException if the specified <code>Calendar</code> is * <code>null</code>. ! * @throws IllegalArgumentException if the time value of the * specified <code>Calendar</code> object can't be obtained due to * any invalid calendar values. * @since 1.5 */ @Override
*** 3052,3062 **** * * <p>The default implementation of this method throws an * {@link UnsupportedOperationException}. * * @return the week year of this {@code Calendar} ! * @exception UnsupportedOperationException * if any week year numbering isn't supported * in this {@code Calendar}. * @see #isWeekDateSupported() * @see #getFirstDayOfWeek() * @see #getMinimalDaysInFirstWeek() --- 3052,3062 ---- * * <p>The default implementation of this method throws an * {@link UnsupportedOperationException}. * * @return the week year of this {@code Calendar} ! * @throws UnsupportedOperationException * if any week year numbering isn't supported * in this {@code Calendar}. * @see #isWeekDateSupported() * @see #getFirstDayOfWeek() * @see #getMinimalDaysInFirstWeek()
*** 3084,3098 **** * @param weekYear the week year * @param weekOfYear the week number based on {@code weekYear} * @param dayOfWeek the day of week value: one of the constants * for the {@link #DAY_OF_WEEK} field: {@link * #SUNDAY}, ..., {@link #SATURDAY}. ! * @exception IllegalArgumentException * if any of the given date specifiers is invalid * or any of the calendar fields are inconsistent * with the given date specifiers in non-lenient mode ! * @exception UnsupportedOperationException * if any week year numbering isn't supported in this * {@code Calendar}. * @see #isWeekDateSupported() * @see #getFirstDayOfWeek() * @see #getMinimalDaysInFirstWeek() --- 3084,3098 ---- * @param weekYear the week year * @param weekOfYear the week number based on {@code weekYear} * @param dayOfWeek the day of week value: one of the constants * for the {@link #DAY_OF_WEEK} field: {@link * #SUNDAY}, ..., {@link #SATURDAY}. ! * @throws IllegalArgumentException * if any of the given date specifiers is invalid * or any of the calendar fields are inconsistent * with the given date specifiers in non-lenient mode ! * @throws UnsupportedOperationException * if any week year numbering isn't supported in this * {@code Calendar}. * @see #isWeekDateSupported() * @see #getFirstDayOfWeek() * @see #getMinimalDaysInFirstWeek()
*** 3108,3118 **** * * <p>The default implementation of this method throws an * {@code UnsupportedOperationException}. * * @return the number of weeks in the week year. ! * @exception UnsupportedOperationException * if any week year numbering isn't supported in this * {@code Calendar}. * @see #WEEK_OF_YEAR * @see #isWeekDateSupported() * @see #getWeekYear() --- 3108,3118 ---- * * <p>The default implementation of this method throws an * {@code UnsupportedOperationException}. * * @return the number of weeks in the week year. ! * @throws UnsupportedOperationException * if any week year numbering isn't supported in this * {@code Calendar}. * @see #WEEK_OF_YEAR * @see #isWeekDateSupported() * @see #getWeekYear()
*** 3349,3359 **** /** * Returns the name of the specified calendar field. * * @param field the calendar field * @return the calendar field name ! * @exception IndexOutOfBoundsException if <code>field</code> is negative, * equal to or greater than {@code FIELD_COUNT}. */ static String getFieldName(int field) { return FIELD_NAME[field]; } --- 3349,3359 ---- /** * Returns the name of the specified calendar field. * * @param field the calendar field * @return the calendar field name ! * @throws IndexOutOfBoundsException if <code>field</code> is negative, * equal to or greater than {@code FIELD_COUNT}. */ static String getFieldName(int field) { return FIELD_NAME[field]; }
< prev index next >