RFR: JDK-6503196: API doc for DecimalFormat::getMaximumIntegerDigits is unclear

Naoto Sato naoto at openjdk.org
Tue Jan 23 22:16:27 UTC 2024


On Tue, 23 Jan 2024 18:40:42 GMT, Justin Lu <jlu at openjdk.org> wrote:

> Please review this PR which clarifies some confusion for the digit getter and setter methods of DecimalFormat.
> 
> When formatting non `BigInteger` and `BigDecimal` values, DecimalFormat uses 309/340 as hard limits for integer and fraction digit limits, regardless of the value set by the user. There was some confusion, that those numbers might be returned by the getters, when in reality, they are only used internally.
> 
> Moving the 309/340 wording to the class description and linking to it reduces the repetitive wording, but also eliminates the confusion that the getters may return those values. This should be OK, as setting limits higher than those values are likely rare, so the warning does not need to be in every method description.
> 
> Additionally, `getMaximumIntegerDigits()` is updated to point to the patterns section to warn about the non-obvious rules for max integer digits.

LGTM

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

Marked as reviewed by naoto (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/17541#pullrequestreview-1840039217


More information about the core-libs-dev mailing list