1.1 --- a/emul/src/main/java/java/lang/Class.java Sun Sep 30 17:42:21 2012 -0700
1.2 +++ b/emul/src/main/java/java/lang/Class.java Sun Sep 30 18:29:37 2012 -0700
1.3 @@ -709,7 +709,7 @@
1.4 throw new UnsupportedOperationException();
1.5 }
1.6
1.7 - static Class<?> getPrimitiveClass(String type) {
1.8 + static Class getPrimitiveClass(String type) {
1.9 throw new UnsupportedOperationException();
1.10 }
1.11 }
2.1 --- a/emul/src/main/java/java/lang/Double.java Sun Sep 30 17:42:21 2012 -0700
2.2 +++ b/emul/src/main/java/java/lang/Double.java Sun Sep 30 18:29:37 2012 -0700
2.3 @@ -25,10 +25,6 @@
2.4
2.5 package java.lang;
2.6
2.7 -import sun.misc.FloatingDecimal;
2.8 -import sun.misc.FpUtils;
2.9 -import sun.misc.DoubleConsts;
2.10 -
2.11 /**
2.12 * The {@code Double} class wraps a value of the primitive type
2.13 * {@code double} in an object. An object of type
2.14 @@ -193,7 +189,7 @@
2.15 * @return a string representation of the argument.
2.16 */
2.17 public static String toString(double d) {
2.18 - return new FloatingDecimal(d).toJavaFormatString();
2.19 + throw new UnsupportedOperationException();
2.20 }
2.21
2.22 /**
2.23 @@ -271,61 +267,62 @@
2.24 * @author Joseph D. Darcy
2.25 */
2.26 public static String toHexString(double d) {
2.27 - /*
2.28 - * Modeled after the "a" conversion specifier in C99, section
2.29 - * 7.19.6.1; however, the output of this method is more
2.30 - * tightly specified.
2.31 - */
2.32 - if (!FpUtils.isFinite(d) )
2.33 - // For infinity and NaN, use the decimal output.
2.34 - return Double.toString(d);
2.35 - else {
2.36 - // Initialized to maximum size of output.
2.37 - StringBuffer answer = new StringBuffer(24);
2.38 -
2.39 - if (FpUtils.rawCopySign(1.0, d) == -1.0) // value is negative,
2.40 - answer.append("-"); // so append sign info
2.41 -
2.42 - answer.append("0x");
2.43 -
2.44 - d = Math.abs(d);
2.45 -
2.46 - if(d == 0.0) {
2.47 - answer.append("0.0p0");
2.48 - }
2.49 - else {
2.50 - boolean subnormal = (d < DoubleConsts.MIN_NORMAL);
2.51 -
2.52 - // Isolate significand bits and OR in a high-order bit
2.53 - // so that the string representation has a known
2.54 - // length.
2.55 - long signifBits = (Double.doubleToLongBits(d)
2.56 - & DoubleConsts.SIGNIF_BIT_MASK) |
2.57 - 0x1000000000000000L;
2.58 -
2.59 - // Subnormal values have a 0 implicit bit; normal
2.60 - // values have a 1 implicit bit.
2.61 - answer.append(subnormal ? "0." : "1.");
2.62 -
2.63 - // Isolate the low-order 13 digits of the hex
2.64 - // representation. If all the digits are zero,
2.65 - // replace with a single 0; otherwise, remove all
2.66 - // trailing zeros.
2.67 - String signif = Long.toHexString(signifBits).substring(3,16);
2.68 - answer.append(signif.equals("0000000000000") ? // 13 zeros
2.69 - "0":
2.70 - signif.replaceFirst("0{1,12}$", ""));
2.71 -
2.72 - // If the value is subnormal, use the E_min exponent
2.73 - // value for double; otherwise, extract and report d's
2.74 - // exponent (the representation of a subnormal uses
2.75 - // E_min -1).
2.76 - answer.append("p" + (subnormal ?
2.77 - DoubleConsts.MIN_EXPONENT:
2.78 - FpUtils.getExponent(d) ));
2.79 - }
2.80 - return answer.toString();
2.81 - }
2.82 + throw new UnsupportedOperationException();
2.83 +// /*
2.84 +// * Modeled after the "a" conversion specifier in C99, section
2.85 +// * 7.19.6.1; however, the output of this method is more
2.86 +// * tightly specified.
2.87 +// */
2.88 +// if (!FpUtils.isFinite(d) )
2.89 +// // For infinity and NaN, use the decimal output.
2.90 +// return Double.toString(d);
2.91 +// else {
2.92 +// // Initialized to maximum size of output.
2.93 +// StringBuffer answer = new StringBuffer(24);
2.94 +//
2.95 +// if (FpUtils.rawCopySign(1.0, d) == -1.0) // value is negative,
2.96 +// answer.append("-"); // so append sign info
2.97 +//
2.98 +// answer.append("0x");
2.99 +//
2.100 +// d = Math.abs(d);
2.101 +//
2.102 +// if(d == 0.0) {
2.103 +// answer.append("0.0p0");
2.104 +// }
2.105 +// else {
2.106 +// boolean subnormal = (d < DoubleConsts.MIN_NORMAL);
2.107 +//
2.108 +// // Isolate significand bits and OR in a high-order bit
2.109 +// // so that the string representation has a known
2.110 +// // length.
2.111 +// long signifBits = (Double.doubleToLongBits(d)
2.112 +// & DoubleConsts.SIGNIF_BIT_MASK) |
2.113 +// 0x1000000000000000L;
2.114 +//
2.115 +// // Subnormal values have a 0 implicit bit; normal
2.116 +// // values have a 1 implicit bit.
2.117 +// answer.append(subnormal ? "0." : "1.");
2.118 +//
2.119 +// // Isolate the low-order 13 digits of the hex
2.120 +// // representation. If all the digits are zero,
2.121 +// // replace with a single 0; otherwise, remove all
2.122 +// // trailing zeros.
2.123 +// String signif = Long.toHexString(signifBits).substring(3,16);
2.124 +// answer.append(signif.equals("0000000000000") ? // 13 zeros
2.125 +// "0":
2.126 +// signif.replaceFirst("0{1,12}$", ""));
2.127 +//
2.128 +// // If the value is subnormal, use the E_min exponent
2.129 +// // value for double; otherwise, extract and report d's
2.130 +// // exponent (the representation of a subnormal uses
2.131 +// // E_min -1).
2.132 +// answer.append("p" + (subnormal ?
2.133 +// DoubleConsts.MIN_EXPONENT:
2.134 +// FpUtils.getExponent(d) ));
2.135 +// }
2.136 +// return answer.toString();
2.137 +// }
2.138 }
2.139
2.140 /**
2.141 @@ -501,7 +498,8 @@
2.142 * parsable number.
2.143 */
2.144 public static Double valueOf(String s) throws NumberFormatException {
2.145 - return new Double(FloatingDecimal.readJavaFormatString(s).doubleValue());
2.146 + throw new UnsupportedOperationException();
2.147 +// return new Double(FloatingDecimal.readJavaFormatString(s).doubleValue());
2.148 }
2.149
2.150 /**
2.151 @@ -537,7 +535,8 @@
2.152 * @since 1.2
2.153 */
2.154 public static double parseDouble(String s) throws NumberFormatException {
2.155 - return FloatingDecimal.readJavaFormatString(s).doubleValue();
2.156 + throw new UnsupportedOperationException();
2.157 +// return FloatingDecimal.readJavaFormatString(s).doubleValue();
2.158 }
2.159
2.160 /**
2.161 @@ -805,14 +804,15 @@
2.162 * @return the bits that represent the floating-point number.
2.163 */
2.164 public static long doubleToLongBits(double value) {
2.165 - long result = doubleToRawLongBits(value);
2.166 - // Check for NaN based on values of bit fields, maximum
2.167 - // exponent and nonzero significand.
2.168 - if ( ((result & DoubleConsts.EXP_BIT_MASK) ==
2.169 - DoubleConsts.EXP_BIT_MASK) &&
2.170 - (result & DoubleConsts.SIGNIF_BIT_MASK) != 0L)
2.171 - result = 0x7ff8000000000000L;
2.172 - return result;
2.173 + throw new UnsupportedOperationException();
2.174 +// long result = doubleToRawLongBits(value);
2.175 +// // Check for NaN based on values of bit fields, maximum
2.176 +// // exponent and nonzero significand.
2.177 +// if ( ((result & DoubleConsts.EXP_BIT_MASK) ==
2.178 +// DoubleConsts.EXP_BIT_MASK) &&
2.179 +// (result & DoubleConsts.SIGNIF_BIT_MASK) != 0L)
2.180 +// result = 0x7ff8000000000000L;
2.181 +// return result;
2.182 }
2.183
2.184 /**
3.1 --- a/emul/src/main/java/java/lang/Enum.java Sun Sep 30 17:42:21 2012 -0700
3.2 +++ b/emul/src/main/java/java/lang/Enum.java Sun Sep 30 18:29:37 2012 -0700
3.3 @@ -27,9 +27,6 @@
3.4
3.5 import java.io.Serializable;
3.6 import java.io.IOException;
3.7 -import java.io.InvalidObjectException;
3.8 -import java.io.ObjectInputStream;
3.9 -import java.io.ObjectStreamException;
3.10
3.11 /**
3.12 * This is the common base class of all Java language enumeration types.
3.13 @@ -228,13 +225,14 @@
3.14 */
3.15 public static <T extends Enum<T>> T valueOf(Class<T> enumType,
3.16 String name) {
3.17 - T result = enumType.enumConstantDirectory().get(name);
3.18 - if (result != null)
3.19 - return result;
3.20 - if (name == null)
3.21 - throw new NullPointerException("Name is null");
3.22 - throw new IllegalArgumentException(
3.23 - "No enum constant " + enumType.getCanonicalName() + "." + name);
3.24 + throw new UnsupportedOperationException();
3.25 +// T result = enumType.enumConstantDirectory().get(name);
3.26 +// if (result != null)
3.27 +// return result;
3.28 +// if (name == null)
3.29 +// throw new NullPointerException("Name is null");
3.30 +// throw new IllegalArgumentException(
3.31 +// "No enum constant " + enumType.getCanonicalName() + "." + name);
3.32 }
3.33
3.34 /**
3.35 @@ -245,12 +243,12 @@
3.36 /**
3.37 * prevent default deserialization
3.38 */
3.39 - private void readObject(ObjectInputStream in) throws IOException,
3.40 - ClassNotFoundException {
3.41 - throw new InvalidObjectException("can't deserialize enum");
3.42 - }
3.43 -
3.44 - private void readObjectNoData() throws ObjectStreamException {
3.45 - throw new InvalidObjectException("can't deserialize enum");
3.46 - }
3.47 +// private void readObject(ObjectInputStream in) throws IOException,
3.48 +// ClassNotFoundException {
3.49 +// throw new InvalidObjectException("can't deserialize enum");
3.50 +// }
3.51 +//
3.52 +// private void readObjectNoData() throws ObjectStreamException {
3.53 +// throw new InvalidObjectException("can't deserialize enum");
3.54 +// }
3.55 }
4.1 --- a/emul/src/main/java/java/lang/Float.java Sun Sep 30 17:42:21 2012 -0700
4.2 +++ b/emul/src/main/java/java/lang/Float.java Sun Sep 30 18:29:37 2012 -0700
4.3 @@ -25,11 +25,6 @@
4.4
4.5 package java.lang;
4.6
4.7 -import sun.misc.FloatingDecimal;
4.8 -import sun.misc.FpUtils;
4.9 -import sun.misc.FloatConsts;
4.10 -import sun.misc.DoubleConsts;
4.11 -
4.12 /**
4.13 * The {@code Float} class wraps a value of primitive type
4.14 * {@code float} in an object. An object of type
4.15 @@ -196,7 +191,8 @@
4.16 * @return a string representation of the argument.
4.17 */
4.18 public static String toString(float f) {
4.19 - return new FloatingDecimal(f).toJavaFormatString();
4.20 + throw new UnsupportedOperationException();
4.21 +// return new FloatingDecimal(f).toJavaFormatString();
4.22 }
4.23
4.24 /**
4.25 @@ -274,19 +270,20 @@
4.26 * @author Joseph D. Darcy
4.27 */
4.28 public static String toHexString(float f) {
4.29 - if (Math.abs(f) < FloatConsts.MIN_NORMAL
4.30 - && f != 0.0f ) {// float subnormal
4.31 - // Adjust exponent to create subnormal double, then
4.32 - // replace subnormal double exponent with subnormal float
4.33 - // exponent
4.34 - String s = Double.toHexString(FpUtils.scalb((double)f,
4.35 - /* -1022+126 */
4.36 - DoubleConsts.MIN_EXPONENT-
4.37 - FloatConsts.MIN_EXPONENT));
4.38 - return s.replaceFirst("p-1022$", "p-126");
4.39 - }
4.40 - else // double string will be the same as float string
4.41 - return Double.toHexString(f);
4.42 + throw new UnsupportedOperationException();
4.43 +// if (Math.abs(f) < FloatConsts.MIN_NORMAL
4.44 +// && f != 0.0f ) {// float subnormal
4.45 +// // Adjust exponent to create subnormal double, then
4.46 +// // replace subnormal double exponent with subnormal float
4.47 +// // exponent
4.48 +// String s = Double.toHexString(FpUtils.scalb((double)f,
4.49 +// /* -1022+126 */
4.50 +// DoubleConsts.MIN_EXPONENT-
4.51 +// FloatConsts.MIN_EXPONENT));
4.52 +// return s.replaceFirst("p-1022$", "p-126");
4.53 +// }
4.54 +// else // double string will be the same as float string
4.55 +// return Double.toHexString(f);
4.56 }
4.57
4.58 /**
4.59 @@ -414,7 +411,8 @@
4.60 * parsable number.
4.61 */
4.62 public static Float valueOf(String s) throws NumberFormatException {
4.63 - return new Float(FloatingDecimal.readJavaFormatString(s).floatValue());
4.64 + throw new UnsupportedOperationException();
4.65 +// return new Float(FloatingDecimal.readJavaFormatString(s).floatValue());
4.66 }
4.67
4.68 /**
4.69 @@ -449,7 +447,8 @@
4.70 * @since 1.2
4.71 */
4.72 public static float parseFloat(String s) throws NumberFormatException {
4.73 - return FloatingDecimal.readJavaFormatString(s).floatValue();
4.74 + throw new UnsupportedOperationException();
4.75 +// return FloatingDecimal.readJavaFormatString(s).floatValue();
4.76 }
4.77
4.78 /**
4.79 @@ -710,14 +709,15 @@
4.80 * @return the bits that represent the floating-point number.
4.81 */
4.82 public static int floatToIntBits(float value) {
4.83 - int result = floatToRawIntBits(value);
4.84 - // Check for NaN based on values of bit fields, maximum
4.85 - // exponent and nonzero significand.
4.86 - if ( ((result & FloatConsts.EXP_BIT_MASK) ==
4.87 - FloatConsts.EXP_BIT_MASK) &&
4.88 - (result & FloatConsts.SIGNIF_BIT_MASK) != 0)
4.89 - result = 0x7fc00000;
4.90 - return result;
4.91 + throw new UnsupportedOperationException();
4.92 +// int result = floatToRawIntBits(value);
4.93 +// // Check for NaN based on values of bit fields, maximum
4.94 +// // exponent and nonzero significand.
4.95 +// if ( ((result & FloatConsts.EXP_BIT_MASK) ==
4.96 +// FloatConsts.EXP_BIT_MASK) &&
4.97 +// (result & FloatConsts.SIGNIF_BIT_MASK) != 0)
4.98 +// result = 0x7fc00000;
4.99 +// return result;
4.100 }
4.101
4.102 /**
5.1 --- a/emul/src/main/java/java/lang/Integer.java Sun Sep 30 17:42:21 2012 -0700
5.2 +++ b/emul/src/main/java/java/lang/Integer.java Sun Sep 30 18:29:37 2012 -0700
5.3 @@ -25,8 +25,6 @@
5.4
5.5 package java.lang;
5.6
5.7 -import java.util.Properties;
5.8 -
5.9 /**
5.10 * The {@code Integer} class wraps a value of the primitive type
5.11 * {@code int} in an object. An object of type {@code Integer}
5.12 @@ -602,7 +600,7 @@
5.13 // high value may be configured by property
5.14 int h = 127;
5.15 String integerCacheHighPropValue =
5.16 - sun.misc.VM.getSavedProperty("java.lang.Integer.IntegerCache.high");
5.17 + String.getProperty("java.lang.Integer.IntegerCache.high");
5.18 if (integerCacheHighPropValue != null) {
5.19 int i = parseInt(integerCacheHighPropValue);
5.20 i = Math.max(i, 127);
5.21 @@ -884,7 +882,7 @@
5.22 public static Integer getInteger(String nm, Integer val) {
5.23 String v = null;
5.24 try {
5.25 - v = System.getProperty(nm);
5.26 + v = String.getProperty(nm);
5.27 } catch (IllegalArgumentException e) {
5.28 } catch (NullPointerException e) {
5.29 }
6.1 --- a/emul/src/main/java/java/lang/Long.java Sun Sep 30 17:42:21 2012 -0700
6.2 +++ b/emul/src/main/java/java/lang/Long.java Sun Sep 30 18:29:37 2012 -0700
6.3 @@ -923,7 +923,7 @@
6.4 public static Long getLong(String nm, Long val) {
6.5 String v = null;
6.6 try {
6.7 - v = System.getProperty(nm);
6.8 + v = String.getProperty(nm);
6.9 } catch (IllegalArgumentException e) {
6.10 } catch (NullPointerException e) {
6.11 }
7.1 --- a/emul/src/main/java/java/lang/Math.java Sun Sep 30 17:42:21 2012 -0700
7.2 +++ b/emul/src/main/java/java/lang/Math.java Sun Sep 30 18:29:37 2012 -0700
7.3 @@ -24,7 +24,6 @@
7.4 */
7.5
7.6 package java.lang;
7.7 -import java.util.Random;
7.8
7.9
7.10 /**
7.11 @@ -680,12 +679,12 @@
7.12 return 0;
7.13 }
7.14
7.15 - private static Random randomNumberGenerator;
7.16 -
7.17 - private static synchronized Random initRNG() {
7.18 - Random rnd = randomNumberGenerator;
7.19 - return (rnd == null) ? (randomNumberGenerator = new Random()) : rnd;
7.20 - }
7.21 +// private static Random randomNumberGenerator;
7.22 +//
7.23 +// private static synchronized Random initRNG() {
7.24 +// Random rnd = randomNumberGenerator;
7.25 +// return (rnd == null) ? (randomNumberGenerator = new Random()) : rnd;
7.26 +// }
7.27
7.28 /**
7.29 * Returns a {@code double} value with a positive sign, greater
7.30 @@ -711,9 +710,7 @@
7.31 * @see Random#nextDouble()
7.32 */
7.33 public static double random() {
7.34 - Random rnd = randomNumberGenerator;
7.35 - if (rnd == null) rnd = initRNG();
7.36 - return rnd.nextDouble();
7.37 + throw new UnsupportedOperationException();
7.38 }
7.39
7.40 /**
7.41 @@ -962,9 +959,9 @@
7.42 * @author Joseph D. Darcy
7.43 * @since 1.5
7.44 */
7.45 - public static double ulp(double d) {
7.46 - return sun.misc.FpUtils.ulp(d);
7.47 - }
7.48 +// public static double ulp(double d) {
7.49 +// return sun.misc.FpUtils.ulp(d);
7.50 +// }
7.51
7.52 /**
7.53 * Returns the size of an ulp of the argument. An ulp of a
7.54 @@ -989,9 +986,9 @@
7.55 * @author Joseph D. Darcy
7.56 * @since 1.5
7.57 */
7.58 - public static float ulp(float f) {
7.59 - return sun.misc.FpUtils.ulp(f);
7.60 - }
7.61 +// public static float ulp(float f) {
7.62 +// return sun.misc.FpUtils.ulp(f);
7.63 +// }
7.64
7.65 /**
7.66 * Returns the signum function of the argument; zero if the argument
7.67 @@ -1010,9 +1007,9 @@
7.68 * @author Joseph D. Darcy
7.69 * @since 1.5
7.70 */
7.71 - public static double signum(double d) {
7.72 - return sun.misc.FpUtils.signum(d);
7.73 - }
7.74 +// public static double signum(double d) {
7.75 +// return sun.misc.FpUtils.signum(d);
7.76 +// }
7.77
7.78 /**
7.79 * Returns the signum function of the argument; zero if the argument
7.80 @@ -1031,9 +1028,9 @@
7.81 * @author Joseph D. Darcy
7.82 * @since 1.5
7.83 */
7.84 - public static float signum(float f) {
7.85 - return sun.misc.FpUtils.signum(f);
7.86 - }
7.87 +// public static float signum(float f) {
7.88 +// return sun.misc.FpUtils.signum(f);
7.89 +// }
7.90
7.91 /**
7.92 * Returns the hyperbolic sine of a {@code double} value.
7.93 @@ -1251,9 +1248,9 @@
7.94 * and the sign of {@code sign}.
7.95 * @since 1.6
7.96 */
7.97 - public static double copySign(double magnitude, double sign) {
7.98 - return sun.misc.FpUtils.rawCopySign(magnitude, sign);
7.99 - }
7.100 +// public static double copySign(double magnitude, double sign) {
7.101 +// return sun.misc.FpUtils.rawCopySign(magnitude, sign);
7.102 +// }
7.103
7.104 /**
7.105 * Returns the first floating-point argument with the sign of the
7.106 @@ -1270,9 +1267,9 @@
7.107 * and the sign of {@code sign}.
7.108 * @since 1.6
7.109 */
7.110 - public static float copySign(float magnitude, float sign) {
7.111 - return sun.misc.FpUtils.rawCopySign(magnitude, sign);
7.112 - }
7.113 +// public static float copySign(float magnitude, float sign) {
7.114 +// return sun.misc.FpUtils.rawCopySign(magnitude, sign);
7.115 +// }
7.116
7.117 /**
7.118 * Returns the unbiased exponent used in the representation of a
7.119 @@ -1288,9 +1285,9 @@
7.120 * @return the unbiased exponent of the argument
7.121 * @since 1.6
7.122 */
7.123 - public static int getExponent(float f) {
7.124 - return sun.misc.FpUtils.getExponent(f);
7.125 - }
7.126 +// public static int getExponent(float f) {
7.127 +// return sun.misc.FpUtils.getExponent(f);
7.128 +// }
7.129
7.130 /**
7.131 * Returns the unbiased exponent used in the representation of a
7.132 @@ -1306,9 +1303,9 @@
7.133 * @return the unbiased exponent of the argument
7.134 * @since 1.6
7.135 */
7.136 - public static int getExponent(double d) {
7.137 - return sun.misc.FpUtils.getExponent(d);
7.138 - }
7.139 +// public static int getExponent(double d) {
7.140 +// return sun.misc.FpUtils.getExponent(d);
7.141 +// }
7.142
7.143 /**
7.144 * Returns the floating-point number adjacent to the first
7.145 @@ -1350,9 +1347,9 @@
7.146 * direction of {@code direction}.
7.147 * @since 1.6
7.148 */
7.149 - public static double nextAfter(double start, double direction) {
7.150 - return sun.misc.FpUtils.nextAfter(start, direction);
7.151 - }
7.152 +// public static double nextAfter(double start, double direction) {
7.153 +// return sun.misc.FpUtils.nextAfter(start, direction);
7.154 +// }
7.155
7.156 /**
7.157 * Returns the floating-point number adjacent to the first
7.158 @@ -1393,9 +1390,9 @@
7.159 * direction of {@code direction}.
7.160 * @since 1.6
7.161 */
7.162 - public static float nextAfter(float start, double direction) {
7.163 - return sun.misc.FpUtils.nextAfter(start, direction);
7.164 - }
7.165 +// public static float nextAfter(float start, double direction) {
7.166 +// return sun.misc.FpUtils.nextAfter(start, direction);
7.167 +// }
7.168
7.169 /**
7.170 * Returns the floating-point value adjacent to {@code d} in
7.171 @@ -1422,9 +1419,9 @@
7.172 * infinity.
7.173 * @since 1.6
7.174 */
7.175 - public static double nextUp(double d) {
7.176 - return sun.misc.FpUtils.nextUp(d);
7.177 - }
7.178 +// public static double nextUp(double d) {
7.179 +// return sun.misc.FpUtils.nextUp(d);
7.180 +// }
7.181
7.182 /**
7.183 * Returns the floating-point value adjacent to {@code f} in
7.184 @@ -1451,9 +1448,9 @@
7.185 * infinity.
7.186 * @since 1.6
7.187 */
7.188 - public static float nextUp(float f) {
7.189 - return sun.misc.FpUtils.nextUp(f);
7.190 - }
7.191 +// public static float nextUp(float f) {
7.192 +// return sun.misc.FpUtils.nextUp(f);
7.193 +// }
7.194
7.195
7.196 /**
7.197 @@ -1486,9 +1483,9 @@
7.198 * @return {@code d} × 2<sup>{@code scaleFactor}</sup>
7.199 * @since 1.6
7.200 */
7.201 - public static double scalb(double d, int scaleFactor) {
7.202 - return sun.misc.FpUtils.scalb(d, scaleFactor);
7.203 - }
7.204 +// public static double scalb(double d, int scaleFactor) {
7.205 +// return sun.misc.FpUtils.scalb(d, scaleFactor);
7.206 +// }
7.207
7.208 /**
7.209 * Return {@code f} ×
7.210 @@ -1520,7 +1517,7 @@
7.211 * @return {@code f} × 2<sup>{@code scaleFactor}</sup>
7.212 * @since 1.6
7.213 */
7.214 - public static float scalb(float f, int scaleFactor) {
7.215 - return sun.misc.FpUtils.scalb(f, scaleFactor);
7.216 - }
7.217 +// public static float scalb(float f, int scaleFactor) {
7.218 +// return sun.misc.FpUtils.scalb(f, scaleFactor);
7.219 +// }
7.220 }
8.1 --- a/emul/src/main/java/java/lang/StrictMath.java Sun Sep 30 17:42:21 2012 -0700
8.2 +++ b/emul/src/main/java/java/lang/StrictMath.java Sun Sep 30 18:29:37 2012 -0700
8.3 @@ -24,9 +24,6 @@
8.4 */
8.5
8.6 package java.lang;
8.7 -import java.util.Random;
8.8 -import sun.misc.FpUtils;
8.9 -import sun.misc.DoubleConsts;
8.10
8.11 /**
8.12 * The class {@code StrictMath} contains methods for performing basic
8.13 @@ -352,7 +349,7 @@
8.14 double negativeBoundary,
8.15 double positiveBoundary,
8.16 double sign) {
8.17 - int exponent = Math.getExponent(a);
8.18 + int exponent = getExponent(a);
8.19
8.20 if (exponent < 0) {
8.21 /*
8.22 @@ -373,7 +370,7 @@
8.23 assert exponent >= 0 && exponent <= 51;
8.24
8.25 long doppel = Double.doubleToRawLongBits(a);
8.26 - long mask = DoubleConsts.SIGNIF_BIT_MASK >> exponent;
8.27 + long mask = 0; // DoubleConsts.SIGNIF_BIT_MASK >> exponent;
8.28
8.29 if ( (mask & doppel) == 0L )
8.30 return a; // integral value
8.31 @@ -402,6 +399,7 @@
8.32 * @author Joseph D. Darcy
8.33 */
8.34 public static double rint(double a) {
8.35 + throw new UnsupportedOperationException();
8.36 /*
8.37 * If the absolute value of a is not less than 2^52, it
8.38 * is either a finite integer (the double format does not have
8.39 @@ -427,15 +425,15 @@
8.40 * last multiply in the return statement is by plus or minus
8.41 * 1.0, which is exact too.
8.42 */
8.43 - double twoToThe52 = (double)(1L << 52); // 2^52
8.44 - double sign = FpUtils.rawCopySign(1.0, a); // preserve sign info
8.45 - a = Math.abs(a);
8.46 -
8.47 - if (a < twoToThe52) { // E_min <= ilogb(a) <= 51
8.48 - a = ((twoToThe52 + a ) - twoToThe52);
8.49 - }
8.50 -
8.51 - return sign * a; // restore original sign
8.52 +// double twoToThe52 = (double)(1L << 52); // 2^52
8.53 +// double sign = FpUtils.rawCopySign(1.0, a); // preserve sign info
8.54 +// a = Math.abs(a);
8.55 +//
8.56 +// if (a < twoToThe52) { // E_min <= ilogb(a) <= 51
8.57 +// a = ((twoToThe52 + a ) - twoToThe52);
8.58 +// }
8.59 +//
8.60 +// return sign * a; // restore original sign
8.61 }
8.62
8.63 /**
8.64 @@ -659,13 +657,6 @@
8.65 return Math.round(a);
8.66 }
8.67
8.68 - private static Random randomNumberGenerator;
8.69 -
8.70 - private static synchronized Random initRNG() {
8.71 - Random rnd = randomNumberGenerator;
8.72 - return (rnd == null) ? (randomNumberGenerator = new Random()) : rnd;
8.73 - }
8.74 -
8.75 /**
8.76 * Returns a {@code double} value with a positive sign, greater
8.77 * than or equal to {@code 0.0} and less than {@code 1.0}.
8.78 @@ -690,9 +681,7 @@
8.79 * @see Random#nextDouble()
8.80 */
8.81 public static double random() {
8.82 - Random rnd = randomNumberGenerator;
8.83 - if (rnd == null) rnd = initRNG();
8.84 - return rnd.nextDouble();
8.85 + throw new UnsupportedOperationException();
8.86 }
8.87
8.88 /**
8.89 @@ -955,7 +944,7 @@
8.90 * @since 1.5
8.91 */
8.92 public static double ulp(double d) {
8.93 - return sun.misc.FpUtils.ulp(d);
8.94 + throw new UnsupportedOperationException();
8.95 }
8.96
8.97 /**
8.98 @@ -982,7 +971,7 @@
8.99 * @since 1.5
8.100 */
8.101 public static float ulp(float f) {
8.102 - return sun.misc.FpUtils.ulp(f);
8.103 + throw new UnsupportedOperationException();
8.104 }
8.105
8.106 /**
8.107 @@ -1003,7 +992,7 @@
8.108 * @since 1.5
8.109 */
8.110 public static double signum(double d) {
8.111 - return sun.misc.FpUtils.signum(d);
8.112 + throw new UnsupportedOperationException();
8.113 }
8.114
8.115 /**
8.116 @@ -1024,7 +1013,7 @@
8.117 * @since 1.5
8.118 */
8.119 public static float signum(float f) {
8.120 - return sun.misc.FpUtils.signum(f);
8.121 + throw new UnsupportedOperationException();
8.122 }
8.123
8.124 /**
8.125 @@ -1202,7 +1191,7 @@
8.126 * @since 1.6
8.127 */
8.128 public static double copySign(double magnitude, double sign) {
8.129 - return sun.misc.FpUtils.copySign(magnitude, sign);
8.130 + throw new UnsupportedOperationException();
8.131 }
8.132
8.133 /**
8.134 @@ -1218,7 +1207,7 @@
8.135 * @since 1.6
8.136 */
8.137 public static float copySign(float magnitude, float sign) {
8.138 - return sun.misc.FpUtils.copySign(magnitude, sign);
8.139 + throw new UnsupportedOperationException();
8.140 }
8.141 /**
8.142 * Returns the unbiased exponent used in the representation of a
8.143 @@ -1234,7 +1223,7 @@
8.144 * @since 1.6
8.145 */
8.146 public static int getExponent(float f) {
8.147 - return sun.misc.FpUtils.getExponent(f);
8.148 + throw new UnsupportedOperationException();
8.149 }
8.150
8.151 /**
8.152 @@ -1251,7 +1240,7 @@
8.153 * @since 1.6
8.154 */
8.155 public static int getExponent(double d) {
8.156 - return sun.misc.FpUtils.getExponent(d);
8.157 + throw new UnsupportedOperationException();
8.158 }
8.159
8.160 /**
8.161 @@ -1294,7 +1283,7 @@
8.162 * @since 1.6
8.163 */
8.164 public static double nextAfter(double start, double direction) {
8.165 - return sun.misc.FpUtils.nextAfter(start, direction);
8.166 + throw new UnsupportedOperationException();
8.167 }
8.168
8.169 /**
8.170 @@ -1336,7 +1325,7 @@
8.171 * @since 1.6
8.172 */
8.173 public static float nextAfter(float start, double direction) {
8.174 - return sun.misc.FpUtils.nextAfter(start, direction);
8.175 + throw new UnsupportedOperationException();
8.176 }
8.177
8.178 /**
8.179 @@ -1365,7 +1354,7 @@
8.180 * @since 1.6
8.181 */
8.182 public static double nextUp(double d) {
8.183 - return sun.misc.FpUtils.nextUp(d);
8.184 + throw new UnsupportedOperationException();
8.185 }
8.186
8.187 /**
8.188 @@ -1394,7 +1383,7 @@
8.189 * @since 1.6
8.190 */
8.191 public static float nextUp(float f) {
8.192 - return sun.misc.FpUtils.nextUp(f);
8.193 + throw new UnsupportedOperationException();
8.194 }
8.195
8.196
8.197 @@ -1429,7 +1418,7 @@
8.198 * @since 1.6
8.199 */
8.200 public static double scalb(double d, int scaleFactor) {
8.201 - return sun.misc.FpUtils.scalb(d, scaleFactor);
8.202 + throw new UnsupportedOperationException();
8.203 }
8.204
8.205 /**
8.206 @@ -1463,6 +1452,6 @@
8.207 * @since 1.6
8.208 */
8.209 public static float scalb(float f, int scaleFactor) {
8.210 - return sun.misc.FpUtils.scalb(f, scaleFactor);
8.211 + throw new UnsupportedOperationException();
8.212 }
8.213 }
9.1 --- a/emul/src/main/java/java/lang/String.java Sun Sep 30 17:42:21 2012 -0700
9.2 +++ b/emul/src/main/java/java/lang/String.java Sun Sep 30 18:29:37 2012 -0700
9.3 @@ -3054,5 +3054,8 @@
9.4 dst[dstBegin++] = value[srcBegin++];
9.5 }
9.6 }
9.7 -
9.8 + // access system property
9.9 + static String getProperty(String nm) {
9.10 + return null;
9.11 + }
9.12 }