<i18n dev> Integrated: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly

Ian Graves igraves at openjdk.java.net
Thu Nov 19 20:24:04 UTC 2020


On Mon, 5 Oct 2020 22:23:56 GMT, Ian Graves <igraves at openjdk.org> wrote:

> The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined.
> 
> This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed.
> 
> A CSR will be required for this PR.

This pull request has now been integrated.

Changeset: 080c707a
Author:    Ian Graves <igraves at openjdk.org>
Committer: Stuart Marks <smarks at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/080c707a
Stats:     175 lines in 5 files changed: 167 ins; 0 del; 8 mod

8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly

Reviewed-by: rriggs, smarks

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

PR: https://git.openjdk.java.net/jdk/pull/516


More information about the i18n-dev mailing list