<i18n dev> Integrated: 6230751: [Fmt-Ch] Recursive MessageFormats in ChoiceFormats ignore indicated subformats
Justin Lu
jlu at openjdk.org
Tue Dec 12 19:28:43 UTC 2023
On Wed, 29 Nov 2023 22:41:26 GMT, Justin Lu <jlu at openjdk.org> wrote:
> Please review this PR which updates an incorrect code example in _java/text/ChoiceFormat_.
>
> ChoiceFormat (and MessageFormat) provide an example of how to produce a pattern that supports singular and plural forms. The ChoiceFormat example is incorrect, as recursive MessageFormats produced by a ChoiceFormat subformat only recognize subformats defined through the MessageFormat pattern syntax, not through the subformats contained within the top level MessageFormat.
>
> In the original example,
> `Format[] testFormats = {fileform, null, NumberFormat.getInstance()};` could have been replaced with
> `Format[] testFormats = {fileform, null, new ChoiceFormat("0#BROKEN")};` and the original output would have been the same.
>
> This PR replaces the example with the one used in MessageFormat, which is correct.
>
> This PR also includes a drive-by fix to remove leftover `<blockquote>`s from a previous `@snippet` conversion.
This pull request has now been integrated.
Changeset: aadf3680
Author: Justin Lu <jlu at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/aadf36809c5daee8897601d33d8e6d6cedb57b9b
Stats: 63 lines in 2 files changed: 6 ins; 27 del; 30 mod
6230751: [Fmt-Ch] Recursive MessageFormats in ChoiceFormats ignore indicated subformats
Reviewed-by: naoto
-------------
PR: https://git.openjdk.org/jdk/pull/16891
More information about the i18n-dev
mailing list