harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r451829 [1/2] - in /incubator/harmony/enhanced/classlib/trunk/modules/math/src: main/java/java/math/ test/java/org/apache/harmony/tests/java/math/ test/java/tests/api/java/math/
Date Sun, 01 Oct 2006 22:31:44 GMT
Author: ndbeyer
Date: Sun Oct  1 15:31:42 2006
New Revision: 451829

URL: http://svn.apache.org/viewvc?view=rev&rev=451829
Log:
Code cleanup -
* Add missing annotations
* Generification
* Add if/else braces
* Remove unnecessary comments

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigDecimal.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigInteger.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BitLevel.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Conversion.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Division.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Elementary.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Logical.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/MathContext.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Multiplication.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Primality.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/RoundingMode.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalArithmeticTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConvertTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalScaleOperationsTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerAddTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerCompareTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConstructorsTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerHashCodeTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerModPowTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerMultiplyTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerOperateBitsTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigDecimal.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigDecimal.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigDecimal.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigDecimal.java Sun Oct  1 15:31:42 2006
@@ -27,8 +27,6 @@
 /**
  * @author Intel Middleware Product Division
  * @author Instituto Tecnologico de Cordoba
- * 
- * @ar.org.fitc.spec_ref 
  */
 public class BigDecimal extends Number implements Comparable<BigDecimal>, Serializable {
     /* Static Fields */
@@ -251,7 +249,9 @@
         }
         // Acumulating all digits until a possible decimal point
         for (; (offset <= last) && (in[offset] != '.')
-        && (in[offset] != 'e') && (in[offset] != 'E'); offset++);
+        && (in[offset] != 'e') && (in[offset] != 'E'); offset++) {
+            ;
+        }
         unscaledBuffer.append(in, begin, offset - begin);
         // A decimal point was found
         if ((offset <= last) && (in[offset] == '.')) {
@@ -259,7 +259,9 @@
             // Acumulating all digits until a possible exponent
             begin = offset;
             for (; (offset <= last) && (in[offset] != 'e')
-            && (in[offset] != 'E'); offset++);
+            && (in[offset] != 'E'); offset++) {
+                ;
+            }
             scale = offset - begin;
             unscaledBuffer.append(in, begin, scale);
         } else {
@@ -472,9 +474,8 @@
             // case s1 == s2: [u1 + u2 , s1]
             if (Math.max(this.bitLength, augend.bitLength) + 1 < 64) {
                 return valueOf(this.smallValue + augend.smallValue, this.scale);
-            } else {
-                return new BigDecimal(this.getUnscaledValue().add(augend.getUnscaledValue()), this.scale);
             }
+            return new BigDecimal(this.getUnscaledValue().add(augend.getUnscaledValue()), this.scale);
         } else if (diffScale > 0) {
             // case s1 > s2 : [(u1 + u2) * 10 ^ (s1 - s2) , s1]
             return addAndMult10(this, augend, diffScale);
@@ -555,9 +556,8 @@
             // case s1 = s2 : [u1 - u2 , s1]
             if (Math.max(this.bitLength, subtrahend.bitLength) + 1 < 64) {
                 return valueOf(this.smallValue - subtrahend.smallValue,this.scale);
-            } else {
-                return new BigDecimal(this.getUnscaledValue().subtract(subtrahend.getUnscaledValue()), this.scale);
             }
+            return new BigDecimal(this.getUnscaledValue().subtract(subtrahend.getUnscaledValue()), this.scale);
         } else if (diffScale > 0) {
             // case s1 > s2 : [ u1 - u2 * 10 ^ (s1 - s2) , s1 ]
             if(diffScale < LONG_TEN_POW.length &&
@@ -616,15 +616,14 @@
 
         if ((this.isZero()) || (multiplicand.isZero())) {
             return zeroScaledBy(newScale);
-        } else {
-            /* Let be: this = [u1,s1] and multiplicand = [u2,s2] so:
-             * this x multiplicand = [ s1 * s2 , s1 + s2 ] */
-            if(this.bitLength + multiplicand.bitLength < 64) {
-                return valueOf(this.smallValue*multiplicand.smallValue,toIntScale(newScale));
-            }
-            return new BigDecimal(this.getUnscaledValue().multiply(
-                    multiplicand.getUnscaledValue()), toIntScale(newScale));
         }
+        /* Let be: this = [u1,s1] and multiplicand = [u2,s2] so:
+         * this x multiplicand = [ s1 * s2 , s1 + s2 ] */
+        if(this.bitLength + multiplicand.bitLength < 64) {
+            return valueOf(this.smallValue*multiplicand.smallValue,toIntScale(newScale));
+        }
+        return new BigDecimal(this.getUnscaledValue().multiply(
+                multiplicand.getUnscaledValue()), toIntScale(newScale));
     }
 
     /** @ar.org.fitc.spec_ref */
@@ -651,7 +650,7 @@
             throw new ArithmeticException(Messages.getString("math.04")); //$NON-NLS-1$
         }
         
-        long diffScale = ((long)this.scale - divisor.scale) - (long)scale;
+        long diffScale = ((long)this.scale - divisor.scale) - scale;
         if(this.bitLength < 64 && divisor.bitLength < 64 ) {
             if(diffScale == 0) {
                 return dividePrimitiveLongs(this.smallValue,
@@ -718,10 +717,9 @@
             if (compRem != 0) {
             if(quotient.bitLength() < 63) {
                 return valueOf(quotient.longValue() + compRem,scale);
-            } else {
-                quotient = quotient.add(BigInteger.valueOf(compRem));
-                return new BigDecimal(quotient, scale);
             }
+            quotient = quotient.add(BigInteger.valueOf(compRem));
+            return new BigDecimal(quotient, scale);
         }
         // Constructing the result with the appropriate unscaled value
         return new BigDecimal(quotient, scale);
@@ -820,8 +818,8 @@
     public BigDecimal divide(BigDecimal divisor, MathContext mc) {
         /* Calculating how many zeros must be append to 'dividend'
          * to obtain a  quotient with at least 'mc.precision()' digits */
-        long traillingZeros = (long)mc.getPrecision() + 2L
-                + (long)divisor.aproxPrecision() - (long)aproxPrecision();
+        long traillingZeros = mc.getPrecision() + 2L
+                + divisor.aproxPrecision() - aproxPrecision();
         long diffScale = (long)scale - divisor.scale;
         long newScale = diffScale; // scale of the final quotient
         int compRem; // to compare the remainder
@@ -948,7 +946,7 @@
             quotAndRem[0] = this.getUnscaledValue().divide(
                     divisor.getUnscaledValue().multiply(Multiplication.powerOf10(diffScale)) );
             // To chose  10^newScale  to get a quotient with at least 'mc.precision()' digits
-            newScale = Math.min(diffScale, Math.max((long)mcPrecision - quotPrecision + 1, 0));
+            newScale = Math.min(diffScale, Math.max(mcPrecision - quotPrecision + 1, 0));
             // To calculate: (u1 / (u2 * 10^(s1-s2)) * 10^newScale
             quotAndRem[0] = quotAndRem[0].multiply(Multiplication.powerOf10(newScale));
         } else {// CASE s2 > s1:   
@@ -965,7 +963,7 @@
             if ((quotAndRem[1].signum() != 0) && (exp > 0)) {
                 // Log10(r) + ((s2 - s1) - exp) > mc.precision ?
                 compRemDiv = (new BigDecimal(quotAndRem[1])).precision()
-                + exp - (long)divisor.precision();
+                + exp - divisor.precision();
                 if (compRemDiv == 0) {
                     // To calculate:  (r * 10^exp2) / u2
                     quotAndRem[1] = quotAndRem[1].multiply(Multiplication.powerOf10(exp)).
@@ -1010,11 +1008,10 @@
         if (resultPrecision > mcPrecision) {
             // math.06=Division impossible
             throw new ArithmeticException(Messages.getString("math.06")); //$NON-NLS-1$
-        } else {
-            integralValue.scale = toIntScale(newScale);
-            integralValue.setUnscaledValue(strippedBI);
-            return integralValue;
         }
+        integralValue.scale = toIntScale(newScale);
+        integralValue.setUnscaledValue(strippedBI);
+        return integralValue;
     }
 
     /** @ar.org.fitc.spec_ref */
@@ -1216,13 +1213,13 @@
                 return valueOf(this.smallValue*LONG_TEN_POW[(int)diffScale],newScale);
             }
             return new BigDecimal(Multiplication.multiplyByTenPow(getUnscaledValue(),(int)diffScale), newScale);
-        } else { // diffScale < 0
-                // return  [u,s] / [1,newScale]  with the apropiate scale and rounding
-            if(this.bitLength < 64 && -diffScale < LONG_TEN_POW.length) {
-                return dividePrimitiveLongs(this.smallValue, LONG_TEN_POW[(int)-diffScale], newScale,roundingMode);
-            }
-            return divideBigIntegers(this.getUnscaledValue(),Multiplication.powerOf10(-diffScale),newScale,roundingMode);
         }
+        // diffScale < 0
+        // return  [u,s] / [1,newScale]  with the apropiate scale and rounding
+        if(this.bitLength < 64 && -diffScale < LONG_TEN_POW.length) {
+            return dividePrimitiveLongs(this.smallValue, LONG_TEN_POW[(int)-diffScale], newScale,roundingMode);
+        }
+        return divideBigIntegers(this.getUnscaledValue(),Multiplication.powerOf10(-diffScale),newScale,roundingMode);
     }
 
     /** @ar.org.fitc.spec_ref */
@@ -1243,24 +1240,20 @@
     private BigDecimal movePoint(long newScale) {
         if (isZero()) {
             return zeroScaledBy(Math.max(newScale, 0));
-        } else {
-            /* When:  'n'== Integer.MIN_VALUE  isn't possible to call to movePointRight(-n)  
-             * since  -Integer.MIN_VALUE == Integer.MIN_VALUE */
-            if(newScale >= 0) {
-                if(bitLength < 64) {
-                    return valueOf(smallValue,toIntScale(newScale));
-                } else {
-                    return new BigDecimal(getUnscaledValue(), toIntScale(newScale));
-                }
-            } else {
-                if(-newScale < LONG_TEN_POW.length &&
-                        bitLength + LONG_TEN_POW_BIT_LENGTH[(int)-newScale] < 64 ) {
-                    return valueOf(smallValue*LONG_TEN_POW[(int)-newScale],0);
-                } else {
-                    return new BigDecimal(Multiplication.multiplyByTenPow(getUnscaledValue(),(int)-newScale), 0);
-                }
+        }
+        /* When:  'n'== Integer.MIN_VALUE  isn't possible to call to movePointRight(-n)  
+         * since  -Integer.MIN_VALUE == Integer.MIN_VALUE */
+        if(newScale >= 0) {
+            if(bitLength < 64) {
+                return valueOf(smallValue,toIntScale(newScale));
             }
+            return new BigDecimal(getUnscaledValue(), toIntScale(newScale));
         }
+        if(-newScale < LONG_TEN_POW.length &&
+                bitLength + LONG_TEN_POW_BIT_LENGTH[(int)-newScale] < 64 ) {
+            return valueOf(smallValue*LONG_TEN_POW[(int)-newScale],0);
+        }
+        return new BigDecimal(Multiplication.multiplyByTenPow(getUnscaledValue(),(int)-newScale), 0);
     }
 
     /** @ar.org.fitc.spec_ref */
@@ -1277,9 +1270,8 @@
                 return zeroScaledBy( newScale );
             }
             return valueOf(smallValue,toIntScale(newScale));
-        } else {
-            return new BigDecimal(getUnscaledValue(), toIntScale(newScale));
         }
+        return new BigDecimal(getUnscaledValue(), toIntScale(newScale));
     }
 
     /** @ar.org.fitc.spec_ref */
