<i18n dev> RFR: 8300794: Use @snippet in java.util:i18n

Naoto Sato naoto at openjdk.org
Thu May 11 20:25:37 UTC 2023


On Wed, 10 May 2023 23:54:37 GMT, Justin Lu <jlu at openjdk.org> wrote:

> Please review this javadoc only change which uses `@snippet` and `@linkplain` in i18n related util packages.

Looks good overall. Some minor comments follow.

src/java.base/share/classes/java/util/Currency.java line 517:

> 515:      * If the default {@link Locale.Category#DISPLAY DISPLAY} locale
> 516:      * contains "rg" (region override)
> 517:      * {@linkplain Locale##def_locale_extension Unicode extensions},

Good catch on plurals

src/java.base/share/classes/java/util/PropertyResourceBundle.java line 85:

> 83:  * {@snippet lang=properties :
> 84:  *     # MessageFormat pattern
> 85:  *     s1=Die Platte \"{1}\" enth\u00E4lt {0}.

I was wondering if the Unicode escape would convert correctly or not, so I tried and found it fine.

src/java.base/share/classes/java/util/ResourceBundle.java line 334:

> 332:  *         if (key.equals("cancelKey")) {
> 333:  *            return "Cancel";
> 334:  *         }

Indentation is inconsistent

src/java.base/share/classes/java/util/ResourceBundle.java line 354:

> 352:  *         // don't need okKey, since parent level handles it.
> 353:  *         if (key.equals("cancelKey")) {
> 354:  *            return "Abbrechen";

Same here

src/java.base/share/classes/java/util/ResourceBundle.java line 512:

> 510:      * Calling this method is equivalent to calling
> 511:      * {@snippet lang=java :
> 512:      *     (String[]) getObject(key); // @link substring="getObject" target="#getObject(java.lang.String)"

`// @link` can be a separate line, placed on top of the target text

-------------

PR Review: https://git.openjdk.org/jdk/pull/13920#pullrequestreview-1423359717
PR Review Comment: https://git.openjdk.org/jdk/pull/13920#discussion_r1191640956
PR Review Comment: https://git.openjdk.org/jdk/pull/13920#discussion_r1191642383
PR Review Comment: https://git.openjdk.org/jdk/pull/13920#discussion_r1191642638
PR Review Comment: https://git.openjdk.org/jdk/pull/13920#discussion_r1191643088
PR Review Comment: https://git.openjdk.org/jdk/pull/13920#discussion_r1191652752


More information about the i18n-dev mailing list