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

Reviewed-by: rriggs, smarks
This commit is contained in:
Ian Graves 2020-11-19 20:20:55 +00:00 committed by Stuart Marks
parent b9db002fef
commit 080c707aab
5 changed files with 175 additions and 8 deletions

View file

@ -27,7 +27,9 @@ package java.util;
/**
* Unchecked exception thrown when the format width is a negative value other
* than {@code -1} or is otherwise unsupported.
* than {@code -1} or is otherwise unsupported. If a given format width is not
* representable by an {@code int} type, then the value
* {@code Integer.MIN_VALUE} will be used in the exception.
*
* @since 1.5
*/
@ -49,7 +51,8 @@ public class IllegalFormatWidthException extends IllegalFormatException {
}
/**
* Returns the width
* Returns the width. If the width is not representable by an {@code int},
* then returns {@code Integer.MIN_VALUE}.
*
* @return The width
*/