@@ -1550,9 +1542,8 @@
                 // It exists a non-zero fractional part 
                 // math.08=Rounding necessary
                 throw new ArithmeticException(Messages.getString("math.08")); //$NON-NLS-1$
-            } else {
-                return integerAndFraction[0];
             }
+            return integerAndFraction[0];
         }
     }
 
@@ -1697,19 +1688,19 @@
             // Denormalized numbers (having exponent == 0)
             if (exponent < -53) {// exponent - bias < -1076
                 return (sign * 0.0d);
-            } else {// -1076 <= exponent - bias <= -1023 
-                // To discard '- exponent + 1' bits
-                bits = tempBits >> 1;
-                tempBits = bits & (-1L >>> (63 + exponent));
-                bits >>= (-exponent );
-                // To test if after discard bits, a new carry is generated
-                if (((bits & 3) == 3) || (((bits & 1) == 1) && (tempBits != 0)
-                && (lowestSetBit < discardedSize))) {
-                    bits += 1;
-                }
-                exponent = 0;
-                bits >>= 1;
             }
+            // -1076 <= exponent - bias <= -1023 
+            // To discard '- exponent + 1' bits
+            bits = tempBits >> 1;
+            tempBits = bits & (-1L >>> (63 + exponent));
+            bits >>= (-exponent );
+            // To test if after discard bits, a new carry is generated
+            if (((bits & 3) == 3) || (((bits & 1) == 1) && (tempBits != 0)
+            && (lowestSetBit < discardedSize))) {
+                bits += 1;
+            }
+            exponent = 0;
+            bits >>= 1;
         }
         // Construct the 64 double bits: [sign(1), exponent(11), mantisa(52)]
         bits = (sign & 0x8000000000000000L) | ((long)exponent << 52)
@@ -1879,10 +1870,9 @@
         if (bigInteger.bitLength() < bitLengthOfType) {
             // It fits in the primitive type
             return bigInteger.longValue();
-        } else {
-            // math.08=Rounding necessary
-            throw new ArithmeticException(Messages.getString("math.08")); //$NON-NLS-1$
         }
+        // math.08=Rounding necessary
+        throw new ArithmeticException(Messages.getString("math.08")); //$NON-NLS-1$
     }
 
     /**
@@ -1937,9 +1927,8 @@
             }
         if (longScale >= 0) {
             return new BigDecimal( 0, Integer.MAX_VALUE);
-        } else {
-            return new BigDecimal( 0, Integer.MIN_VALUE);
         }
+        return new BigDecimal( 0, Integer.MIN_VALUE);
     }
 
     /** @ar.org.fitc.spec_ref */

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigInteger.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigInteger.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigInteger.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BigInteger.java Sun Oct  1 15:31:42 2006
@@ -28,7 +28,6 @@
 /**
  * @author Intel Middleware Product Division
  * @author Instituto Tecnologico de Cordoba
- * @ar.org.fitc.spec_ref 
  */
 public class BigInteger extends Number implements Comparable<BigInteger>,
         Serializable {
@@ -79,18 +78,6 @@
     /* Serialized Fields */
 
     /** @ar.org.fitc.spec_ref */
-    private int bitCount = -1;
-
-    /** @ar.org.fitc.spec_ref */
-    private int bitLength = -1;
-
-    /** @ar.org.fitc.spec_ref */
-    private int lowestSetBit = -2;
-
-    /** @ar.org.fitc.spec_ref */
-    private int firstNonzeroByteNum = -2;
-
-    /** @ar.org.fitc.spec_ref */
     private int signum;
 
     /** @ar.org.fitc.spec_ref */
@@ -170,8 +157,8 @@
             throw new NumberFormatException(Messages.getString("math.13")); //$NON-NLS-1$
         }
         if (signum == 0) {
-            for (int i = 0; i < magnitude.length; i++) {
-                if (magnitude[i] != 0) {
+            for (byte element : magnitude) {
+                if (element != 0) {
                     // math.14=signum-magnitude mismatch
                     throw new NumberFormatException(Messages.getString("math.14")); //$NON-NLS-1$
                 }
@@ -277,10 +264,9 @@
     public static BigInteger valueOf(long val) {
         if (val < 0) {
             if(val != -1) {
-            return new BigInteger(-1, -val);
-            } else {
-                return MINUS_ONE;
+                return new BigInteger(-1, -val);
             }
+            return MINUS_ONE;
         } else if (val <= 10) {
             return SMALL_VALUES[(int) val];
         } else {// (val > 10)
@@ -396,8 +382,9 @@
         int i;
         n = (1 << (n & 31)); // int with 1 set to the needed position
         if (sign < 0) {
-            for (i = 0; (i < intCount) && (digits[i] == 0); i++)
+            for (i = 0; (i < intCount) && (digits[i] == 0); i++) {
                 ;
+            }
             digit = ((i == intCount) ? -digit : ~digit);
         }
         return ((digit & n) != 0);
@@ -441,8 +428,9 @@
         }
         int i;
         // (sign != 0)  implies that exists some non zero digit 
-        for (i = 0; digits[i] == 0; i++)
+        for (i = 0; digits[i] == 0; i++) {
             ;
+        }
         return ((i << 5) + Integer.numberOfTrailingZeros(digits[i]));
     }
 
@@ -477,11 +465,13 @@
     }
 
     /** @ar.org.fitc.spec_ref */
+    @Override
     public int intValue() {
         return (sign * digits[0]);
     }
 
     /** @ar.org.fitc.spec_ref */
+    @Override
     public long longValue() {
         long value = (numberLength > 1) ? (((long) digits[1]) << 32)
                 | (digits[0] & 0xFFFFFFFFL) : (digits[0] & 0xFFFFFFFFL);
@@ -489,11 +479,13 @@
     }
 
     /** @ar.org.fitc.spec_ref */
+    @Override
     public float floatValue() {
         return (float) doubleValue();
     }
 
     /** @ar.org.fitc.spec_ref */
+    @Override
     public double doubleValue() {
         return Conversion.bigInteger2Double(this);
     }
@@ -528,16 +520,19 @@
     }
 
     /** @ar.org.fitc.spec_ref */
+    @Override
     public int hashCode() {
         return intValue();
     }
 
     /** @ar.org.fitc.spec_ref */
+    @Override
     public boolean equals(Object x) {
         return ((x instanceof BigInteger) && (compareTo((BigInteger) x) == EQUALS));
     }
 
     /** @ar.org.fitc.spec_ref */
+    @Override
     public String toString() {
         return Conversion.toDecimalScaledString(this, 0);
     }
@@ -577,9 +572,9 @@
                 && ((val2.numberLength == 1) || ((val2.numberLength == 2) && (val2.digits[1] > 0)))) {
             return BigInteger.valueOf(Division.gcdBinary(val1.longValue(), val2
                     .longValue()));
-        } else {// Now 'val1' and 'val2' will be muttable
-            return Division.gcdBinary(val1.clone(), val2.clone());
         }
+        // Now 'val1' and 'val2' will be muttable
+        return Division.gcdBinary(val1.clone(), val2.clone());
     }
 
     /** @ar.org.fitc.spec_ref */
