From 7e4d56677d48e02d2df999ed6105cc7566c03455 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Tue, 22 Dec 2015 12:17:25 +0000 Subject: [PATCH] 8145990: Move sun.misc math support classes to jdk.internal.math Reviewed-by: bpb, darcy --- .../classes/java/lang/AbstractStringBuilder.java | 2 +- .../share/classes/java/lang/Double.java | 4 ++-- .../java.base/share/classes/java/lang/Float.java | 6 +++--- .../java.base/share/classes/java/lang/Math.java | 4 ++-- .../share/classes/java/lang/StrictMath.java | 2 +- .../share/classes/java/math/BigInteger.java | 4 ++-- .../share/classes/java/text/DigitList.java | 2 +- .../share/classes/java/util/Formatter.java | 4 ++-- .../misc => jdk/internal/math}/DoubleConsts.java | 2 +- .../misc => jdk/internal/math}/FDBigInteger.java | 2 +- .../misc => jdk/internal/math}/FloatConsts.java | 2 +- .../internal/math}/FloatingDecimal.java | 2 +- .../internal/math}/FormattedFloatingDecimal.java | 2 +- .../classes/sun/java2d/marlin/FloatMath.java | 4 ++-- .../java/util/Formatter/Basic-X.java.template | 2 +- jdk/test/java/util/Formatter/Basic.java | 2 +- jdk/test/java/util/Formatter/BasicDouble.java | 6 +++++- .../FloatingDecimal/OldFDBigIntForTest.java | 2 +- .../OldFloatingDecimalForTest.java | 2 +- .../math}/FloatingDecimal/TestFDBigInteger.java | 6 +++--- .../FloatingDecimal/TestFloatingDecimal.java | 16 ++++++++-------- 21 files changed, 41 insertions(+), 37 deletions(-) rename jdk/src/java.base/share/classes/{sun/misc => jdk/internal/math}/DoubleConsts.java (99%) rename jdk/src/java.base/share/classes/{sun/misc => jdk/internal/math}/FDBigInteger.java (99%) rename jdk/src/java.base/share/classes/{sun/misc => jdk/internal/math}/FloatConsts.java (99%) rename jdk/src/java.base/share/classes/{sun/misc => jdk/internal/math}/FloatingDecimal.java (99%) rename jdk/src/java.base/share/classes/{sun/misc => jdk/internal/math}/FormattedFloatingDecimal.java (99%) rename jdk/test/{sun/misc => jdk/internal/math}/FloatingDecimal/OldFDBigIntForTest.java (99%) rename jdk/test/{sun/misc => jdk/internal/math}/FloatingDecimal/OldFloatingDecimalForTest.java (99%) rename jdk/test/{sun/misc => jdk/internal/math}/FloatingDecimal/TestFDBigInteger.java (99%) rename jdk/test/{sun/misc => jdk/internal/math}/FloatingDecimal/TestFloatingDecimal.java (96%) diff --git a/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java b/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java index 975c806bc81..619b7de278a 100644 --- a/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java +++ b/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java @@ -25,7 +25,7 @@ package java.lang; -import sun.misc.FloatingDecimal; +import jdk.internal.math.FloatingDecimal; import java.util.Arrays; import java.util.Spliterator; import java.util.stream.IntStream; diff --git a/jdk/src/java.base/share/classes/java/lang/Double.java b/jdk/src/java.base/share/classes/java/lang/Double.java index 88201873c36..f1389ebe0f8 100644 --- a/jdk/src/java.base/share/classes/java/lang/Double.java +++ b/jdk/src/java.base/share/classes/java/lang/Double.java @@ -25,8 +25,8 @@ package java.lang; -import sun.misc.FloatingDecimal; -import sun.misc.DoubleConsts; +import jdk.internal.math.FloatingDecimal; +import jdk.internal.math.DoubleConsts; import jdk.internal.HotSpotIntrinsicCandidate; /** diff --git a/jdk/src/java.base/share/classes/java/lang/Float.java b/jdk/src/java.base/share/classes/java/lang/Float.java index f9d3f9ef325..09eb63527ab 100644 --- a/jdk/src/java.base/share/classes/java/lang/Float.java +++ b/jdk/src/java.base/share/classes/java/lang/Float.java @@ -25,9 +25,9 @@ package java.lang; -import sun.misc.FloatingDecimal; -import sun.misc.FloatConsts; -import sun.misc.DoubleConsts; +import jdk.internal.math.FloatingDecimal; +import jdk.internal.math.FloatConsts; +import jdk.internal.math.DoubleConsts; import jdk.internal.HotSpotIntrinsicCandidate; /** diff --git a/jdk/src/java.base/share/classes/java/lang/Math.java b/jdk/src/java.base/share/classes/java/lang/Math.java index 1cd32bd3839..ddb953225a8 100644 --- a/jdk/src/java.base/share/classes/java/lang/Math.java +++ b/jdk/src/java.base/share/classes/java/lang/Math.java @@ -26,8 +26,8 @@ package java.lang; import java.util.Random; -import sun.misc.FloatConsts; -import sun.misc.DoubleConsts; +import jdk.internal.math.FloatConsts; +import jdk.internal.math.DoubleConsts; import jdk.internal.HotSpotIntrinsicCandidate; /** diff --git a/jdk/src/java.base/share/classes/java/lang/StrictMath.java b/jdk/src/java.base/share/classes/java/lang/StrictMath.java index 68bba059786..0c82f6afbf5 100644 --- a/jdk/src/java.base/share/classes/java/lang/StrictMath.java +++ b/jdk/src/java.base/share/classes/java/lang/StrictMath.java @@ -26,7 +26,7 @@ package java.lang; import java.util.Random; -import sun.misc.DoubleConsts; +import jdk.internal.math.DoubleConsts; import jdk.internal.HotSpotIntrinsicCandidate; /** diff --git a/jdk/src/java.base/share/classes/java/math/BigInteger.java b/jdk/src/java.base/share/classes/java/math/BigInteger.java index 1c44659daf4..c77731b2418 100644 --- a/jdk/src/java.base/share/classes/java/math/BigInteger.java +++ b/jdk/src/java.base/share/classes/java/math/BigInteger.java @@ -38,8 +38,8 @@ import java.util.Objects; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; -import sun.misc.DoubleConsts; -import sun.misc.FloatConsts; +import jdk.internal.math.DoubleConsts; +import jdk.internal.math.FloatConsts; import jdk.internal.HotSpotIntrinsicCandidate; /** diff --git a/jdk/src/java.base/share/classes/java/text/DigitList.java b/jdk/src/java.base/share/classes/java/text/DigitList.java index 0b73543a9d4..708e3e64575 100644 --- a/jdk/src/java.base/share/classes/java/text/DigitList.java +++ b/jdk/src/java.base/share/classes/java/text/DigitList.java @@ -41,7 +41,7 @@ package java.text; import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; -import sun.misc.FloatingDecimal; +import jdk.internal.math.FloatingDecimal; /** * Digit List. Private to DecimalFormat. diff --git a/jdk/src/java.base/share/classes/java/util/Formatter.java b/jdk/src/java.base/share/classes/java/util/Formatter.java index 0a3b50b6a13..c771ac1ba0c 100644 --- a/jdk/src/java.base/share/classes/java/util/Formatter.java +++ b/jdk/src/java.base/share/classes/java/util/Formatter.java @@ -60,8 +60,8 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalQueries; import java.time.temporal.UnsupportedTemporalTypeException; -import sun.misc.DoubleConsts; -import sun.misc.FormattedFloatingDecimal; +import jdk.internal.math.DoubleConsts; +import jdk.internal.math.FormattedFloatingDecimal; /** * An interpreter for printf-style format strings. This class provides support diff --git a/jdk/src/java.base/share/classes/sun/misc/DoubleConsts.java b/jdk/src/java.base/share/classes/jdk/internal/math/DoubleConsts.java similarity index 99% rename from jdk/src/java.base/share/classes/sun/misc/DoubleConsts.java rename to jdk/src/java.base/share/classes/jdk/internal/math/DoubleConsts.java index 6ee80490102..c0480e9d497 100644 --- a/jdk/src/java.base/share/classes/sun/misc/DoubleConsts.java +++ b/jdk/src/java.base/share/classes/jdk/internal/math/DoubleConsts.java @@ -23,7 +23,7 @@ * questions. */ -package sun.misc; +package jdk.internal.math; /** * This class contains additional constants documenting limits of the diff --git a/jdk/src/java.base/share/classes/sun/misc/FDBigInteger.java b/jdk/src/java.base/share/classes/jdk/internal/math/FDBigInteger.java similarity index 99% rename from jdk/src/java.base/share/classes/sun/misc/FDBigInteger.java rename to jdk/src/java.base/share/classes/jdk/internal/math/FDBigInteger.java index d25f2017f6a..ba3ce9b8287 100644 --- a/jdk/src/java.base/share/classes/sun/misc/FDBigInteger.java +++ b/jdk/src/java.base/share/classes/jdk/internal/math/FDBigInteger.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.misc; +package jdk.internal.math; import java.math.BigInteger; import java.util.Arrays; diff --git a/jdk/src/java.base/share/classes/sun/misc/FloatConsts.java b/jdk/src/java.base/share/classes/jdk/internal/math/FloatConsts.java similarity index 99% rename from jdk/src/java.base/share/classes/sun/misc/FloatConsts.java rename to jdk/src/java.base/share/classes/jdk/internal/math/FloatConsts.java index 07396f8bca9..977a222278b 100644 --- a/jdk/src/java.base/share/classes/sun/misc/FloatConsts.java +++ b/jdk/src/java.base/share/classes/jdk/internal/math/FloatConsts.java @@ -23,7 +23,7 @@ * questions. */ -package sun.misc; +package jdk.internal.math; /** * This class contains additional constants documenting limits of the diff --git a/jdk/src/java.base/share/classes/sun/misc/FloatingDecimal.java b/jdk/src/java.base/share/classes/jdk/internal/math/FloatingDecimal.java similarity index 99% rename from jdk/src/java.base/share/classes/sun/misc/FloatingDecimal.java rename to jdk/src/java.base/share/classes/jdk/internal/math/FloatingDecimal.java index 0c07520f13e..575255eb174 100644 --- a/jdk/src/java.base/share/classes/sun/misc/FloatingDecimal.java +++ b/jdk/src/java.base/share/classes/jdk/internal/math/FloatingDecimal.java @@ -23,7 +23,7 @@ * questions. */ -package sun.misc; +package jdk.internal.math; import java.util.Arrays; import java.util.regex.*; diff --git a/jdk/src/java.base/share/classes/sun/misc/FormattedFloatingDecimal.java b/jdk/src/java.base/share/classes/jdk/internal/math/FormattedFloatingDecimal.java similarity index 99% rename from jdk/src/java.base/share/classes/sun/misc/FormattedFloatingDecimal.java rename to jdk/src/java.base/share/classes/jdk/internal/math/FormattedFloatingDecimal.java index fc53920e398..0a560dc11e5 100644 --- a/jdk/src/java.base/share/classes/sun/misc/FormattedFloatingDecimal.java +++ b/jdk/src/java.base/share/classes/jdk/internal/math/FormattedFloatingDecimal.java @@ -23,7 +23,7 @@ * questions. */ -package sun.misc; +package jdk.internal.math; import java.util.Arrays; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/FloatMath.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/FloatMath.java index d1ffc04b786..df6af52438c 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/FloatMath.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/FloatMath.java @@ -24,8 +24,8 @@ */ package sun.java2d.marlin; -import sun.misc.DoubleConsts; -import sun.misc.FloatConsts; +import jdk.internal.math.DoubleConsts; +import jdk.internal.math.FloatConsts; /** * Faster Math ceil / floor routines derived from StrictMath diff --git a/jdk/test/java/util/Formatter/Basic-X.java.template b/jdk/test/java/util/Formatter/Basic-X.java.template index 57d77ae887d..206c3e0d27f 100644 --- a/jdk/test/java/util/Formatter/Basic-X.java.template +++ b/jdk/test/java/util/Formatter/Basic-X.java.template @@ -36,7 +36,7 @@ import java.math.BigInteger; import java.text.DateFormatSymbols; import java.util.*; #if[double] -import sun.misc.DoubleConsts; +import jdk.internal.math.DoubleConsts; #end[double] import static java.util.Calendar.*; diff --git a/jdk/test/java/util/Formatter/Basic.java b/jdk/test/java/util/Formatter/Basic.java index 4287f1bc2d8..8fb2e1de3a1 100644 --- a/jdk/test/java/util/Formatter/Basic.java +++ b/jdk/test/java/util/Formatter/Basic.java @@ -28,7 +28,7 @@ * 6344623 6369500 6534606 6282094 6286592 6476425 5063507 6469160 6476168 * 8059175 * - * @modules java.base/sun.misc + * @modules java.base/jdk.internal.math * @run shell/timeout=240 Basic.sh */ diff --git a/jdk/test/java/util/Formatter/BasicDouble.java b/jdk/test/java/util/Formatter/BasicDouble.java index 11760f17f7f..ba54d46be36 100644 --- a/jdk/test/java/util/Formatter/BasicDouble.java +++ b/jdk/test/java/util/Formatter/BasicDouble.java @@ -36,7 +36,7 @@ import java.math.BigInteger; import java.text.DateFormatSymbols; import java.util.*; -import sun.misc.DoubleConsts; +import jdk.internal.math.DoubleConsts; import static java.util.Calendar.*; @@ -1169,6 +1169,10 @@ public class BasicDouble extends Basic { + + + + diff --git a/jdk/test/sun/misc/FloatingDecimal/OldFDBigIntForTest.java b/jdk/test/jdk/internal/math/FloatingDecimal/OldFDBigIntForTest.java similarity index 99% rename from jdk/test/sun/misc/FloatingDecimal/OldFDBigIntForTest.java rename to jdk/test/jdk/internal/math/FloatingDecimal/OldFDBigIntForTest.java index a7082ba76bc..f500040a922 100644 --- a/jdk/test/sun/misc/FloatingDecimal/OldFDBigIntForTest.java +++ b/jdk/test/jdk/internal/math/FloatingDecimal/OldFDBigIntForTest.java @@ -21,7 +21,7 @@ * questions. */ -//package sun.misc; +//package jdk.internal.math; /* * A really, really simple bigint package diff --git a/jdk/test/sun/misc/FloatingDecimal/OldFloatingDecimalForTest.java b/jdk/test/jdk/internal/math/FloatingDecimal/OldFloatingDecimalForTest.java similarity index 99% rename from jdk/test/sun/misc/FloatingDecimal/OldFloatingDecimalForTest.java rename to jdk/test/jdk/internal/math/FloatingDecimal/OldFloatingDecimalForTest.java index 63bbbf5eb14..073f2655e3a 100644 --- a/jdk/test/sun/misc/FloatingDecimal/OldFloatingDecimalForTest.java +++ b/jdk/test/jdk/internal/math/FloatingDecimal/OldFloatingDecimalForTest.java @@ -21,7 +21,7 @@ * questions. */ -//package sun.misc; +//package jdk.internal.math; import java.util.regex.*; diff --git a/jdk/test/sun/misc/FloatingDecimal/TestFDBigInteger.java b/jdk/test/jdk/internal/math/FloatingDecimal/TestFDBigInteger.java similarity index 99% rename from jdk/test/sun/misc/FloatingDecimal/TestFDBigInteger.java rename to jdk/test/jdk/internal/math/FloatingDecimal/TestFDBigInteger.java index 983f5d78cee..9eb8cfe7844 100644 --- a/jdk/test/sun/misc/FloatingDecimal/TestFDBigInteger.java +++ b/jdk/test/jdk/internal/math/FloatingDecimal/TestFDBigInteger.java @@ -23,13 +23,13 @@ import java.math.BigInteger; import java.util.Random; -import sun.misc.FDBigInteger; +import jdk.internal.math.FDBigInteger; /** * @test * @bug 7032154 - * @summary unit testys of sun.misc.FDBigInteger - * @modules java.base/sun.misc + * @summary unit testys of FDBigInteger + * @modules java.base/jdk.internal.math * @author Dmitry Nadezhin */ public class TestFDBigInteger { diff --git a/jdk/test/sun/misc/FloatingDecimal/TestFloatingDecimal.java b/jdk/test/jdk/internal/math/FloatingDecimal/TestFloatingDecimal.java similarity index 96% rename from jdk/test/sun/misc/FloatingDecimal/TestFloatingDecimal.java rename to jdk/test/jdk/internal/math/FloatingDecimal/TestFloatingDecimal.java index 96806a9b708..5fcb5b52b04 100644 --- a/jdk/test/sun/misc/FloatingDecimal/TestFloatingDecimal.java +++ b/jdk/test/jdk/internal/math/FloatingDecimal/TestFloatingDecimal.java @@ -22,7 +22,7 @@ */ import java.util.Random; -import sun.misc.FloatingDecimal; +import jdk.internal.math.FloatingDecimal; /* OldFloatingDecimalForTest @@ -40,26 +40,26 @@ public class OldFloatingDecimalForTest { public strictfp float floatValue(); } -sun.misc.FloatingDecimal +jdk.internal.math.FloatingDecimal -public class sun.misc.FloatingDecimal { - public sun.misc.FloatingDecimal(); +public class jdk.internal.math.FloatingDecimal { + public jdk.internal.math.FloatingDecimal(); public static java.lang.String toJavaFormatString(double); public static java.lang.String toJavaFormatString(float); public static void appendTo(double, java.lang.Appendable); public static void appendTo(float, java.lang.Appendable); public static double parseDouble(java.lang.String) throws java.lang.NumberFormatException; public static float parseFloat(java.lang.String) throws java.lang.NumberFormatException; - public static sun.misc.FloatingDecimal$AbstractD2ABuffer getD2ABuffer(double); + public static jdk.internal.math.FloatingDecimal$AbstractD2ABuffer getD2ABuffer(double); } */ /** * @test * @bug 7032154 - * @summary unit tests of sun.misc.FloatingDecimal - * @modules java.base/sun.misc - * @library ../../../java/lang/Math + * @summary unit tests of FloatingDecimal + * @modules java.base/jdk.internal.math + * @library /java/lang/Math * @build DoubleConsts FloatConsts * @run main TestFloatingDecimal * @author Brian Burkhalter