6218123: (cal) API: Spec for GregorianCalendar constructors and Calendar getInstance is inconsistent.

Reviewed-by: naoto
This commit is contained in:
Justin Lu 2023-04-10 21:46:31 +00:00 committed by Naoto Sato
parent a43a17c8ea
commit 42965d390c
2 changed files with 6 additions and 0 deletions

View file

@ -1632,6 +1632,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* *
* @param zone the time zone to use * @param zone the time zone to use
* @return a Calendar. * @return a Calendar.
* @throws NullPointerException if {@code zone} is {@code null}
*/ */
public static Calendar getInstance(TimeZone zone) public static Calendar getInstance(TimeZone zone)
{ {
@ -1649,6 +1650,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* *
* @param aLocale the locale for the week data * @param aLocale the locale for the week data
* @return a Calendar. * @return a Calendar.
* @throws NullPointerException if {@code aLocale} is {@code null}
*/ */
public static Calendar getInstance(Locale aLocale) public static Calendar getInstance(Locale aLocale)
{ {
@ -1663,6 +1665,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* @param zone the time zone to use * @param zone the time zone to use
* @param aLocale the locale for the week data * @param aLocale the locale for the week data
* @return a Calendar. * @return a Calendar.
* @throws NullPointerException if {@code zone} or {@code aLocale} is {@code null}
*/ */
public static Calendar getInstance(TimeZone zone, public static Calendar getInstance(TimeZone zone,
Locale aLocale) Locale aLocale)

View file

@ -599,6 +599,7 @@ public class GregorianCalendar extends Calendar {
* {@link Locale.Category#FORMAT FORMAT} locale. * {@link Locale.Category#FORMAT FORMAT} locale.
* *
* @param zone the given time zone. * @param zone the given time zone.
* @throws NullPointerException if {@code zone} is {@code null}
*/ */
public GregorianCalendar(TimeZone zone) { public GregorianCalendar(TimeZone zone) {
this(zone, Locale.getDefault(Locale.Category.FORMAT)); this(zone, Locale.getDefault(Locale.Category.FORMAT));
@ -609,6 +610,7 @@ public class GregorianCalendar extends Calendar {
* in the default time zone with the given locale. * in the default time zone with the given locale.
* *
* @param aLocale the given locale. * @param aLocale the given locale.
* @throws NullPointerException if {@code aLocale} is {@code null}
*/ */
public GregorianCalendar(Locale aLocale) { public GregorianCalendar(Locale aLocale) {
this(TimeZone.getDefaultRef(), aLocale); this(TimeZone.getDefaultRef(), aLocale);
@ -621,6 +623,7 @@ public class GregorianCalendar extends Calendar {
* *
* @param zone the given time zone. * @param zone the given time zone.
* @param aLocale the given locale. * @param aLocale the given locale.
* @throws NullPointerException if {@code zone} or {@code aLocale} is {@code null}
*/ */
public GregorianCalendar(TimeZone zone, Locale aLocale) { public GregorianCalendar(TimeZone zone, Locale aLocale) {
super(zone, aLocale); super(zone, aLocale);