@@ -626,23 +621,22 @@
                 : Elementary.compareArrays(thisDigits, divisorDigits, thisLen);
         if (cmp < 0) {
             return new BigInteger[] { ZERO, this };
-        } else {
-            int thisSign = sign;
-            int quotientLength = thisLen - divisorLen + 1;
-            int remainderLength = divisorLen;
-            int quotientSign = ((thisSign == divisorSign) ? 1 : -1);
-            int quotientDigits[] = new int[quotientLength];
-            int remainderDigits[] = Division.divide(quotientDigits,
-                    quotientLength, thisDigits, thisLen, divisorDigits,
-                    divisorLen);
-            BigInteger result0 = new BigInteger(quotientSign, quotientLength,
-                    quotientDigits);
-            BigInteger result1 = new BigInteger(thisSign, remainderLength,
-                    remainderDigits);
-            result0.cutOffLeadingZeroes();
-            result1.cutOffLeadingZeroes();
-            return new BigInteger[] { result0, result1 };
         }
+        int thisSign = sign;
+        int quotientLength = thisLen - divisorLen + 1;
+        int remainderLength = divisorLen;
+        int quotientSign = ((thisSign == divisorSign) ? 1 : -1);
+        int quotientDigits[] = new int[quotientLength];
+        int remainderDigits[] = Division.divide(quotientDigits,
+                quotientLength, thisDigits, thisLen, divisorDigits,
+                divisorLen);
+        BigInteger result0 = new BigInteger(quotientSign, quotientLength,
+                quotientDigits);
+        BigInteger result1 = new BigInteger(thisSign, remainderLength,
+                remainderDigits);
+        result0.cutOffLeadingZeroes();
+        result1.cutOffLeadingZeroes();
+        return new BigInteger[] { result0, result1 };
     }
 
     /** @ar.org.fitc.spec_ref */
@@ -659,36 +653,32 @@
         int thisLen = numberLength;
         int divisorLen = divisor.numberLength;
         if (thisLen + divisorLen == 2) {
-            long val = ((long) digits[0] & 0xFFFFFFFFL)
-                    / ((long) divisor.digits[0] & 0xFFFFFFFFL);
+            long val = (digits[0] & 0xFFFFFFFFL)
+                    / (divisor.digits[0] & 0xFFFFFFFFL);
             if (thisSign != divisorSign) {
                 val = -val;
             }
             return valueOf(val);
+        }
+        int cmp = ((thisLen != divisorLen) ? ((thisLen > divisorLen) ? 1 : -1) : Elementary
+                .compareArrays(digits, divisor.digits, thisLen));
+        if (cmp == EQUALS) {
+            return ((thisSign == divisorSign) ? ONE : MINUS_ONE);
+        }
+        if (cmp == LESS) {
+            return ZERO;
+        }
+        int resLength = thisLen - divisorLen + 1;
+        int resDigits[] = new int[resLength];
+        int resSign = ((thisSign == divisorSign) ? 1 : -1);
+        if (divisorLen == 1) {
+            Division.divideArrayByInt(resDigits, digits, thisLen, divisor.digits[0]);
         } else {
-            int cmp = ((thisLen != divisorLen) ? ((thisLen > divisorLen) ? 1
-                    : -1) : Elementary.compareArrays(digits, divisor.digits,
-                    thisLen));
-            if (cmp == EQUALS) {
-                return ((thisSign == divisorSign) ? ONE : MINUS_ONE);
-            }
-            if (cmp == LESS) {
-                return ZERO;
-            }
-            int resLength = thisLen - divisorLen + 1;
-            int resDigits[] = new int[resLength];
-            int resSign = ((thisSign == divisorSign) ? 1 : -1);
-            if (divisorLen == 1) {
-                Division.divideArrayByInt(resDigits, digits, thisLen,
-                        divisor.digits[0]);
-            } else {
-                Division.divide(resDigits, resLength, digits, thisLen,
-                        divisor.digits, divisorLen);
-            }
-            BigInteger result = new BigInteger(resSign, resLength, resDigits);
-            result.cutOffLeadingZeroes();
-            return result;
+            Division.divide(resDigits, resLength, digits, thisLen, divisor.digits, divisorLen);
         }
+        BigInteger result = new BigInteger(resSign, resLength, resDigits);
+        result.cutOffLeadingZeroes();
+        return result;
     }
 
     /** @ar.org.fitc.spec_ref */
