Skip to content

Commit b3822f5

Browse files
Justin Lunaotoj
Justin Lu
authored andcommitted
8300589: Use @snippet and @linkplain in java.text.CollationKey and java.text.CompactNumberFormat
Reviewed-by: lancea, naoto, iris
1 parent afd5921 commit b3822f5

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

src/java.base/share/classes/java/text/CollationKey.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -68,7 +68,7 @@
6868
* The following example shows how {@code CollationKey}s might be used
6969
* to sort a list of {@code String}s.
7070
* <blockquote>
71-
* <pre>{@code
71+
* {@snippet lang=java :
7272
* // Create an array of CollationKeys for the Strings to be sorted.
7373
* Collator myCollator = Collator.getInstance();
7474
* CollationKey[] keys = new CollationKey[3];
@@ -89,7 +89,7 @@
8989
* System.out.println(keys[0].getSourceString());
9090
* System.out.println(keys[1].getSourceString());
9191
* System.out.println(keys[2].getSourceString());
92-
* }</pre>
92+
* }
9393
* </blockquote>
9494
*
9595
* @see Collator

src/java.base/share/classes/java/text/CompactNumberFormat.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -61,22 +61,22 @@
6161
* For example:
6262
* <br>In the {@link java.util.Locale#US US locale}, {@code 1000} can be formatted
6363
* as {@code "1K"}, and {@code 1000000} as {@code "1M"}, depending upon the
64-
* <a href = "#compact_number_style" >style</a> used.
64+
* {@linkplain ##compact_number_style style} used.
6565
* <br>In the {@code "hi_IN"} locale, {@code 1000} can be formatted as
6666
* "1 \u0939\u091C\u093C\u093E\u0930", and {@code 50000000} as "5 \u0915.",
67-
* depending upon the <a href = "#compact_number_style" >style</a> used.
67+
* depending upon the {@linkplain ##compact_number_style style} used.
6868
*
6969
* <p>
7070
* To obtain a {@code CompactNumberFormat} for a locale, use one
7171
* of the factory methods given by {@code NumberFormat} for compact number
7272
* formatting. For example,
7373
* {@link NumberFormat#getCompactNumberInstance(Locale, Style)}.
7474
*
75-
* <blockquote><pre>
75+
* <blockquote>{@snippet lang=java :
7676
* NumberFormat fmt = NumberFormat.getCompactNumberInstance(
7777
* Locale.forLanguageTag("hi-IN"), NumberFormat.Style.SHORT);
7878
* String result = fmt.format(1000);
79-
* </pre></blockquote>
79+
* }</blockquote>
8080
*
8181
* <h2><a id="compact_number_style">Style</a></h2>
8282
* <p>
@@ -131,7 +131,7 @@
131131
* <p>
132132
* Many characters in a compact pattern are taken literally, they are matched
133133
* during parsing and output unchanged during formatting.
134-
* <a href = "DecimalFormat.html#special_pattern_character">Special characters</a>,
134+
* {@linkplain DecimalFormat##special_pattern_character Special characters},
135135
* on the other hand, stand for other characters, strings, or classes of
136136
* characters. They must be quoted, using single quote {@code ' (U+0027)}
137137
* unless noted otherwise, if they are to appear in the prefix or suffix
@@ -170,10 +170,10 @@
170170
* <i>Prefix<sub>optional</sub></i> <i>MinimumInteger</i> <i>Suffix<sub>optional</sub></i>
171171
* <i>Prefix:</i>
172172
* Any Unicode characters except {@code U+FFFE}, {@code U+FFFF}, and
173-
* <a href = "DecimalFormat.html#special_pattern_character">special characters</a>.
173+
* {@linkplain DecimalFormat##special_pattern_character special characters}.
174174
* <i>Suffix:</i>
175175
* Any Unicode characters except {@code U+FFFE}, {@code U+FFFF}, and
176-
* <a href = "DecimalFormat.html#special_pattern_character">special characters</a>.
176+
* {@linkplain DecimalFormat##special_pattern_character special characters}.
177177
* <i>MinimumInteger:</i>
178178
* 0
179179
* 0 <i>MinimumInteger</i>
@@ -384,8 +384,7 @@ public final class CompactNumberFormat extends NumberFormat {
384384
* @param decimalPattern a decimal pattern for general number formatting
385385
* @param symbols the set of symbols to be used
386386
* @param compactPatterns an array of
387-
* <a href = "CompactNumberFormat.html#compact_number_patterns">
388-
* compact number patterns</a>
387+
* {@linkplain ##compact_number_patterns compact number patterns}
389388
* @throws NullPointerException if any of the given arguments is
390389
* {@code null}
391390
* @throws IllegalArgumentException if the given {@code decimalPattern} or the
@@ -412,8 +411,7 @@ public CompactNumberFormat(String decimalPattern,
412411
* @param decimalPattern a decimal pattern for general number formatting
413412
* @param symbols the set of symbols to be used
414413
* @param compactPatterns an array of
415-
* <a href = "CompactNumberFormat.html#compact_number_patterns">
416-
* compact number patterns</a>
414+
* {@linkplain ##compact_number_patterns compact number patterns}
417415
* @param pluralRules a String designating plural rules which associate
418416
* the {@code Count} keyword, such as "{@code one}", and the
419417
* actual integer number. Its syntax is defined in Unicode Consortium's

0 commit comments

Comments
 (0)