summaryrefslogtreecommitdiff
path: root/libjava/classpath/java/lang/Integer.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/lang/Integer.java')
-rw-r--r--libjava/classpath/java/lang/Integer.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/libjava/classpath/java/lang/Integer.java b/libjava/classpath/java/lang/Integer.java
index 62907ff7753..cbf5274f0fc 100644
--- a/libjava/classpath/java/lang/Integer.java
+++ b/libjava/classpath/java/lang/Integer.java
@@ -705,16 +705,19 @@ 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 == '-' || ch == '+')
+ if (ch == '-')
{
if (len == 1)
- if (ch == '-')
- throw new NumberFormatException("pure '-'");
- else if (ch == '+')
- throw new NumberFormatException("pure '+'");
+ throw new NumberFormatException("pure '-'");
isNeg = true;
ch = str.charAt(++index);
}
+ else if (ch == '+')
+ {
+ if (len == 1)
+ throw new NumberFormatException("pure '+'");
+ ch = str.charAt(++index);
+ }
if (decode)
{
if (ch == '0')