@@ -796,8 +786,9 @@
 
     /** Decreases {@code numberLength} if there are zero high elements. */
     final void cutOffLeadingZeroes() {
-        while ((numberLength > 0) && (digits[--numberLength] == 0))
+        while ((numberLength > 0) && (digits[--numberLength] == 0)) {
             ;
+        }
         if (digits[numberLength++] == 0) {
             sign = 0;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BitLevel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BitLevel.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BitLevel.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/BitLevel.java Sun Oct  1 15:31:42 2006
@@ -23,11 +23,11 @@
  * <ul type="circle">
  * <li>Left Shifting</li>
  * <li>Right Shifting</li>
- * <li>Bit clearingting</li>
+ * <li>Bit clearing</li>
  * <li>Bit setting</li>
  * <li>Bit counting</li>
  * <li>Bit testing</li>
- * <li>Getting of the lowest bit setted</li>
+ * <li>Getting of the lowest bit set</li>
  * </ul>
  * All operations are provided in immutable way, and some in both mutable and
  * immutable.
@@ -47,8 +47,9 @@
     static int setTrueCoded(int arr[], final int length) {
         int i;
         // Until the first set bit, the bits are equal (i.e. 0)
-        for (i = 0; (i < length) && (arr[i] == 0); i++)
+        for (i = 0; (i < length) && (arr[i] == 0); i++) {
             ;
+        }
         if (i == length) {
             return 1;
         }
@@ -71,8 +72,9 @@
         int i;
 
         if (val.sign < 0) {
-            for (i = 0; val.digits[i] == 0; i++)
+            for (i = 0; val.digits[i] == 0; i++) {
                 ;
+            }
             // We reduce the problem to the positive case.
             if (i == val.numberLength - 1) {
                 highDigit--;
@@ -93,8 +95,9 @@
                 bCount += Integer.bitCount(val.digits[i]);
             }
         } else {// (sign < 0)
-            for (i = 0; val.digits[i] == 0; i++)
+            for (i = 0; val.digits[i] == 0; i++) {
                 ;
+            }
             // this digit absorbs the carry
             bCount += Integer.bitCount(-val.digits[i]);
             for (i++; i < val.numberLength; i++) {
@@ -170,8 +173,9 @@
         int bitCount = numberOfBits & 31;
         int i;
 
-        for (i = 0; (i < intCount) && (digits[i] == 0); i++)
+        for (i = 0; (i < intCount) && (digits[i] == 0); i++) {
             ;
+        }
         return ((i != intCount) || (digits[i] << (32 - bitCount) != 0));
     }
 
@@ -237,8 +241,9 @@
         if (source.sign < 0) {
             // Checking if the dropped bits are zeros (the remainder equals to
             // 0)
-            for (i = 0; (i < intCount) && (source.digits[i] == 0); i++)
+            for (i = 0; (i < intCount) && (source.digits[i] == 0); i++) {
                 ;
+            }
             // If the remainder is not zero, add 1 to the result
             if ((i < intCount)
                     || ((count > 0) && ((source.digits[i] << (32 - count)) != 0))) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Conversion.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Conversion.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Conversion.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Conversion.java Sun Oct  1 15:31:42 2006
@@ -119,7 +119,7 @@
         }
         if (numberLength == 1) {
             int highDigit = digits[numberLength - 1];
-            long v = (long) highDigit & 0xFFFFFFFFL;
+            long v = highDigit & 0xFFFFFFFFL;
             if (sign < 0) {
                 v = -v;
             }
@@ -159,8 +159,9 @@
                 for (i = 0; i < delta && currentChar > 0; i++) {
                     result[--currentChar] = '0';
                 }
-                for (i = tempLen - 1; (i > 0) && (temp[i] == 0); i--)
+                for (i = tempLen - 1; (i > 0) && (temp[i] == 0); i--) {
                     ;
+                }
                 tempLen = i + 1;
                 if ((tempLen == 1) && (temp[0] == 0)) { // the quotient is 0
                     break;
@@ -225,71 +226,70 @@
                     result1.append(-scale);
                     return result1.toString();
             }
+        }
+        // one 32-bit unsigned value may contains 10 decimal digits
+        resLengthInChars = numberLength * 10 + 1 + 7;
+        // Explanation why +1+7:
+        // +1 - one char for sign if needed.
+        // +7 - For "special case 2" (see below) we have 7 free chars for
+        // inserting necessary scaled digits.
+        result = new char[resLengthInChars + 1];
+        // alocated [resLengthInChars+1] charactes.
+        // a free latest character may be used for "special case 1" (see
+        // below)
+        currentChar = resLengthInChars;
+        if (numberLength == 1) {
+            int highDigit = digits[0];
+            if (highDigit < 0) {
+                long v = highDigit & 0xFFFFFFFFL;
+                do {
+                    long prev = v;
+                    v /= 10;
+                    result[--currentChar] = (char) (0x0030 + ((int) (prev - v * 10)));
+                } while (v != 0);
+            } else {
+                int v = highDigit;
+                do {
+                    int prev = v;
+                    v /= 10;
+                    result[--currentChar] = (char) (0x0030 + (prev - v * 10));
+                } while (v != 0);
+            }
         } else {
-            // one 32-bit unsigned value may contains 10 decimal digits
-            resLengthInChars = numberLength * 10 + 1 + 7;
-            // Explanation why +1+7:
-            // +1 - one char for sign if needed.
-            // +7 - For "special case 2" (see below) we have 7 free chars for
-            // inserting necessary scaled digits.
-            result = new char[resLengthInChars + 1];
-            // alocated [resLengthInChars+1] charactes.
-            // a free latest character may be used for "special case 1" (see
-            // below)
-            currentChar = resLengthInChars;
-            if (numberLength == 1) {
-                int highDigit = digits[0];
-                if (highDigit < 0) {
-                    long v = (long) highDigit & 0xFFFFFFFFL;
-                    do {
-                        long prev = v;
-                        v /= 10;
-                        result[--currentChar] = (char) (0x0030 + ((int) (prev - v * 10)));
-                    } while (v != 0);
-                } else {
-                    int v = highDigit;
-                    do {
-                        int prev = v;
-                        v /= 10;
-                        result[--currentChar] = (char) (0x0030 + (prev - v * 10));
-                    } while (v != 0);
+            int temp[] = new int[numberLength];
+            int tempLen = numberLength;
+            System.arraycopy(digits, 0, temp, 0, tempLen);
+            BIG_LOOP: while (true) {
+                // divide the array of digits by bigRadix and convert
+                // remainders
+                // to characters collecting them in the char array
+                long result11 = 0;
+                for (int i1 = tempLen - 1; i1 >= 0; i1--) {
+                    long temp1 = (result11 << 32)
+                            + (temp[i1] & 0xFFFFFFFFL);
+                    long res = divideLongByBillion(temp1);
+                    temp[i1] = (int) res;
+                    result11 = (int) (res >> 32);
                 }
-            } else {
-                int temp[] = new int[numberLength];
-                int tempLen = numberLength;
-                System.arraycopy(digits, 0, temp, 0, tempLen);
-                BIG_LOOP: while (true) {
-                    // divide the array of digits by bigRadix and convert
-                    // remainders
-                    // to characters collecting them in the char array
-                    long result11 = 0;
-                    for (int i1 = tempLen - 1; i1 >= 0; i1--) {
-                        long temp1 = (result11 << 32)
-                                + ((long) temp[i1] & 0xFFFFFFFFL);
-                        long res = divideLongByBillion(temp1);
-                        temp[i1] = (int) res;
-                        result11 = (int) (res >> 32);
-                    }
-                    int resDigit = (int) result11;
-                    int previous = currentChar;
-                    do {
-                        result[--currentChar] = (char) (0x0030 + (resDigit % 10));
-                    } while (((resDigit /= 10) != 0) && (currentChar != 0));
-                    int delta = 9 - previous + currentChar;
-                    for (int i = 0; (i < delta) && (currentChar > 0); i++) {
-                        result[--currentChar] = '0';
-                    }
-                    int j = tempLen - 1;
-                    for (; temp[j] == 0; j--) {
-                        if (j == 0) { // means temp[0] == 0
-                            break BIG_LOOP;
-                        }
-                    }
-                    tempLen = j + 1;
+                int resDigit = (int) result11;
+                int previous = currentChar;
+                do {
+                    result[--currentChar] = (char) (0x0030 + (resDigit % 10));
+                } while (((resDigit /= 10) != 0) && (currentChar != 0));
+                int delta = 9 - previous + currentChar;
+                for (int i = 0; (i < delta) && (currentChar > 0); i++) {
+                    result[--currentChar] = '0';
                 }
-                while (result[currentChar] == '0') {
-                    currentChar++;
+                int j = tempLen - 1;
+                for (; temp[j] == 0; j--) {
+                    if (j == 0) { // means temp[0] == 0
+                        break BIG_LOOP;
+                    }
                 }
+                tempLen = j + 1;
+            }
+            while (result[currentChar] == '0') {
+                currentChar++;
             }
         }
         boolean negNumber = (sign < 0);
@@ -314,42 +314,40 @@
                 }
                 return new String(result, currentChar, resLengthInChars
                         - currentChar + 1);
-            } else {
-                // special case 2
-                for (int j = 2; j < -exponent + 1; j++) {
-                    result[--currentChar] = '0';
-                }
-                result[--currentChar] = '.';
+            }
+            // special case 2
+            for (int j = 2; j < -exponent + 1; j++) {
                 result[--currentChar] = '0';
-                if (negNumber) {
-                    result[--currentChar] = '-';
-                }
-                return new String(result, currentChar, resLengthInChars
-                        - currentChar);
             }
-        } else {
-            int startPoint = currentChar + 1;
-            int endPoint = resLengthInChars;
-            StringBuffer result1 = new StringBuffer(16 + endPoint - startPoint);
+            result[--currentChar] = '.';
+            result[--currentChar] = '0';
             if (negNumber) {
-                result1.append('-');
-            }
-            if (endPoint - startPoint >= 1) {
-                result1.append(result[currentChar]);
-                result1.append('.');
-                result1.append(result, currentChar + 1, resLengthInChars
-                        - currentChar - 1);
-            } else {
-                result1.append(result, currentChar, resLengthInChars
-                        - currentChar);
-            }
-            result1.append('E');
-            if (exponent > 0) {
-                result1.append('+');
+                result[--currentChar] = '-';
             }
-            result1.append(Integer.toString(exponent));
-            return result1.toString();
+            return new String(result, currentChar, resLengthInChars
+                    - currentChar);
+        }
+        int startPoint = currentChar + 1;
+        int endPoint = resLengthInChars;
+        StringBuffer result1 = new StringBuffer(16 + endPoint - startPoint);
+        if (negNumber) {
+            result1.append('-');
+        }
+        if (endPoint - startPoint >= 1) {
+            result1.append(result[currentChar]);
+            result1.append('.');
+            result1.append(result, currentChar + 1, resLengthInChars
+                    - currentChar - 1);
+        } else {
+            result1.append(result, currentChar, resLengthInChars
+                    - currentChar);
         }
+        result1.append('E');
+        if (exponent > 0) {
+            result1.append('+');
+        }
+        result1.append(Integer.toString(exponent));
+        return result1.toString();
     }
 
     /* can process only 32-bit numbers */
@@ -380,26 +378,25 @@
                     result1.append( (scale == Integer.MIN_VALUE) ? "2147483648" : Integer.toString(-scale)); //$NON-NLS-1$
                     return result1.toString();
             }
-        } else {
-            // one 32-bit unsigned value may contains 10 decimal digits
-            resLengthInChars = 18;
-            // Explanation why +1+7:
-            // +1 - one char for sign if needed.
-            // +7 - For "special case 2" (see below) we have 7 free chars for
-            //  inserting necessary scaled digits.
-            result = new char[resLengthInChars+1];
-            //  alocated [resLengthInChars+1] charactes.
-            // a free latest character may be used for "special case 1" (see below)
-            currentChar = resLengthInChars;
-            long v = value;
-            do {
-                long prev = v;
-                v /= 10;
-                result[--currentChar] = (char) (0x0030 + (prev - v * 10));
-            } while (v != 0);
         }
+        // one 32-bit unsigned value may contains 10 decimal digits
+        resLengthInChars = 18;
+        // Explanation why +1+7:
+        // +1 - one char for sign if needed.
+        // +7 - For "special case 2" (see below) we have 7 free chars for
+        //  inserting necessary scaled digits.
+        result = new char[resLengthInChars+1];
+        //  Allocated [resLengthInChars+1] characters.
+        // a free latest character may be used for "special case 1" (see below)
+        currentChar = resLengthInChars;
+        long v = value;
+        do {
+            long prev = v;
+            v /= 10;
+            result[--currentChar] = (char) (0x0030 + (prev - v * 10));
+        } while (v != 0);
         
-        long exponent = (long)resLengthInChars - (long)currentChar - (long)scale - 1L;
+        long exponent = (long)resLengthInChars - (long)currentChar - scale - 1L;
         if (scale == 0) {
             if (negNumber) {
                 result[--currentChar] = '-';
@@ -418,39 +415,37 @@
                     result[--currentChar] = '-';
                 }
                 return new String(result, currentChar, resLengthInChars - currentChar + 1);
-            } else {
-                // special case 2
-                for (int j = 2; j < -exponent + 1; j++) {
-                    result[--currentChar] = '0';
-                }
-                result[--currentChar] = '.';
+            }
+            // special case 2
+            for (int j = 2; j < -exponent + 1; j++) {
                 result[--currentChar] = '0';
-                if (negNumber) {
-                    result[--currentChar] = '-';
-                }
-                return new String(result, currentChar, resLengthInChars - currentChar);
             }
-        } else {
-            int startPoint = currentChar + 1;
-            int endPoint = resLengthInChars;
-            StringBuffer result1 = new StringBuffer(16+endPoint-startPoint);
+            result[--currentChar] = '.';
+            result[--currentChar] = '0';
             if (negNumber) {
-                result1.append('-');
-            }
-            if (endPoint - startPoint >= 1) {
-                result1.append(result[currentChar]);
-                result1.append('.');
-                result1.append(result,currentChar+1,resLengthInChars - currentChar-1);
-            } else {
-                result1.append(result,currentChar,resLengthInChars - currentChar);
-            }
-            result1.append('E');
-            if (exponent > 0) {
-                result1.append('+');
+                result[--currentChar] = '-';
             }
-            result1.append(Long.toString(exponent));
-            return result1.toString();
+            return new String(result, currentChar, resLengthInChars - currentChar);
+        }
+        int startPoint = currentChar + 1;
+        int endPoint = resLengthInChars;
+        StringBuffer result1 = new StringBuffer(16+endPoint-startPoint);
+        if (negNumber) {
+            result1.append('-');
+        }
+        if (endPoint - startPoint >= 1) {
+            result1.append(result[currentChar]);
+            result1.append('.');
+            result1.append(result,currentChar+1,resLengthInChars - currentChar-1);
+        } else {
+            result1.append(result,currentChar,resLengthInChars - currentChar);
+        }
+        result1.append('E');
+        if (exponent > 0) {
+            result1.append('+');
         }
+        result1.append(Long.toString(exponent));
+        return result1.toString();
     }
     
     static long divideLongByBillion(long a) {
@@ -515,7 +510,7 @@
         }
         mantissa >>= 1; // drop the rounding bit
         long resSign = (val.sign < 0) ? 0x8000000000000000L : 0;
