8305206: Add @spec tags in java.base/java.* (part 1)

Reviewed-by: alanb, naoto, darcy, lancea, dfuchs, iris, mchung
This commit is contained in:
Jonathan Gibbons 2023-04-04 00:09:38 +00:00
parent ccbb0e8d89
commit c6bd489cc8
60 changed files with 268 additions and 2 deletions

View file

@ -192,6 +192,8 @@ public abstract class Collator
* described in
* <a href="http://www.unicode.org/reports/tr15/">Unicode
* Standard Annex #15: Unicode Normalization Forms</a>.
*
* @spec https://www.unicode.org/reports/tr15 Unicode Normalization Forms
* @see java.text.Collator#getDecomposition
* @see java.text.Collator#setDecomposition
*/
@ -211,6 +213,8 @@ public abstract class Collator
* described in
* <a href="http://www.unicode.org/reports/tr15/">Unicode
* Standard Annex #15: Unicode Normalization Forms</a>.
*
* @spec https://www.unicode.org/reports/tr15 Unicode Normalization Forms
* @see java.text.Collator#getDecomposition
* @see java.text.Collator#setDecomposition
*/

View file

@ -205,6 +205,8 @@ import java.util.stream.Collectors;
* {@link java.math.RoundingMode} for formatting. By default, it uses
* {@link java.math.RoundingMode#HALF_EVEN RoundingMode.HALF_EVEN}.
*
* @spec https://www.unicode.org/reports/tr35
* Unicode Locale Data Markup Language (LDML)
* @see NumberFormat.Style
* @see NumberFormat
* @see DecimalFormat
@ -423,6 +425,9 @@ public final class CompactNumberFormat extends NumberFormat {
* the {@code compactPatterns} array contains an invalid pattern,
* a {@code null} appears in the array of compact patterns,
* or if the given {@code pluralRules} contains an invalid syntax
*
* @spec https://www.unicode.org/reports/tr35
* Unicode Locale Data Markup Language (LDML)
* @see DecimalFormat#DecimalFormat(java.lang.String, DecimalFormatSymbols)
* @see DecimalFormatSymbols
* @since 14

View file

@ -415,6 +415,9 @@ public class DateFormatSymbols implements Serializable, Cloneable {
* @implSpec This method returns 13 elements since
* {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER} is supported.
* @return the month strings.
*
* @spec https://www.unicode.org/reports/tr35
* Unicode Locale Data Markup Language (LDML)
*/
public String[] getMonths() {
return Arrays.copyOf(months, months.length);
@ -453,6 +456,9 @@ public class DateFormatSymbols implements Serializable, Cloneable {
* @implSpec This method returns 13 elements since
* {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER} is supported.
* @return the short month strings.
*
* @spec https://www.unicode.org/reports/tr35
* Unicode Locale Data Markup Language (LDML)
*/
public String[] getShortMonths() {
return Arrays.copyOf(shortMonths, shortMonths.length);

View file

@ -103,6 +103,7 @@ import jdk.internal.icu.text.NormalizerBase;
* character encodings the Unicode text needs to be normalized to NFC.
* For more usage examples, see the Unicode Standard Annex.
*
* @spec https://www.unicode.org/reports/tr15 Unicode Normalization Forms
* @since 1.6
*/
public final class Normalizer {
@ -116,6 +117,7 @@ public final class Normalizer {
* Unicode Standard Annex #15 &mdash; Unicode Normalization Forms</a>
* and two methods to access them.
*
* @spec https://www.unicode.org/reports/tr15 Unicode Normalization Forms
* @since 1.6
*/
public static enum Form {

View file

@ -586,6 +586,8 @@ public abstract class NumberFormat extends Format {
*
* @param inLocale the desired locale
* @return the {@code NumberFormat} instance for currency formatting
*
* @spec https://www.unicode.org/reports/tr35 Unicode Locale Data Markup Language (LDML)
*/
public static NumberFormat getCurrencyInstance(Locale inLocale) {
return getInstance(inLocale, null, CURRENCYSTYLE);