We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4ac4a62 + 7179718 commit 88d65ffCopy full SHA for 88d65ff
Maths/ParseInteger.java
@@ -16,7 +16,7 @@ public static void main(String[] args) {
16
* @throws NumberFormatException if the {@code string} does not contain a parsable integer.
17
*/
18
public static int parseInt(String s) {
19
- if (s == null) {
+ if (s == null || s.length() == 0) {
20
throw new NumberFormatException("null");
21
}
22
boolean isNegative = s.charAt(0) == '-';
0 commit comments