-        exponent = ((long) (1023 + exponent) << 52) & 0x7FF0000000000000L;
+        exponent = ((1023 + exponent) << 52) & 0x7FF0000000000000L;
         long result = resSign | exponent | mantissa;
         return Double.longBitsToDouble(result);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Division.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Division.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Division.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Division.java Sun Oct  1 15:31:42 2006
@@ -39,7 +39,7 @@
  *</ul>
  * 
  * @author Intel Middleware Product Division
- * @author Instituto Tecnológico de Córdoba
+ * @author Instituto Tecnologico de Cordoba
  */
 class Division {
 
@@ -88,7 +88,7 @@
                 // set guessDigit to the largest unsigned int value
                 guessDigit = -1;
             } else {
-                long product = ((((long) normA[j] & 0xffffffffL) << 32) + ((long) normA[j - 1] & 0xffffffffL));
+                long product = (((normA[j] & 0xffffffffL) << 32) + (normA[j - 1] & 0xffffffffL));
                 long res = Division.divideLongByInt(product, firstDivisorDigit);
                 guessDigit = (int) res; // the quotient of divideLongByInt
                 int rem = (int) (res >> 32); // the remainder of
@@ -106,16 +106,16 @@
                             break;
                         }
                         // leftHand always fits in an unsigned long
-                        leftHand = ((long) guessDigit & 0xffffffffL)
-                                * ((long) normB[normBLength - 2] & 0xffffffffL);
+                        leftHand = (guessDigit & 0xffffffffL)
+                                * (normB[normBLength - 2] & 0xffffffffL);
                         /*
                          * rightHand can overflow; in this case the loop
                          * condition will be true in the next step of the loop
                          */
                         rightHand = ((long) rem << 32)
