diff options
Diffstat (limited to 'libjava/classpath/java/lang/Integer.java')
-rw-r--r-- | libjava/classpath/java/lang/Integer.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libjava/classpath/java/lang/Integer.java b/libjava/classpath/java/lang/Integer.java index e38eb53edd3..62907ff7753 100644 --- a/libjava/classpath/java/lang/Integer.java +++ b/libjava/classpath/java/lang/Integer.java @@ -705,10 +705,13 @@ public final class Integer extends Number implements Comparable<Integer> if (len == 0) throw new NumberFormatException("string length is null"); int ch = str.charAt(index); - if (ch == '-') + if (ch == '-' || ch == '+') { if (len == 1) - throw new NumberFormatException("pure '-'"); + if (ch == '-') + throw new NumberFormatException("pure '-'"); + else if (ch == '+') + throw new NumberFormatException("pure '+'"); isNeg = true; ch = str.charAt(++index); } |