<i18n dev> RFR: 8352755: Misconceptions about j.text.DecimalFormat digits during parsing

Naoto Sato naoto at openjdk.org
Wed Mar 26 22:38:15 UTC 2025


On Wed, 26 Mar 2025 22:14:57 GMT, Justin Lu <jlu at openjdk.org> wrote:

>> src/java.base/share/classes/java/text/DecimalFormat.java line 4047:
>> 
>>> 4045:      * #setMaximumIntegerDigits(int)} or {@link #applyPattern(String)}.
>>> 4046:      * See the {@link ##patterns Pattern Section} for comprehensive rules regarding
>>> 4047:      * maximum integer digits in patterns.
>> 
>> This part only exists in this method and other getter methods do not have one. Either removing this (as this is explained in the class description), or add it to all other getters would be consistent ( the former is better IMO).
>
> That commentary is only in this method because of the non-obvious behavior for the maximum integer digits. (The pattern does not change the `maximumIntegerDigits`). Since not all users may read that section in the class description, that is why this method has the explicit call-out, so I think it may be beneficial to keep this wording. I am fine either way, if you don't think it's worth it, I'll remove.

If there is some oddity in this getter, would it be helpful if we add more to it, eg, "Unlike other getter methods..."?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24265#discussion_r2015084203


More information about the i18n-dev mailing list