On Tue, 23 Jan 2024 18:40:42 GMT, Justin Lu <j...@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.

This pull request has now been integrated.

Changeset: 3d32c460
Author:    Justin Lu <j...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/3d32c460eb60aa95f27c96bbefdf784f6a7663f7
Stats:     46 lines in 1 file changed: 17 ins; 22 del; 7 mod

6503196: API doc for DecimalFormat::getMaximumIntegerDigits is unclear

Reviewed-by: naoto, iris

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

PR: https://git.openjdk.org/jdk/pull/17541

Reply via email to