> 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 14 additional commits since the last revision: - Merge branch 'format-string-numeric-bound' of github.com:igraves/jdk into format-string-numeric-bound - Additional specificity around width - Tweaking verbiage - Updating docs specifying exception for 0 indices - Throwing exceptions for zeroth indexes - Updating docs - Updating docs and throwing errors accordingly - Making IllegalFormatArgumentIndexException package private - Additional specificity around width - Tweaking verbiage - ... and 4 more: https://git.openjdk.java.net/jdk/compare/96b6dcaf...a84d3f2f ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/516/files - new: https://git.openjdk.java.net/jdk/pull/516/files/0526ef43..a84d3f2f Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=05 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=04-05 Stats: 302178 lines in 580 files changed: 296317 ins; 3588 del; 2273 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