8276186: Require getAvailableLocales() methods to include Locale.ROOT

Reviewed-by: prappo, smarks, iris
This commit is contained in:
Naoto Sato 2021-11-10 20:52:11 +00:00
parent df02daa6f9
commit 0c409cac78
10 changed files with 108 additions and 22 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -576,8 +576,9 @@ public abstract class BreakIterator implements Cloneable
* The returned array represents the union of locales supported by the Java
* runtime and by installed
* {@link java.text.spi.BreakIteratorProvider BreakIteratorProvider} implementations.
* It must contain at least a {@code Locale}
* instance equal to {@link java.util.Locale#US Locale.US}.
* At a minimum, the returned array must contain a {@code Locale} instance equal to
* {@link Locale#ROOT Locale.ROOT} and a {@code Locale} instance equal to
* {@link Locale#US Locale.US}.
*
* @return An array of locales for which localized
* {@code BreakIterator} instances are available.

View file

@ -421,8 +421,9 @@ public abstract class Collator
* The returned array represents the union of locales supported
* by the Java runtime and by installed
* {@link java.text.spi.CollatorProvider CollatorProvider} implementations.
* It must contain at least a Locale instance equal to
* {@link java.util.Locale#US Locale.US}.
* At a minimum, the returned array must contain a {@code Locale} instance equal to
* {@link Locale#ROOT Locale.ROOT} and a {@code Locale} instance equal to
* {@link Locale#US Locale.US}.
*
* @return An array of locales for which localized
* {@code Collator} instances are available.

View file

@ -636,8 +636,9 @@ public abstract class DateFormat extends Format {
* The returned array represents the union of locales supported by the Java
* runtime and by installed
* {@link java.text.spi.DateFormatProvider DateFormatProvider} implementations.
* It must contain at least a {@code Locale} instance equal to
* {@link java.util.Locale#US Locale.US}.
* At a minimum, the returned array must contain a {@code Locale} instance equal to
* {@link Locale#ROOT Locale.ROOT} and a {@code Locale} instance equal to
* {@link Locale#US Locale.US}.
*
* @return An array of locales for which localized
* {@code DateFormat} instances are available.

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -299,8 +299,9 @@ public class DateFormatSymbols implements Serializable, Cloneable {
* The returned array represents the union of locales supported by the
* Java runtime and by installed
* {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider}
* implementations. It must contain at least a {@code Locale}
* instance equal to {@link java.util.Locale#US Locale.US}.
* implementations. At a minimum, the returned array must contain a
* {@code Locale} instance equal to {@link Locale#ROOT Locale.ROOT} and
* a {@code Locale} instance equal to {@link Locale#US Locale.US}.
*
* @return An array of locales for which localized
* {@code DateFormatSymbols} instances are available.

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -122,8 +122,9 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
* The returned array represents the union of locales supported by the Java
* runtime and by installed
* {@link java.text.spi.DecimalFormatSymbolsProvider DecimalFormatSymbolsProvider}
* implementations. It must contain at least a {@code Locale}
* instance equal to {@link java.util.Locale#US Locale.US}.
* implementations. At a minimum, the returned array must contain a
* {@code Locale} instance equal to {@link Locale#ROOT Locale.ROOT} and
* a {@code Locale} instance equal to {@link Locale#US Locale.US}.
*
* @return an array of locales for which localized
* {@code DecimalFormatSymbols} instances are available.

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -682,8 +682,9 @@ public abstract class NumberFormat extends Format {
* The returned array represents the union of locales supported by the Java
* runtime and by installed
* {@link java.text.spi.NumberFormatProvider NumberFormatProvider} implementations.
* It must contain at least a {@code Locale} instance equal to
* {@link java.util.Locale#US Locale.US}.
* At a minimum, the returned array must contain a {@code Locale} instance equal to
* {@link Locale#ROOT Locale.ROOT} and a {@code Locale} instance equal to
* {@link Locale#US Locale.US}.
*
* @return An array of locales for which localized
* {@code NumberFormat} instances are available.