-                                + ((long) normA[j - 2] & 0xffffffffL);
-                        long longR = ((long) rem & 0xffffffffL)
-                                + ((long) firstDivisorDigit & 0xffffffffL);
+                                + (normA[j - 2] & 0xffffffffL);
+                        long longR = (rem & 0xffffffffL)
+                                + (firstDivisorDigit & 0xffffffffL);
                         /*
                          * checks that longR does not fit in an unsigned int;
                          * this ensures that rightHand will overflow unsigned
@@ -134,22 +134,22 @@
             if (guessDigit != 0) {
                 int borrow = Division.multiplyAndSubtract(normA, j
                         - normBLength, normB, normBLength,
-                        (long) guessDigit & 0xffffffffL);
+                        guessDigit & 0xffffffffL);
                 // Step D5: check the borrow
                 if (borrow != 0) {
                     // Step D6: compensating addition
                     guessDigit--;
                     long carry = 0;
                     for (int k = 0; k < normBLength; k++) {
-                        carry += ((long) normA[j - normBLength + k] & 0xffffffffL)
-                                + ((long) normB[k] & 0xffffffffL);
+                        carry += (normA[j - normBLength + k] & 0xffffffffL)
+                                + (normB[k] & 0xffffffffL);
                         normA[j - normBLength + k] = (int) carry;
                         carry >>>= 32;
                     }
                 }
             }
             if (quot != null) {
-                quot[i] = (int) guessDigit;
+                quot[i] = guessDigit;
             }
             // Step D7
             j--;
@@ -162,10 +162,9 @@
             // reuse normB
             BitLevel.shiftRight(normB, normBLength, normA, 0, divisorShift);
             return normB;
-        } else {
-            System.arraycopy(normA, 0, normB, 0, bLength);
-            return normA;
         }
+        System.arraycopy(normA, 0, normB, 0, bLength);
+        return normA;
     }
 
     /**
@@ -182,10 +181,10 @@
             final int divisor) {
 
         long rem = 0;
-        long bLong = (long) divisor & 0xffffffffL;
+        long bLong = divisor & 0xffffffffL;
 
         for (int i = srcLength - 1; i >= 0; i--) {
-            long temp = (rem << 32) | ((long) src[i] & 0xffffffffL);
+            long temp = (rem << 32) | (src[i] & 0xffffffffL);
             long quot;
             if (temp >= 0) {
                 quot = (temp / bLong);
@@ -236,7 +235,7 @@
         long result = 0;
 
         for (int i = srcLength - 1; i >= 0; i--) {
-            long temp = (result << 32) + ((long) src[i] & 0xffffffffL);
+            long temp = (result << 32) + (src[i] & 0xffffffffL);
             long res = divideLongByInt(temp, divisor);
             result = (int) (res >> 32);
         }
@@ -268,7 +267,7 @@
     static long divideLongByInt(long a, int b) {
         long quot;
         long rem;
-        long bLong = (long) b & 0xffffffffL;
+        long bLong = b & 0xffffffffL;
 
         if (a >= 0) {
             quot = (a / bLong);
@@ -314,8 +313,8 @@
         int valLen = val.numberLength;
         int valSign = val.sign;
         if (valLen == 1) {
-            long a = ((long) valDigits[0] & 0xffffffffL);
-            long b = ((long) divisor & 0xffffffffL);
+            long a = (valDigits[0] & 0xffffffffL);
+            long b = (divisor & 0xffffffffL);
             long quo = a / b;
             long rem = a % b;
             if (valSign != divisorSign) {
@@ -326,20 +325,19 @@
             }
             return new BigInteger[] { BigInteger.valueOf(quo),
                     BigInteger.valueOf(rem) };
-        } else {
-            int quotientLength = valLen;
-            int quotientSign = ((valSign == divisorSign) ? 1 : -1);
-            int quotientDigits[] = new int[quotientLength];
-            int remainderDigits[];
-            remainderDigits = new int[] { Division.divideArrayByInt(
-                    quotientDigits, valDigits, valLen, divisor) };
-            BigInteger result0 = new BigInteger(quotientSign, quotientLength,
-                    quotientDigits);
-            BigInteger result1 = new BigInteger(valSign, 1, remainderDigits);
-            result0.cutOffLeadingZeroes();
-            result1.cutOffLeadingZeroes();
-            return new BigInteger[] { result0, result1 };
         }
+        int quotientLength = valLen;
+        int quotientSign = ((valSign == divisorSign) ? 1 : -1);
+        int quotientDigits[] = new int[quotientLength];
+        int remainderDigits[];
+        remainderDigits = new int[] { Division.divideArrayByInt(
+                quotientDigits, valDigits, valLen, divisor) };
+        BigInteger result0 = new BigInteger(quotientSign, quotientLength,
+                quotientDigits);
+        BigInteger result1 = new BigInteger(valSign, 1, remainderDigits);
+        result0.cutOffLeadingZeroes();
+        result1.cutOffLeadingZeroes();
+        return new BigInteger[] { result0, result1 };
     }
 
     /**
@@ -360,7 +358,7 @@
         int productInt;
 
         for (i = 0; i < bLen; i++) {
-            product = c * ((long) b[i] & 0xffffffffL);
+            product = c * (b[i] & 0xffffffffL);
             productInt = (int) product;
             productInt += carry;
             carry = (int) (product >> 32)
@@ -371,8 +369,8 @@
             }
             a[start + i] = productInt;
         }
-        product = ((long) a[start + i] & 0xffffffffL)
-                - ((long) carry & 0xffffffffL);
+        product = (a[start + i] & 0xffffffffL)
+                - (carry & 0xffffffffL);
         a[start + i] = (int) product;
         carry = (int) (product >> 32); // -1 or 0
         return carry;
@@ -701,12 +699,14 @@
             t[s] = t[s + 1] + (int) C;
         }
         // skipping leading zeros
-        for (i = t.length - 1; (i > 0) && (t[i] == 0); i--)
+        for (i = t.length - 1; (i > 0) && (t[i] == 0); i--) {
             ;
+        }
 
         if (i == s - 1) {
-            for (; (i >= 0) && (t[i] == n[i]); i--)
+            for (; (i >= 0) && (t[i] == n[i]); i--) {
                 ;
+            }
             lower = (i >= 0) && (t[i] & 0xFFFFFFFFL) < (n[i] & 0xFFFFFFFFL);
         } else {
             lower = (i < s - 1);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Elementary.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Elementary.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Elementary.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Elementary.java Sun Oct  1 15:31:42 2006
@@ -19,7 +19,7 @@
 
 /**
  * Static library that provides the basic arithmetic mutable operations for
- * {@link BigInteger}. The operations that porvides are listed below.
+ * {@link BigInteger}. The operations provided are listed below.
  * <ul type="circle">
  * <li>Addition.</li>
  * <li>Subtraction.</li>
@@ -28,7 +28,7 @@
  * In addition to this, some <i><b>Inplace</b></i> (mutable) methods are provided.
  * 
  * @author Intel Middleware Product Division
- * @author Instituto Tecnológico de Córdoba
+ * @author Instituto Tecnologico de Cordoba
  */
 class Elementary {
 
@@ -46,8 +46,9 @@
      */
     static int compareArrays(final int[] a, final int[] b, final int size) {
         int i;
-        for (i = size - 1; (i >= 0) && (a[i] == b[i]); i--)
+        for (i = size - 1; (i >= 0) && (a[i] == b[i]); i--) {
             ;
+        }
         return ((i < 0) ? BigInteger.EQUALS
                 : (a[i] & 0xFFFFFFFFL) < (b[i] & 0xFFFFFFFFL) ? BigInteger.LESS
                         : BigInteger.GREATER);
@@ -83,9 +84,8 @@
                 return ((valueHi == 0) ? new BigInteger(op1Sign, valueLo)
                         : new BigInteger(op1Sign, 2, new int[] { valueLo,
                                 valueHi }));
-            } else {
-                return BigInteger.valueOf((op1Sign < 0) ? (b - a) : (a - b));
             }
+            return BigInteger.valueOf((op1Sign < 0) ? (b - a) : (a - b));
         } else if (op1Sign == op2Sign) {
             resSign = op1Sign;
             // an augend should not be shorter than addend

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Logical.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Logical.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Logical.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Logical.java Sun Oct  1 15:31:42 2006
@@ -19,7 +19,7 @@
 
 /**
  * The library implements some logical operations over {@code BigInteger}. The
- * operations that porvides are listed below.
+ * operations provided are listed below.
  * <ul type="circle">
  * <li>not</li>
  * <li>and</li>
@@ -86,11 +86,13 @@
         if (val.sign > 0) {
             // ~val = -val + 1
             if (val.digits[val.numberLength - 1] != -1) {
-                for (i = 0; val.digits[i] == -1; i++)
+                for (i = 0; val.digits[i] == -1; i++) {
                     ;
+                }
             } else {
-                for (i = 0; (i < val.numberLength) && (val.digits[i] == -1); i++)
+                for (i = 0; (i < val.numberLength) && (val.digits[i] == -1); i++) {
                     ;
+                }
                 if (i == val.numberLength) {
                     resDigits[i] = 1;
                     return new BigInteger(-val.sign, i + 1, resDigits);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/MathContext.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/MathContext.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/MathContext.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/MathContext.java Sun Oct  1 15:31:42 2006
@@ -25,7 +25,6 @@
 import org.apache.harmony.math.internal.nls.Messages;
 
 /**
- * @ar.org.fitc.spec_ref
  * @author Intel Middleware Product Division
  * @author Instituto Tecnologico de Cordoba
  */
@@ -117,8 +116,9 @@
             throw new IllegalArgumentException(Messages.getString("math.0E")); //$NON-NLS-1$
         }
         // Parsing "precision=" String
-        for (i = 0; (i < chPrecision.length) && (charVal[i] == chPrecision[i]); i++)
+        for (i = 0; (i < chPrecision.length) && (charVal[i] == chPrecision[i]); i++) {
             ;
+        }
 
         if (i < chPrecision.length) {
             // math.0E=bad string format
@@ -140,12 +140,12 @@
                     // It parsed all the digits
                     i++;
                     break;
-                } else {// It isn't  a valid digit, and isn't a white space
-                    // math.0E=bad string format
-                    throw new IllegalArgumentException(Messages.getString("math.0E")); //$NON-NLS-1$
                 }
+                // It isn't  a valid digit, and isn't a white space
+                // math.0E=bad string format
+                throw new IllegalArgumentException(Messages.getString("math.0E")); //$NON-NLS-1$
             }
