mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8318646: Integer#parseInt("") throws empty NumberFormatException message
Reviewed-by: redestad, alanb, bpb, darcy, uschindler
This commit is contained in:
parent
3f446c5156
commit
9bfa082970
2 changed files with 6 additions and 6 deletions
|
@ -562,7 +562,7 @@ public final class Integer extends Number
|
|||
|
||||
int len = s.length();
|
||||
if (len == 0) {
|
||||
throw new NumberFormatException("");
|
||||
throw NumberFormatException.forInputString("", radix);
|
||||
}
|
||||
int digit = ~0xFF;
|
||||
int i = 0;
|
||||
|
@ -637,7 +637,7 @@ public final class Integer extends Number
|
|||
* and by not updating i anywhere else.
|
||||
*/
|
||||
if (beginIndex == endIndex) {
|
||||
throw new NumberFormatException("");
|
||||
throw NumberFormatException.forInputString("", radix);
|
||||
}
|
||||
int digit = ~0xFF;
|
||||
int i = beginIndex;
|
||||
|
@ -827,7 +827,7 @@ public final class Integer extends Number
|
|||
* and by not updating i anywhere else.
|
||||
*/
|
||||
if (beginIndex == endIndex) {
|
||||
throw new NumberFormatException("");
|
||||
throw NumberFormatException.forInputString("", radix);
|
||||
}
|
||||
int i = beginIndex;
|
||||
char firstChar = s.charAt(i++);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue