--- old/test/java/lang/Math/Tests.java 2014-08-15 13:26:19.000000000 +0800 +++ new/test/java/lang/Math/Tests.java 2014-08-15 13:26:18.000000000 +0800 @@ -30,8 +30,8 @@ * and finally the expected result. */ -import sun.misc.FloatConsts; -import sun.misc.DoubleConsts; +import jdk.testlibrary.DoubleUtils; +import jdk.testlibrary.FloatUtils; public class Tests { private Tests(){}; // do not instantiate @@ -81,13 +81,13 @@ int exponent = Math.getExponent(d); switch (exponent) { - case DoubleConsts.MAX_EXPONENT+1: // NaN or infinity + case Double.MAX_EXPONENT+1: // NaN or infinity if( Double.isNaN(d) ) return (1<<30); // 2^30 else // infinite value return (1<<28); // 2^28 - case DoubleConsts.MIN_EXPONENT-1: // zero or subnormal + case Double.MIN_EXPONENT-1: // zero or subnormal if(d == 0.0) { return -(1<<28); // -(2^28) } @@ -103,7 +103,7 @@ */ // isolate significand bits - transducer &= DoubleConsts.SIGNIF_BIT_MASK; + transducer &= DoubleUtils.SIGNIF_BIT_MASK; assert(transducer != 0L); // This loop is simple and functional. We might be @@ -111,20 +111,20 @@ // e.g. number of leading zero detection on // (transducer << (# exponent and sign bits). while (transducer < - (1L << (DoubleConsts.SIGNIFICAND_WIDTH - 1))) { + (1L << (DoubleUtils.SIGNIFICAND_WIDTH - 1))) { transducer *= 2; exponent--; } exponent++; assert( exponent >= - DoubleConsts.MIN_EXPONENT - (DoubleConsts.SIGNIFICAND_WIDTH-1) && - exponent < DoubleConsts.MIN_EXPONENT); + Double.MIN_EXPONENT - (DoubleUtils.SIGNIFICAND_WIDTH-1) && + exponent < Double.MIN_EXPONENT); return exponent; } default: - assert( exponent >= DoubleConsts.MIN_EXPONENT && - exponent <= DoubleConsts.MAX_EXPONENT); + assert( exponent >= Double.MIN_EXPONENT && + exponent <= Double.MAX_EXPONENT); return exponent; } } @@ -150,13 +150,13 @@ int exponent = Math.getExponent(f); switch (exponent) { - case FloatConsts.MAX_EXPONENT+1: // NaN or infinity + case Float.MAX_EXPONENT+1: // NaN or infinity if( Float.isNaN(f) ) return (1<<30); // 2^30 else // infinite value return (1<<28); // 2^28 - case FloatConsts.MIN_EXPONENT-1: // zero or subnormal + case Float.MIN_EXPONENT-1: // zero or subnormal if(f == 0.0f) { return -(1<<28); // -(2^28) } @@ -172,7 +172,7 @@ */ // isolate significand bits - transducer &= FloatConsts.SIGNIF_BIT_MASK; + transducer &= FloatUtils.SIGNIF_BIT_MASK; assert(transducer != 0); // This loop is simple and functional. We might be @@ -180,20 +180,20 @@ // e.g. number of leading zero detection on // (transducer << (# exponent and sign bits). while (transducer < - (1 << (FloatConsts.SIGNIFICAND_WIDTH - 1))) { + (1 << (FloatUtils.SIGNIFICAND_WIDTH - 1))) { transducer *= 2; exponent--; } exponent++; assert( exponent >= - FloatConsts.MIN_EXPONENT - (FloatConsts.SIGNIFICAND_WIDTH-1) && - exponent < FloatConsts.MIN_EXPONENT); + Float.MIN_EXPONENT - (FloatUtils.SIGNIFICAND_WIDTH-1) && + exponent < Float.MIN_EXPONENT); return exponent; } default: - assert( exponent >= FloatConsts.MIN_EXPONENT && - exponent <= FloatConsts.MAX_EXPONENT); + assert( exponent >= Float.MIN_EXPONENT && + exponent <= Float.MAX_EXPONENT); return exponent; } }