-            // Acumulating the value parsed
+            // Accumulating the value parsed
             this.precision = this.precision * 10 + digit;
             if (this.precision < 0) {
                 // math.0E=bad string format
@@ -155,8 +155,9 @@
         } while (true);
         // Parsing "roundingMode="
         for (j = 0; (j < chRoundingMode.length)
-                && (charVal[i] == chRoundingMode[j]); i++, j++)
+                && (charVal[i] == chRoundingMode[j]); i++, j++) {
             ;
+        }
 
         if (j < chRoundingMode.length) {
             // math.0E=bad string format

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Multiplication.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Multiplication.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Multiplication.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Multiplication.java Sun Oct  1 15:31:42 2006
@@ -309,7 +309,7 @@
         int[] aDigits = val.digits;
         
         if (aNumberLength == 1) {
-            long res = (aDigits[0] & 0xFFFFFFFFL) * ((long)factor);
+            long res = (aDigits[0] & 0xFFFFFFFFL) * (factor);
             int resLo = (int)res;
             int resHi = (int)(res >>> 32);
             return ((resHi == 0)
@@ -386,8 +386,10 @@
             return bigFivePows[1].pow(intExp).shiftLeft(intExp);
         }
         // "LARGE POWERS"
-        /* To check if there is free memory to allocate a BigInteger
-         * of the estimated size, measured in bytes: 1 + [exp / log10(2)] */
+        /*
+         * To check if there is free memory to allocate a BigInteger of the
+         * estimated size, measured in bytes: 1 + [exp / log10(2)]
+         */
         long byteArraySize = 1 + (long)(exp / 2.4082399653118496);
         
         if (byteArraySize > Runtime.getRuntime().freeMemory()) {
@@ -397,30 +399,33 @@
         if (exp <= Integer.MAX_VALUE) {
             // To calculate:    5^exp * 2^exp
             return bigFivePows[1].pow(intExp).shiftLeft(intExp);
-        } else {/* "HUGE POWERS"
-         * Probably this branch won't be executed
-         * since the power of ten is too big. */
-            // To calculate:    5^exp
-            BigInteger powerOfFive = bigFivePows[1].pow(Integer.MAX_VALUE);
-            BigInteger res = powerOfFive;
-            long longExp = exp - Integer.MAX_VALUE;
-            
-            intExp = (int)(exp % Integer.MAX_VALUE);
-            while (longExp > Integer.MAX_VALUE) {
-                res = res.multiply(powerOfFive);
-                longExp -= Integer.MAX_VALUE;
-            }
-            res = res.multiply(bigFivePows[1].pow(intExp));
-            // To calculate:    5^exp << exp
+        }
+        /*
+         * "HUGE POWERS"
+         * 
+         * This branch probably won't be executed since the power of ten is too
+         * big.
+         */
+        // To calculate:    5^exp
+        BigInteger powerOfFive = bigFivePows[1].pow(Integer.MAX_VALUE);
+        BigInteger res = powerOfFive;
+        long longExp = exp - Integer.MAX_VALUE;
+        
+        intExp = (int)(exp % Integer.MAX_VALUE);
+        while (longExp > Integer.MAX_VALUE) {
+            res = res.multiply(powerOfFive);
+            longExp -= Integer.MAX_VALUE;
+        }
+        res = res.multiply(bigFivePows[1].pow(intExp));
+        // To calculate:    5^exp << exp
+        res = res.shiftLeft(Integer.MAX_VALUE);
+        longExp = exp - Integer.MAX_VALUE;
+        while (longExp > Integer.MAX_VALUE) {
             res = res.shiftLeft(Integer.MAX_VALUE);
-            longExp = exp - Integer.MAX_VALUE;
-            while (longExp > Integer.MAX_VALUE) {
-                res = res.shiftLeft(Integer.MAX_VALUE);
-                longExp -= Integer.MAX_VALUE;
-            }
-            res = res.shiftLeft(intExp);
-            return res;
+            longExp -= Integer.MAX_VALUE;
         }
+        res = res.shiftLeft(intExp);
+        return res;
     }
     
     /**
@@ -433,12 +438,11 @@
     static BigInteger multiplyByFivePow(BigInteger val, int exp) {
         // PRE: exp >= 0
         if (exp < fivePows.length) {
-            return multiplyByPositiveInt(val, fivePows[(int)exp]);
+            return multiplyByPositiveInt(val, fivePows[exp]);
         } else if (exp < bigFivePows.length) {
             return val.multiply(bigFivePows[exp]);
         } else {// Large powers of five
             return val.multiply(bigFivePows[1].pow(exp));
         }
     }
-    
-}
\ No newline at end of file
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Primality.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Primality.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Primality.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/Primality.java Sun Oct  1 15:31:42 2006
@@ -102,8 +102,9 @@
         // If n < "last prime of table" searches next prime in the table
         if ((n.numberLength == 1) && (n.digits[0] >= 0)
                 && (n.digits[0] < primes[primes.length - 1])) {
-            for (i = 0; n.digits[0] >= primes[i]; i++)
+            for (i = 0; n.digits[0] >= primes[i]; i++) {
                 ;
+            }
             return BIprimes[i];
         }
         /*
@@ -121,8 +122,9 @@
         }
         // To set the improved certainly of Miller-Rabin
         j = startPoint.bitLength();
-        for (certainty = 2; j < BITS[certainty]; certainty++)
+        for (certainty = 2; j < BITS[certainty]; certainty++) {
             ;
+        }
         // To calculate modules: N mod p1, N mod p2, ... for first primes.
         for (i = 0; i < primes.length; i++) {
             modules[i] = Division.remainder(startPoint, primes[i]) - gapSize;
@@ -217,8 +219,9 @@
         int i;
         int bitLength = n.bitLength();
 
-        for (i = 2; bitLength < BITS[i]; i++)
+        for (i = 2; bitLength < BITS[i]; i++) {
             ;
+        }
         certainty = Math.min(i, 1 + ((certainty - 1) >> 1));
 
         return millerRabin(n, certainty);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/RoundingMode.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/RoundingMode.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/RoundingMode.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/main/java/java/math/RoundingMode.java Sun Oct  1 15:31:42 2006
@@ -20,7 +20,6 @@
 import org.apache.harmony.math.internal.nls.Messages;
 
 /**
- * @ar.org.fitc.spec_ref
  * @author Intel Middleware Product Division
  * @author Instituto Tecnologico de Cordoba
  */

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalArithmeticTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalArithmeticTest.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalArithmeticTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalArithmeticTest.java Sun Oct  1 15:31:42 2006
@@ -1554,7 +1554,6 @@
         RoundingMode rm = RoundingMode.HALF_UP;
         MathContext mc = new MathContext(precision, rm);
         String res = "3736186567876.876578956958765675671119238118911893939591735";
-        int resScale = 2;
         BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale);
         BigDecimal result = aNumber.round(mc);
         assertEquals("incorrect quotient value", res, result.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java Sun Oct  1 15:31:42 2006
@@ -74,7 +74,7 @@
         assertEquals("incorrect scale", 0, aNumber.scale());
 
         try {
-            BigDecimal bd = new BigDecimal((BigInteger) null);
+            new BigDecimal((BigInteger) null);
         	fail("No NullPointerException");
         } catch (NullPointerException e) {
         	//expected
@@ -463,7 +463,7 @@
     public void testConstrStringExceptionExponentLessIntegerMin() {
         String a = "-238768.787678287e-214748364767876";
         try {
-            BigDecimal aNumber = new BigDecimal(a);
+            new BigDecimal(a);
             fail("NumberFormatException has not been caught");
         } catch (NumberFormatException e) {
         }
@@ -488,8 +488,6 @@
      */
     public void testConstrStringExponentIntegerMin() {
         String a = ".238768e-2147483648";
-        int aScale = -2147483638;
-        BigInteger bA = new BigInteger("-238768787678287");
         try {
            new BigDecimal(a);
            fail("NumberFormatException expected");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConvertTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConvertTest.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConvertTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConvertTest.java Sun Oct  1 15:31:42 2006
@@ -317,9 +317,8 @@
     public void testToBigIntegerExactException() {
         String a = "-123809648392384754573567356745735.63567890295784902768787678287E-10";
         BigDecimal aNumber = new BigDecimal(a);
-        String res = "-123809648392384754573567356745735635678902957849027687876782870000000000000000";
         try {
-            BigInteger result = aNumber.toBigIntegerExact();
+            aNumber.toBigIntegerExact();
             fail("java.lang.ArithmeticException has not been thrown");
         } catch (java.lang.ArithmeticException e) {
             return;
@@ -562,7 +561,7 @@
     public void testValueOfDoubleNaN() {
         double a = Double.NaN;
         try {
-            BigDecimal result = BigDecimal.valueOf(a);
+            BigDecimal.valueOf(a);
             fail("NumberFormatException has not been thrown for Double.NaN");
         } catch (NumberFormatException e) {
             return;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalScaleOperationsTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalScaleOperationsTest.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalScaleOperationsTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalScaleOperationsTest.java Sun Oct  1 15:31:42 2006
@@ -117,7 +117,7 @@
         int newScale = 18;
         BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale);
         try {
-            BigDecimal bNumber = aNumber.setScale(newScale);
+            aNumber.setScale(newScale);
             fail("ArithmeticException has not been caught");
         } catch (ArithmeticException e) {
             assertEquals("Improper exception message", "Rounding necessary", e.getMessage());
@@ -330,7 +330,7 @@
         int shift = -18;
         BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale);
         try {
-            BigDecimal bNumber = aNumber.movePointRight(shift);
+            aNumber.movePointRight(shift);
             fail("ArithmeticException has not been caught");
         } catch (ArithmeticException e) {
             assertEquals("Improper exception message", "Underflow", e.getMessage());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerAddTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerAddTest.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerAddTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerAddTest.java Sun Oct  1 15:31:42 2006
@@ -185,8 +185,6 @@
     public void testCase8() {
         byte aBytes[] = {10, 20, 30, 40, 50, 60, 70, 10, 20, 30};
         byte bBytes[] = {1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7};
-        int aSign = 1;
-        int bSign = 1;        
         byte rBytes[] = {1, 2, 3, 4, 15, 26, 37, 41, 52, 63, 74, 15, 26, 37};
         BigInteger aNumber = new BigInteger(aBytes);
         BigInteger bNumber = new BigInteger(bBytes);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerCompareTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerCompareTest.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerCompareTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerCompareTest.java Sun Oct  1 15:31:42 2006
@@ -90,7 +90,6 @@
         int bSign = 1;        
         BigInteger aNumber = new BigInteger(aSign, aBytes);
         BigInteger bNumber = new BigInteger(bSign, bBytes);
-        int result = aNumber.compareTo(bNumber);
         assertEquals(-1, aNumber.compareTo(bNumber));
     }
 
@@ -191,7 +190,6 @@
         int aSign = 1;
         BigInteger aNumber = new BigInteger(aSign, aBytes);
         BigInteger bNumber = BigInteger.ZERO;
-        int result = aNumber.compareTo(bNumber);
         assertEquals(1, aNumber.compareTo(bNumber));
     }
 
@@ -274,7 +272,7 @@
         int aSign = 1;
         int bSign = 1;        
         BigInteger aNumber = new BigInteger(aSign, aBytes);
-        Object bNumber = (Object)new BigInteger(bSign, bBytes);
+        Object bNumber = new BigInteger(bSign, bBytes);
         assertTrue(aNumber.equals(bNumber));
     }
 
@@ -289,7 +287,7 @@
         int aSign = 1;
         int bSign = 1;        
         BigInteger aNumber = new BigInteger(aSign, aBytes);
-        Object bNumber = (Object)new BigInteger(bSign, bBytes);
+        Object bNumber = new BigInteger(bSign, bBytes);
         assertFalse(aNumber.equals(bNumber));
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConstructorsTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConstructorsTest.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConstructorsTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerConstructorsTest.java Sun Oct  1 15:31:42 2006
@@ -38,7 +38,7 @@
     public void testConstructorBytesException() {
         byte aBytes[] = {};
         try {
-            BigInteger aNumber = new BigInteger(aBytes);
+            new BigInteger(aBytes);
             fail("NumberFormatException has not been caught");
         } catch (NumberFormatException e) {
             assertEquals("Improper exception message", "Zero length BigInteger", e.getMessage());
@@ -196,7 +196,7 @@
         byte aBytes[] = {123, 45, -3, -76};
         int aSign = 3;
         try {
-            BigInteger aNumber = new BigInteger(aSign, aBytes);
+            new BigInteger(aSign, aBytes);
             fail("NumberFormatException has not been caught");
         } catch (NumberFormatException e) {
             assertEquals("Improper exception message", "Invalid signum value", e.getMessage());
@@ -211,7 +211,7 @@
         byte aBytes[] = {123, 45, -3, -76};
         int aSign = 0;
         try {
-            BigInteger aNumber = new BigInteger(aSign, aBytes);
+            new BigInteger(aSign, aBytes);
             fail("NumberFormatException has not been caught");
         } catch (NumberFormatException e) {
             assertEquals("Improper exception message", "signum-magnitude mismatch", e.getMessage());
@@ -578,7 +578,7 @@
         String value = "9234853876401";
         int radix = 45;
         try {
-            BigInteger aNumber = new BigInteger(value, radix);
+            new BigInteger(value, radix);
             fail("NumberFormatException has not been caught");
         } catch (NumberFormatException e) {
             assertEquals("Improper exception message", "Radix out of range", e.getMessage());
@@ -593,7 +593,7 @@
         String value = "   9234853876401";
         int radix = 10;
         try {
-            BigInteger aNumber = new BigInteger(value, radix);
+            new BigInteger(value, radix);
             fail("NumberFormatException has not been caught");
         } catch (NumberFormatException e) {
         }
@@ -607,7 +607,7 @@
         String value = "92348$*#78987";
         int radix = 34;
         try {
-            BigInteger aNumber = new BigInteger(value, radix);
+            new BigInteger(value, radix);
             fail("NumberFormatException has not been caught");
         } catch (NumberFormatException e) {
         }
@@ -621,7 +621,7 @@
         String value = "98zv765hdsaiy";
         int radix = 20;
         try {
-            BigInteger aNumber = new BigInteger(value, radix);
+            new BigInteger(value, radix);
             fail("NumberFormatException has not been caught");
         } catch (NumberFormatException e) {
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerDivideTest.java Sun Oct  1 15:31:42 2006
@@ -40,7 +40,7 @@
         BigInteger aNumber = new BigInteger(aSign, aBytes);
         BigInteger bNumber = new BigInteger(bSign, bBytes);
         try {
-            BigInteger result = aNumber.divide(bNumber);
+            aNumber.divide(bNumber);
             fail("ArithmeticException has not been caught");
         } catch (ArithmeticException e) {
             assertEquals("Improper exception message", "BigInteger divide by zero", e.getMessage());
@@ -56,7 +56,7 @@
         BigInteger aNumber = new BigInteger(aSign, aBytes);
         BigInteger bNumber = BigInteger.ZERO;
         try {
-            BigInteger result = aNumber.divide(bNumber);
+            aNumber.divide(bNumber);
             fail("ArithmeticException has not been caught");
         } catch (ArithmeticException e) {
             assertEquals("Improper exception message", "BigInteger divide by zero", e.getMessage());
@@ -409,7 +409,7 @@
         BigInteger aNumber = new BigInteger(aSign, aBytes);
         BigInteger bNumber = new BigInteger(bSign, bBytes);
         try {
-            BigInteger result = aNumber.remainder(bNumber);
+            aNumber.remainder(bNumber);
             fail("ArithmeticException has not been caught");
         } catch (ArithmeticException e) {
             assertEquals("Improper exception message", "BigInteger divide by zero", e.getMessage());
@@ -622,7 +622,7 @@
         BigInteger aNumber = new BigInteger(aSign, aBytes);
         BigInteger bNumber = new BigInteger(bSign, bBytes);
         try {
-            BigInteger result = aNumber.mod(bNumber);
+            aNumber.mod(bNumber);
             fail("ArithmeticException has not been caught");
         } catch (ArithmeticException e) {
             assertEquals("Improper exception message", "BigInteger: modulus not positive", e.getMessage());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerHashCodeTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerHashCodeTest.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerHashCodeTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerHashCodeTest.java Sun Oct  1 15:31:42 2006
@@ -87,7 +87,6 @@
         byte aBytes[] = {56, 100, -2, -76, 98, 54, 19, 3, -15, 45, 89, -111, 69, 103, 8, -9};
         byte bBytes[] = {56, 100, -2, -76, 89, 45, 91, 3, -15, 45, 89, -111, 69, 103, 8, -9};
         int aSign = 1;
-        int bSign = 1;
         BigInteger aNumber = new BigInteger(aSign, aBytes);
         BigInteger bNumber = new BigInteger(aSign, bBytes);
         int code1 = aNumber.hashCode();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerModPowTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerModPowTest.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerModPowTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerModPowTest.java Sun Oct  1 15:31:42 2006
@@ -43,7 +43,7 @@
 		BigInteger exp = new BigInteger(eSign, eBytes);
 		BigInteger modulus = new BigInteger(mSign, mBytes);
 		try {
-			BigInteger result = aNumber.modPow(exp, modulus);
+			aNumber.modPow(exp, modulus);
 			fail("ArithmeticException has not been caught");
 		} catch (ArithmeticException e) {
 			assertEquals("Improper exception message", "BigInteger: modulus not positive", e.getMessage());
@@ -107,7 +107,7 @@
 		BigInteger aNumber = new BigInteger(aSign, aBytes);
 		BigInteger modulus = new BigInteger(mSign, mBytes);
 		try {
-			BigInteger result = aNumber.modInverse(modulus);
+			aNumber.modInverse(modulus);
 			fail("ArithmeticException has not been caught");
 		} catch (ArithmeticException e) {
 			assertEquals("Improper exception message", "BigInteger: modulus not positive", e.getMessage());
@@ -125,7 +125,7 @@
 		BigInteger aNumber = new BigInteger(aSign, aBytes);
 		BigInteger modulus = new BigInteger(mSign, mBytes);
 		try {
-			BigInteger result = aNumber.modInverse(modulus);
+			aNumber.modInverse(modulus);
 			fail("ArithmeticException has not been caught");
 		} catch (ArithmeticException e) {
 			assertEquals("Improper exception message", "BigInteger not invertible.", e.getMessage());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerMultiplyTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerMultiplyTest.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerMultiplyTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerMultiplyTest.java Sun Oct  1 15:31:42 2006
@@ -283,7 +283,7 @@
         int exp = -5;
         BigInteger aNumber = new BigInteger(aSign, aBytes);
         try {
-            BigInteger result = aNumber.pow(exp);
+            aNumber.pow(exp);
             fail("ArithmeticException has not been caught");
         } catch (ArithmeticException e) {
             assertEquals("Improper exception message", "Negative exponent", e.getMessage());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerOperateBitsTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerOperateBitsTest.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerOperateBitsTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigIntegerOperateBitsTest.java Sun Oct  1 15:31:42 2006
@@ -131,7 +131,7 @@
         int number = -7;
         BigInteger aNumber = new BigInteger(aSign, aBytes);
         try {
-            BigInteger result = aNumber.clearBit(number);
+            aNumber.clearBit(number);
             fail("ArithmeticException has not been caught");
         } catch (ArithmeticException e) {
             assertEquals("Improper exception message", "Negative bit address", e.getMessage());
@@ -438,7 +438,7 @@
         int number = -7;
         BigInteger aNumber = new BigInteger(aSign, aBytes);
         try {
-            BigInteger result = aNumber.flipBit(number);
+            aNumber.flipBit(number);
             fail("ArithmeticException has not been caught");
         } catch (ArithmeticException e) {
             assertEquals("Improper exception message", "Negative bit address", e.getMessage());
@@ -728,7 +728,7 @@
         int number = -7;
         BigInteger aNumber = new BigInteger(aSign, aBytes);
         try {
-            BigInteger result = aNumber.setBit(number);
+            aNumber.setBit(number);
             fail("ArithmeticException has not been caught");
         } catch (ArithmeticException e) {
             assertEquals("Improper exception message", "Negative bit address", e.getMessage());
@@ -1305,7 +1305,7 @@
         int number = -7;
         BigInteger aNumber = new BigInteger(aSign, aBytes);
         try {
-            boolean result = aNumber.testBit(number);
+            aNumber.testBit(number);
             fail("ArithmeticException has not been caught");
         } catch (ArithmeticException e) {
             assertEquals("Improper exception message", "Negative bit address", e.getMessage());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java?view=diff&rev=451829&r1=451828&r2=451829
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java Sun Oct  1 15:31:42 2006
@@ -113,7 +113,6 @@
 	 * @tests java.math.BigDecimal#BigDecimal(java.lang.String)
 	 */
 	public void test_constructor_String_empty() {
-		boolean gotNFE = false;
 		try {
 			new BigDecimal("");			
             fail("NumberFormatException expected");



Mime
View raw message