mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-25 06:10:44 +00:00
from @RogerRiggs
This commit is contained in:
parent
6c770a89d6
commit
54a2cbee2a
@ -492,11 +492,7 @@ public final class Integer extends Number
|
||||
if (s == null) {
|
||||
throw NumberFormatException.nullInput();
|
||||
}
|
||||
int len;
|
||||
if ((len = s.length()) == 0) {
|
||||
throw NumberFormatException.forInputString(s);
|
||||
}
|
||||
return parseInt(s, 0, len, radix);
|
||||
return parseInt(s, 0, s.length(), radix);
|
||||
}
|
||||
|
||||
static boolean isDigitLatin1(int ch) {
|
||||
|
||||
@ -525,11 +525,7 @@ public final class Long extends Number
|
||||
if (s == null) {
|
||||
throw NumberFormatException.nullInput();
|
||||
}
|
||||
int len;
|
||||
if ((len = s.length()) == 0) {
|
||||
throw NumberFormatException.forInputString(s);
|
||||
}
|
||||
return parseLong(s, 0, len, radix);
|
||||
return parseLong(s, 0, s.length(), radix);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -56,7 +56,9 @@ public class NumberFormatException extends IllegalArgumentException {
|
||||
|
||||
/**
|
||||
* Factory method for making a {@code NumberFormatException}
|
||||
* given the specified input which caused the error.
|
||||
* given the specified input which caused the error. This method
|
||||
* is specifically for radix 10 (decimal) parsing and calls
|
||||
* {@link #forInputString(String, int) forInputString(s, 10)}.
|
||||
*
|
||||
* @param s the input causing the error
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user