Merge
authorasaha
Wed, 04 Nov 2009 10:13:52 -0800
changeset 4224 3cfc595ac892
parent 4223 1a59e792898b (current diff)
parent 4182 ffdc79c88a0e (diff)
child 4225 57ec8171fcd5
Merge
--- a/jdk/src/share/classes/java/math/BigInteger.java	Mon Nov 02 13:59:37 2009 -0800
+++ b/jdk/src/share/classes/java/math/BigInteger.java	Wed Nov 04 10:13:52 2009 -0800
@@ -288,11 +288,11 @@
      */
     public BigInteger(String val, int radix) {
         int cursor = 0, numDigits;
-        int len = val.length();
+        final int len = val.length();
 
         if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX)
             throw new NumberFormatException("Radix out of range");
-        if (val.length() == 0)
+        if (len == 0)
             throw new NumberFormatException("Zero length BigInteger");
 
         // Check for at most one leading sign
@@ -303,7 +303,7 @@
             // No leading sign character or at most one leading sign character
             if (index1 == 0 || index2 == 0) {
                 cursor = 1;
-                if (val.length() == 1)
+                if (len == 1)
                     throw new NumberFormatException("Zero length BigInteger");
             }
             if (index1 == 0)
@@ -342,7 +342,7 @@
         // Process remaining digit groups
         int superRadix = intRadix[radix];
         int groupVal = 0;
-        while (cursor < val.length()) {
+        while (cursor < len) {
             group = val.substring(cursor, cursor += digitsPerInt[radix]);
             groupVal = Integer.parseInt(group, radix);
             if (groupVal < 0)