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

@ -28,7 +28,9 @@ package java.util;
/**
* Unchecked exception thrown when the precision is a negative value other than
* {@code -1}, the conversion does not support a precision, or the value is
* otherwise unsupported.
* otherwise unsupported. If the precision is not representable by an
* {@code int} type, then the value {@code Integer.MIN_VALUE} will be used
* in the exception.
*
* @since 1.5
*/
@ -50,7 +52,8 @@ public class IllegalFormatPrecisionException extends IllegalFormatException {
}
/**
* Returns the precision
* Returns the precision. If the precision isn't representable by an
* {@code int}, then will return {@code Integer.MIN_VALUE}.
*
* @return The precision
*/