<i18n dev> RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v4]

Jason Mehrens jason_mehrens at hotmail.com
Thu Oct 15 02:30:18 UTC 2020


Should IllegalFormatArgumentIndexException.java provide an override of getMessage?  It appears that is done in the following:


Otherwise the index won't be rendered when toString or printStackTrace is invoked.


From: core-libs-dev <core-libs-dev-retn at openjdk.java.net> on behalf of Ian Graves <igraves at openjdk.java.net>
Sent: Wednesday, October 14, 2020 1:39 PM
To: core-libs-dev at openjdk.java.net; i18n-dev at openjdk.java.net
Subject: Re: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v4]

> 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.

Ian Graves has updated the pull request incrementally with one additional commit since the last revision:

  Tweaking verbiage


  - all: https://git.openjdk.java.net/jdk/pull/516/files
  - new: https://git.openjdk.java.net/jdk/pull/516/files/391449a8..9b07ef33

 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=02-03

  Stats: 18 lines in 2 files changed: 0 ins; 5 del; 13 mod
  Patch: https://git.openjdk.java.net/jdk/pull/516.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/516/head:pull/516

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

More information about the i18n-dev mailing list