diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/lang/Integer.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/java/lang/Integer.java b/java/lang/Integer.java index 8f32869a3..8a5514a81 100644 --- a/java/lang/Integer.java +++ b/java/lang/Integer.java @@ -776,16 +776,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); } + if (ch == '+') + { + if (len == 1) + throw new NumberFormatException("pure '+'"); + ch = str.charAt(++index); + } if (decode) { if (ch == '0') |