<i18n dev> RFR: 4745837: Make grouping usage during parsing apparent in relevant NumberFormat methods [v2]

Naoto Sato naoto at openjdk.org
Thu Feb 27 19:42:56 UTC 2025


On Thu, 27 Feb 2025 18:08:35 GMT, Justin Lu <jlu at openjdk.org> wrote:

>> Please review this PR which clarifies some behavior regarding NumberFormat grouping specifically in the grouping related methods.
>> 
>> Please see the corresponding CSR for further detail. Note that an alternative would be to specify this at the DecimalFormat level, allowing NumberFormat subclasses to define this behavior how they want. IMO, I would expect `setGroupingUsed(boolean)` to affect both; a subclass could define `(is|set)(Parsing|Formatting)GroupingUsed` if need be, thus the proposed solution.
>
> Justin Lu has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Naoto review - include strict parsing example. Also remove 'might' wording

src/java.base/share/classes/java/text/NumberFormat.java line 896:

> 894:      *   <li> Parsing {@code "1,234,567"} with grouping off and an implementation that
> 895:      *        implements strict parsing with {@link #isStrict()} returning {@code true}
> 896:      *        throws {@code ParseException}

Sorry for the nit, but I think "an implementation that implements strict parsing" can safely be removed without changing the context.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23813#discussion_r1974233971


More information about the i18n-dev mailing list