diff --git a/src/share/classes/java/text/DateFormat.java b/src/share/classes/java/text/DateFormat.java index d1bb6e682dd2892d414c619b543fd4a44ae6e694..fcb21e6928cc18b8332422f5cd776274a8ed4a87 100644 --- a/src/share/classes/java/text/DateFormat.java +++ b/src/share/classes/java/text/DateFormat.java @@ -439,7 +439,12 @@ public abstract class DateFormat extends Format { /** * Gets the time formatter with the default formatting style - * for the default locale. + * for the default {@link java.util.Locale.Category#FORMAT FORMAT} locale. + *

This is equivalent to calling + * {@link #getTimeInstance(int, Locale) getTimeInstance(DEFAULT, + * Locale.getDefault(Locale.Category.FORMAT))}. + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT * @return a time formatter. */ public final static DateFormat getTimeInstance() @@ -449,7 +454,12 @@ public abstract class DateFormat extends Format { /** * Gets the time formatter with the given formatting style - * for the default locale. + * for the default {@link java.util.Locale.Category#FORMAT FORMAT} locale. + *

This is equivalent to calling + * {@link #getTimeInstance(int, Locale) getTimeInstance(style, + * Locale.getDefault(Locale.Category.FORMAT))}. + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT * @param style the given formatting style. For example, * SHORT for "h:mm a" in the US locale. * @return a time formatter. @@ -475,7 +485,12 @@ public abstract class DateFormat extends Format { /** * Gets the date formatter with the default formatting style - * for the default locale. + * for the default {@link java.util.Locale.Category#FORMAT FORMAT} locale. + *

This is equivalent to calling + * {@link #getDateInstance(int, Locale) getDateInstance(DEFAULT, + * Locale.getDefault(Locale.Category.FORMAT))}. + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT * @return a date formatter. */ public final static DateFormat getDateInstance() @@ -485,7 +500,12 @@ public abstract class DateFormat extends Format { /** * Gets the date formatter with the given formatting style - * for the default locale. + * for the default {@link java.util.Locale.Category#FORMAT FORMAT} locale. + *

This is equivalent to calling + * {@link #getDateInstance(int, Locale) getDateInstance(style, + * Locale.getDefault(Locale.Category.FORMAT))}. + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT * @param style the given formatting style. For example, * SHORT for "M/d/yy" in the US locale. * @return a date formatter. @@ -511,7 +531,12 @@ public abstract class DateFormat extends Format { /** * Gets the date/time formatter with the default formatting style - * for the default locale. + * for the default {@link java.util.Locale.Category#FORMAT FORMAT} locale. + *

This is equivalent to calling + * {@link #getDateTimeInstance(int, int, Locale) getDateTimeInstance(DEFAULT, + * DEFAULT, Locale.getDefault(Locale.Category.FORMAT))}. + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT * @return a date/time formatter. */ public final static DateFormat getDateTimeInstance() @@ -521,7 +546,12 @@ public abstract class DateFormat extends Format { /** * Gets the date/time formatter with the given date and time - * formatting styles for the default locale. + * formatting styles for the default {@link java.util.Locale.Category#FORMAT FORMAT} locale. + *

This is equivalent to calling + * {@link #getDateTimeInstance(int, int, Locale) getDateTimeInstance(dateStyle, + * timeStyle, Locale.getDefault(Locale.Category.FORMAT))}. + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT * @param dateStyle the given date formatting style. For example, * SHORT for "M/d/yy" in the US locale. * @param timeStyle the given time formatting style. For example, diff --git a/src/share/classes/java/text/DateFormatSymbols.java b/src/share/classes/java/text/DateFormatSymbols.java index b4c380d2c0507daa2a562d1e73060a7f6cc779ea..80e4f03a38a727b51bdd275bd3570da812f10096 100644 --- a/src/share/classes/java/text/DateFormatSymbols.java +++ b/src/share/classes/java/text/DateFormatSymbols.java @@ -104,14 +104,19 @@ public class DateFormatSymbols implements Serializable, Cloneable { /** * Construct a DateFormatSymbols object by loading format data from - * resources for the default locale. This constructor can only + * resources for the default {@link java.util.Locale.Category#FORMAT FORMAT} + * locale. This constructor can only * construct instances for the locales supported by the Java * runtime environment, not for those supported by installed * {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider} * implementations. For full locale coverage, use the * {@link #getInstance(Locale) getInstance} method. - * + *

This is equivalent to calling + * {@link #DateFormatSymbols(Locale) + * DateFormatSymbols(Locale.getDefault(Locale.Category.FORMAT))}. * @see #getInstance() + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT * @exception java.util.MissingResourceException * if the resources for the default locale cannot be * found or cannot be loaded. @@ -302,6 +307,10 @@ public class DateFormatSymbols implements Serializable, Cloneable { * as for those supported by installed * {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider} * implementations. + *

This is equivalent to calling {@link #getInstance(Locale) + * getInstance(Locale.getDefault(Locale.Category.FORMAT))}. + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT * @return a DateFormatSymbols instance. * @since 1.6 */ diff --git a/src/share/classes/java/text/DecimalFormat.java b/src/share/classes/java/text/DecimalFormat.java index 38c930372c1a175c9c413ec415bb698691af0673..bd37b2ed471b4133af29a210f07d5286ebeeb094 100644 --- a/src/share/classes/java/text/DecimalFormat.java +++ b/src/share/classes/java/text/DecimalFormat.java @@ -381,7 +381,8 @@ public class DecimalFormat extends NumberFormat { /** * Creates a DecimalFormat using the default pattern and symbols - * for the default locale. This is a convenient way to obtain a + * for the default {@link java.util.Locale.Category#FORMAT FORMAT} locale. + * This is a convenient way to obtain a * DecimalFormat when internationalization is not the main concern. *

* To obtain standard formats for a given locale, use the factory methods @@ -411,7 +412,8 @@ public class DecimalFormat extends NumberFormat { /** * Creates a DecimalFormat using the given pattern and the symbols - * for the default locale. This is a convenient way to obtain a + * for the default {@link java.util.Locale.Category#FORMAT FORMAT} locale. + * This is a convenient way to obtain a * DecimalFormat when internationalization is not the main concern. *

* To obtain standard formats for a given locale, use the factory methods diff --git a/src/share/classes/java/text/DecimalFormatSymbols.java b/src/share/classes/java/text/DecimalFormatSymbols.java index 9274208fe8f7c9ff6589232bf88949d81538c306..f0b2212eaf564919ab743aea6be3d1ea30653a9b 100644 --- a/src/share/classes/java/text/DecimalFormatSymbols.java +++ b/src/share/classes/java/text/DecimalFormatSymbols.java @@ -71,13 +71,19 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; public class DecimalFormatSymbols implements Cloneable, Serializable { /** - * Create a DecimalFormatSymbols object for the default locale. + * Create a DecimalFormatSymbols object for the default + * {@link java.util.Locale.Category#FORMAT FORMAT} locale. * This constructor can only construct instances for the locales * supported by the Java runtime environment, not for those * supported by installed * {@link java.text.spi.DecimalFormatSymbolsProvider DecimalFormatSymbolsProvider} * implementations. For full locale coverage, use the * {@link #getInstance(Locale) getInstance} method. + *

This is equivalent to calling + * {@link #DecimalFormatSymbols(Locale) + * DecimalFormatSymbols(Locale.getDefault(Locale.Category.FORMAT))}. + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT */ public DecimalFormatSymbols() { initialize( Locale.getDefault(Locale.Category.FORMAT) ); @@ -133,6 +139,11 @@ public class DecimalFormatSymbols implements Cloneable, Serializable { * as for those supported by installed * {@link java.text.spi.DecimalFormatSymbolsProvider * DecimalFormatSymbolsProvider} implementations. + *

This is equivalent to calling + * {@link #getInstance(Locale) + * getInstance(Locale.getDefault(Locale.Category.FORMAT))}. + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT * @return a DecimalFormatSymbols instance. * @since 1.6 */ diff --git a/src/share/classes/java/text/MessageFormat.java b/src/share/classes/java/text/MessageFormat.java index e695b37a6793de1a1d0ec0d6756261cea79ae314..e5c8c811f046aa3bea71cfb5a72cad35dcdac7a4 100644 --- a/src/share/classes/java/text/MessageFormat.java +++ b/src/share/classes/java/text/MessageFormat.java @@ -348,7 +348,8 @@ public class MessageFormat extends Format { private static final long serialVersionUID = 6479157306784022952L; /** - * Constructs a MessageFormat for the default locale and the + * Constructs a MessageFormat for the default + * {@link java.util.Locale.Category#FORMAT FORMAT} locale and the * specified pattern. * The constructor first sets the locale, then parses the pattern and * creates a list of subformats for the format elements contained in it. diff --git a/src/share/classes/java/text/NumberFormat.java b/src/share/classes/java/text/NumberFormat.java index eaed665e54c07874e92bd78f09118bb612dec091..c1b8310096b8ee512de4c3e56f8814a2914c42cc 100644 --- a/src/share/classes/java/text/NumberFormat.java +++ b/src/share/classes/java/text/NumberFormat.java @@ -389,7 +389,8 @@ public abstract class NumberFormat extends Format { //============== Locale Stuff ===================== /** - * Returns a general-purpose number format for the current default locale. + * Returns a general-purpose number format for the current default + * {@link java.util.Locale.Category#FORMAT FORMAT} locale. * This is the same as calling * {@link #getNumberInstance() getNumberInstance()}. */ @@ -407,7 +408,13 @@ public abstract class NumberFormat extends Format { } /** - * Returns a general-purpose number format for the current default locale. + * Returns a general-purpose number format for the current default + * {@link java.util.Locale.Category#FORMAT FORMAT} locale. + *

This is equivalent to calling + * {@link #getNumberInstance(Locale) + * getNumberInstance(Locale.getDefault(Locale.Category.FORMAT))}. + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT */ public final static NumberFormat getNumberInstance() { return getInstance(Locale.getDefault(Locale.Category.FORMAT), NUMBERSTYLE); @@ -421,14 +428,20 @@ public abstract class NumberFormat extends Format { } /** - * Returns an integer number format for the current default locale. The + * Returns an integer number format for the current default + * {@link java.util.Locale.Category#FORMAT FORMAT} locale. The * returned number format is configured to round floating point numbers * to the nearest integer using half-even rounding (see {@link * java.math.RoundingMode#HALF_EVEN RoundingMode.HALF_EVEN}) for formatting, * and to parse only the integer part of an input string (see {@link * #isParseIntegerOnly isParseIntegerOnly}). + *

This is equivalent to calling + * {@link #getIntegerInstance(Locale) + * getIntegerInstance(Locale.getDefault(Locale.Category.FORMAT))}. * * @see #getRoundingMode() + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT * @return a number format for integer values * @since 1.4 */ @@ -453,7 +466,14 @@ public abstract class NumberFormat extends Format { } /** - * Returns a currency format for the current default locale. + * Returns a currency format for the current default + * {@link java.util.Locale.Category#FORMAT FORMAT} locale. + *

This is equivalent to calling + * {@link #getCurrencyInstance(Locale) + * getCurrencyInstance(Locale.getDefault(Locale.Category.FORMAT))}. + * + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT */ public final static NumberFormat getCurrencyInstance() { return getInstance(Locale.getDefault(Locale.Category.FORMAT), CURRENCYSTYLE); @@ -467,7 +487,14 @@ public abstract class NumberFormat extends Format { } /** - * Returns a percentage format for the current default locale. + * Returns a percentage format for the current default + * {@link java.util.Locale.Category#FORMAT FORMAT} locale. + *

This is equivalent to calling + * {@link #getPercentInstance(Locale) + * getPercentInstance(Locale.getDefault(Locale.Category.FORMAT))}. + * + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT */ public final static NumberFormat getPercentInstance() { return getInstance(Locale.getDefault(Locale.Category.FORMAT), PERCENTSTYLE); diff --git a/src/share/classes/java/text/SimpleDateFormat.java b/src/share/classes/java/text/SimpleDateFormat.java index 0c1f4aa6a61d3f773acced6acb11280ce17e64f6..82b48964eeae113055d11dbbd4140cfe72ad5fa7 100644 --- a/src/share/classes/java/text/SimpleDateFormat.java +++ b/src/share/classes/java/text/SimpleDateFormat.java @@ -547,7 +547,8 @@ public class SimpleDateFormat extends DateFormat { /** * Constructs a SimpleDateFormat using the default pattern and - * date format symbols for the default locale. + * date format symbols for the default + * {@link java.util.Locale.Category#FORMAT FORMAT} locale. * Note: This constructor may not support all locales. * For full coverage, use the factory methods in the {@link DateFormat} * class. @@ -560,11 +561,17 @@ public class SimpleDateFormat extends DateFormat { /** * Constructs a SimpleDateFormat using the given pattern and - * the default date format symbols for the default locale. + * the default date format symbols for the default + * {@link java.util.Locale.Category#FORMAT FORMAT} locale. * Note: This constructor may not support all locales. * For full coverage, use the factory methods in the {@link DateFormat} * class. + *

This is equivalent to calling + * {@link #SimpleDateFormat(String, Locale) + * SimpleDateFormat(pattern, Locale.getDefault(Locale.Category.FORMAT))}. * + * @see java.util.Locale#getDefault(java.util.Locale.Category) + * @see java.util.Locale.Category#FORMAT * @param pattern the pattern describing the date and time format * @exception NullPointerException if the given pattern is null * @exception IllegalArgumentException if the given pattern is invalid diff --git a/src/share/classes/java/time/format/DateTimeFormatSymbols.java b/src/share/classes/java/time/format/DateTimeFormatSymbols.java index 14a116760f1ac008eeee19057d74c52fafe9c2c6..0bfe8441020b58a3d689019731bd58caae964aaa 100644 --- a/src/share/classes/java/time/format/DateTimeFormatSymbols.java +++ b/src/share/classes/java/time/format/DateTimeFormatSymbols.java @@ -121,10 +121,16 @@ public final class DateTimeFormatSymbols { } /** - * Obtains symbols for the default locale. + * Obtains symbols for the default + * {@link java.util.Locale.Category#FORMAT FORMAT} locale. *

* This method provides access to locale sensitive symbols. + *

+ * This is equivalent to calling + * {@link #of(Locale) + * of(Locale.getDefault(Locale.Category.FORMAT))}. * + * @see java.util.Locale.Category#FORMAT * @return the info, not null */ public static DateTimeFormatSymbols ofDefaultLocale() { diff --git a/src/share/classes/java/util/Calendar.java b/src/share/classes/java/util/Calendar.java index f14ee6d6ef47aa9f5f56929b315146b3579542cc..c57f50c59b3ffe4520496b386d99f59a6589f0f3 100644 --- a/src/share/classes/java/util/Calendar.java +++ b/src/share/classes/java/util/Calendar.java @@ -1572,7 +1572,8 @@ public abstract class Calendar implements Serializable, Cloneable, ComparableCalendar returned is based on the current time - * in the default time zone with the default locale. + * in the default time zone with the default + * {@link Locale.Category#FORMAT FORMAT} locale. * * @return a Calendar. */ @@ -1614,7 +1616,8 @@ public abstract class Calendar implements Serializable, Cloneable, ComparableCalendar returned is based on the current time - * in the given time zone with the default locale. + * in the given time zone with the default + * {@link Locale.Category#FORMAT FORMAT} locale. * * @param zone the time zone to use * @return a Calendar. diff --git a/src/share/classes/java/util/Currency.java b/src/share/classes/java/util/Currency.java index aa792ea31751cd5d348dd9b5c4d543c8168bf8a1..09e7046849b4ed8af10cd527a4b166e16eca32f5 100644 --- a/src/share/classes/java/util/Currency.java +++ b/src/share/classes/java/util/Currency.java @@ -472,12 +472,18 @@ public final class Currency implements Serializable { } /** - * Gets the symbol of this currency for the default locale. + * Gets the symbol of this currency for the default + * {@link Locale.Category#DISPLAY DISPLAY} locale. * For example, for the US Dollar, the symbol is "$" if the default * locale is the US, while for other locales it may be "US$". If no * symbol can be determined, the ISO 4217 currency code is returned. + *

+ * This is equivalent to calling + * {@link #getSymbol(Locale) + * getSymbol(Locale.getDefault(Locale.Category.DISPLAY))}. * - * @return the symbol of this currency for the default locale + * @return the symbol of this currency for the default + * {@link Locale.Category#DISPLAY DISPLAY} locale */ public String getSymbol() { return getSymbol(Locale.getDefault(Locale.Category.DISPLAY)); @@ -533,10 +539,16 @@ public final class Currency implements Serializable { /** * Gets the name that is suitable for displaying this currency for - * the default locale. If there is no suitable display name found + * the default {@link Locale.Category#DISPLAY DISPLAY} locale. + * If there is no suitable display name found * for the default locale, the ISO 4217 currency code is returned. + *

+ * This is equivalent to calling + * {@link #getDisplayName(Locale) + * getDisplayName(Locale.getDefault(Locale.Category.DISPLAY))}. * - * @return the display name of this currency for the default locale + * @return the display name of this currency for the default + * {@link Locale.Category#DISPLAY DISPLAY} locale * @since 1.7 */ public String getDisplayName() { diff --git a/src/share/classes/java/util/Formatter.java b/src/share/classes/java/util/Formatter.java index c645861521caaf937d678a427c6ebc5fde30fab7..65a6f0b36346bc6399f1aaff5db6493511a2a999 100644 --- a/src/share/classes/java/util/Formatter.java +++ b/src/share/classes/java/util/Formatter.java @@ -1900,7 +1900,8 @@ public final class Formatter implements Closeable, Flushable { * which may be retrieved by invoking {@link #out out()} and whose * current content may be converted into a string by invoking {@link * #toString toString()}. The locale used is the {@linkplain - * Locale#getDefault() default locale} for this instance of the Java + * Locale#getDefault(Locale.Category) default locale} for + * {@linkplain Locale.Category#FORMAT formatting} for this instance of the Java * virtual machine. */ public Formatter() { @@ -1910,8 +1911,10 @@ public final class Formatter implements Closeable, Flushable { /** * Constructs a new formatter with the specified destination. * - *

The locale used is the {@linkplain Locale#getDefault() default - * locale} for this instance of the Java virtual machine. + *

The locale used is the {@linkplain + * Locale#getDefault(Locale.Category) default locale} for + * {@linkplain Locale.Category#FORMAT formatting} for this instance of the Java + * virtual machine. * * @param a * Destination for the formatted output. If {@code a} is @@ -1961,8 +1964,10 @@ public final class Formatter implements Closeable, Flushable { * java.nio.charset.Charset#defaultCharset() default charset} for this * instance of the Java virtual machine. * - *

The locale used is the {@linkplain Locale#getDefault() default - * locale} for this instance of the Java virtual machine. + *

The locale used is the {@linkplain + * Locale#getDefault(Locale.Category) default locale} for + * {@linkplain Locale.Category#FORMAT formatting} for this instance of the Java + * virtual machine. * * @param fileName * The name of the file to use as the destination of this @@ -1989,8 +1994,10 @@ public final class Formatter implements Closeable, Flushable { /** * Constructs a new formatter with the specified file name and charset. * - *

The locale used is the {@linkplain Locale#getDefault default - * locale} for this instance of the Java virtual machine. + *

The locale used is the {@linkplain + * Locale#getDefault(Locale.Category) default locale} for + * {@linkplain Locale.Category#FORMAT formatting} for this instance of the Java + * virtual machine. * * @param fileName * The name of the file to use as the destination of this @@ -2068,8 +2075,10 @@ public final class Formatter implements Closeable, Flushable { * java.nio.charset.Charset#defaultCharset() default charset} for this * instance of the Java virtual machine. * - *

The locale used is the {@linkplain Locale#getDefault() default - * locale} for this instance of the Java virtual machine. + *

The locale used is the {@linkplain + * Locale#getDefault(Locale.Category) default locale} for + * {@linkplain Locale.Category#FORMAT formatting} for this instance of the Java + * virtual machine. * * @param file * The file to use as the destination of this formatter. If the @@ -2096,8 +2105,10 @@ public final class Formatter implements Closeable, Flushable { /** * Constructs a new formatter with the specified file and charset. * - *

The locale used is the {@linkplain Locale#getDefault default - * locale} for this instance of the Java virtual machine. + *

The locale used is the {@linkplain + * Locale#getDefault(Locale.Category) default locale} for + * {@linkplain Locale.Category#FORMAT formatting} for this instance of the Java + * virtual machine. * * @param file * The file to use as the destination of this formatter. If the @@ -2171,8 +2182,10 @@ public final class Formatter implements Closeable, Flushable { /** * Constructs a new formatter with the specified print stream. * - *

The locale used is the {@linkplain Locale#getDefault() default - * locale} for this instance of the Java virtual machine. + *

The locale used is the {@linkplain + * Locale#getDefault(Locale.Category) default locale} for + * {@linkplain Locale.Category#FORMAT formatting} for this instance of the Java + * virtual machine. * *

Characters are written to the given {@link java.io.PrintStream * PrintStream} object and are therefore encoded using that object's @@ -2193,8 +2206,10 @@ public final class Formatter implements Closeable, Flushable { * java.nio.charset.Charset#defaultCharset() default charset} for this * instance of the Java virtual machine. * - *

The locale used is the {@linkplain Locale#getDefault() default - * locale} for this instance of the Java virtual machine. + *

The locale used is the {@linkplain + * Locale#getDefault(Locale.Category) default locale} for + * {@linkplain Locale.Category#FORMAT formatting} for this instance of the Java + * virtual machine. * * @param os * The output stream to use as the destination of this formatter. @@ -2209,8 +2224,10 @@ public final class Formatter implements Closeable, Flushable { * Constructs a new formatter with the specified output stream and * charset. * - *

The locale used is the {@linkplain Locale#getDefault default - * locale} for this instance of the Java virtual machine. + *

The locale used is the {@linkplain + * Locale#getDefault(Locale.Category) default locale} for + * {@linkplain Locale.Category#FORMAT formatting} for this instance of the Java + * virtual machine. * * @param os * The output stream to use as the destination of this formatter. diff --git a/src/share/classes/java/util/GregorianCalendar.java b/src/share/classes/java/util/GregorianCalendar.java index 4e063ee70ba4e41e89be2c06624c5b17339659c0..96501286e757021fced5cfa221e7514ccd8c1160 100644 --- a/src/share/classes/java/util/GregorianCalendar.java +++ b/src/share/classes/java/util/GregorianCalendar.java @@ -587,7 +587,8 @@ public class GregorianCalendar extends Calendar { /** * Constructs a default GregorianCalendar using the current time - * in the default time zone with the default locale. + * in the default time zone with the default + * {@link Locale.Category#FORMAT FORMAT} locale. */ public GregorianCalendar() { this(TimeZone.getDefaultRef(), Locale.getDefault(Locale.Category.FORMAT)); @@ -596,7 +597,8 @@ public class GregorianCalendar extends Calendar { /** * Constructs a GregorianCalendar based on the current time - * in the given time zone with the default locale. + * in the given time zone with the default + * {@link Locale.Category#FORMAT FORMAT} locale. * * @param zone the given time zone. */ diff --git a/src/share/classes/java/util/Locale.java b/src/share/classes/java/util/Locale.java index 198148206d184a9844c367aa0829e09381d7c6d8..69f277659ab0f0e569b2101c8b40599b512ea03b 100644 --- a/src/share/classes/java/util/Locale.java +++ b/src/share/classes/java/util/Locale.java @@ -351,7 +351,8 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * you can use getDisplayLanguage to get the name of * the language suitable for displaying to the user. Interestingly, * the getDisplayXXX methods are themselves locale-sensitive - * and have two versions: one that uses the default locale and one + * and have two versions: one that uses the default + * {@link Locale.Category#DISPLAY DISPLAY} locale and one * that uses the locale specified as an argument. * *

The Java Platform provides a number of classes that perform locale-sensitive @@ -369,7 +370,8 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * Each of these methods has two variants; one with an explicit locale - * and one without; the latter uses the default locale: + * and one without; the latter uses the default + * {@link Locale.Category#FORMAT FORMAT} locale: *

*
  *     NumberFormat.getInstance(myLocale)
@@ -1645,11 +1647,15 @@ public final class Locale implements Cloneable, Serializable {
     /**
      * Returns a name for the locale's language that is appropriate for display to the
      * user.
-     * If possible, the name returned will be localized for the default locale.
-     * For example, if the locale is fr_FR and the default locale
+     * If possible, the name returned will be localized for the default
+     * {@link Locale.Category#DISPLAY DISPLAY} locale.
+     * For example, if the locale is fr_FR and the default
+     * {@link Locale.Category#DISPLAY DISPLAY} locale
      * is en_US, getDisplayLanguage() will return "French"; if the locale is en_US and
-     * the default locale is fr_FR, getDisplayLanguage() will return "anglais".
-     * If the name returned cannot be localized for the default locale,
+     * the default {@link Locale.Category#DISPLAY DISPLAY} locale is fr_FR,
+     * getDisplayLanguage() will return "anglais".
+     * If the name returned cannot be localized for the default
+     * {@link Locale.Category#DISPLAY DISPLAY} locale,
      * (say, we don't have a Japanese name for Croatian),
      * this function falls back on the English name, and uses the ISO code as a last-resort
      * value.  If the locale doesn't specify a language, this function returns the empty string.
@@ -1679,10 +1685,12 @@ public final class Locale implements Cloneable, Serializable {
 
     /**
      * Returns a name for the the locale's script that is appropriate for display to
-     * the user. If possible, the name will be localized for the default locale.  Returns
+     * the user. If possible, the name will be localized for the default
+     * {@link Locale.Category#DISPLAY DISPLAY} locale.  Returns
      * the empty string if this locale doesn't specify a script code.
      *
-     * @return the display name of the script code for the current default locale
+     * @return the display name of the script code for the current default
+     *     {@link Locale.Category#DISPLAY DISPLAY} locale
      * @since 1.7
      */
     public String getDisplayScript() {
@@ -1695,7 +1703,8 @@ public final class Locale implements Cloneable, Serializable {
      * localized for the given locale. Returns the empty string if
      * this locale doesn't specify a script code.
      *
-     * @return the display name of the script code for the current default locale
+     * @return the display name of the script code for the current default
+     * {@link Locale.Category#DISPLAY DISPLAY} locale
      * @throws NullPointerException if inLocale is null
      * @since 1.7
      */
@@ -1706,11 +1715,15 @@ public final class Locale implements Cloneable, Serializable {
     /**
      * Returns a name for the locale's country that is appropriate for display to the
      * user.
-     * If possible, the name returned will be localized for the default locale.
-     * For example, if the locale is fr_FR and the default locale
+     * If possible, the name returned will be localized for the default
+     * {@link Locale.Category#DISPLAY DISPLAY} locale.
+     * For example, if the locale is fr_FR and the default
+     * {@link Locale.Category#DISPLAY DISPLAY} locale
      * is en_US, getDisplayCountry() will return "France"; if the locale is en_US and
-     * the default locale is fr_FR, getDisplayCountry() will return "Etats-Unis".
-     * If the name returned cannot be localized for the default locale,
+     * the default {@link Locale.Category#DISPLAY DISPLAY} locale is fr_FR,
+     * getDisplayCountry() will return "Etats-Unis".
+     * If the name returned cannot be localized for the default
+     * {@link Locale.Category#DISPLAY DISPLAY} locale,
      * (say, we don't have a Japanese name for Croatia),
      * this function falls back on the English name, and uses the ISO code as a last-resort
      * value.  If the locale doesn't specify a country, this function returns the empty string.
@@ -1762,7 +1775,8 @@ public final class Locale implements Cloneable, Serializable {
 
     /**
      * Returns a name for the locale's variant code that is appropriate for display to the
-     * user.  If possible, the name will be localized for the default locale.  If the locale
+     * user.  If possible, the name will be localized for the default
+     * {@link Locale.Category#DISPLAY DISPLAY} locale.  If the locale
      * doesn't specify a variant code, this function returns the empty string.
      */
     public final String getDisplayVariant() {
diff --git a/src/share/classes/java/util/Scanner.java b/src/share/classes/java/util/Scanner.java
index 3c558114ac79da05f39a9dc0221007bd373fed39..cc19b0d125765cd6af5e7102921c7b449989c3a7 100644
--- a/src/share/classes/java/util/Scanner.java
+++ b/src/share/classes/java/util/Scanner.java
@@ -151,7 +151,8 @@ import sun.misc.LRUCache;
  * 

An instance of this class is capable of scanning numbers in the standard * formats as well as in the formats of the scanner's locale. A scanner's * initial locale is the value returned by the {@link - * java.util.Locale#getDefault} method; it may be changed via the {@link + * java.util.Locale#getDefault(Locale.Category) + * Locale.getDefault(Locale.Category.FORMAT)} method; it may be changed via the {@link * #useLocale} method. The {@link #reset} method will reset the value of the * scanner's locale to the initial locale regardless of whether it was * previously changed. @@ -2641,7 +2642,7 @@ public final class Scanner implements Iterator, Closeable { * *

      *   scanner.useDelimiter("\\p{javaWhitespace}+")
-     *          .useLocale(Locale.getDefault())
+     *          .useLocale(Locale.getDefault(Locale.Category.FORMAT))
      *          .useRadix(10);
      * 
*