changeset 4124:147da2c8b749

7039369: Limit range of strictfp in FloatingDecimal Summary: Additional reviews by sergey.kuksenko@oracle.com Reviewed-by: alanb
author darcy
date Tue, 26 Apr 2011 10:35:06 -0700
parents 8b36b1c4bb7f
children 0e0db3421e8f 5b05f8d1c0e5 37722a0a1c65
files src/share/classes/sun/misc/FloatingDecimal.java src/share/classes/sun/misc/FormattedFloatingDecimal.java test/java/lang/Double/ParseDouble.java
diffstat 3 files changed, 9 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/misc/FloatingDecimal.java	Tue Apr 26 12:49:34 2011 +0200
+++ b/src/share/classes/sun/misc/FloatingDecimal.java	Tue Apr 26 10:35:06 2011 -0700
@@ -30,7 +30,7 @@
 import sun.misc.FloatConsts;
 import java.util.regex.*;
 
-public strictfp class FloatingDecimal{
+public class FloatingDecimal{
     boolean     isExceptional;
     boolean     isNegative;
     int         decExponent;
@@ -239,8 +239,7 @@
      * More difficult if subtracting and the argument
      * is a normalized a power of 2, as the ULP changes at these points.
      */
-    private static double
-    ulp( double dval, boolean subtracting ){
+    private static double ulp( double dval, boolean subtracting ){
         long lbits = Double.doubleToLongBits( dval ) & ~signMask;
         int binexp = (int)(lbits >>> expShift);
         double ulpval;
@@ -1251,8 +1250,7 @@
      * for a single-precision float.
      */
 
-    public double
-    doubleValue(){
+    public strictfp double doubleValue(){
         int     kDigits = Math.min( nDigits, maxDecimalDigits+1 );
         long    lValue;
         double  dValue;
@@ -1611,8 +1609,7 @@
      * ( because of the preference to a zero low-order bit ).
      */
 
-    public float
-        floatValue(){
+    public strictfp float floatValue(){
         int     kDigits = Math.min( nDigits, singleMaxDecimalDigits+1 );
         int     iValue;
         float   fValue;
--- a/src/share/classes/sun/misc/FormattedFloatingDecimal.java	Tue Apr 26 12:49:34 2011 +0200
+++ b/src/share/classes/sun/misc/FormattedFloatingDecimal.java	Tue Apr 26 10:35:06 2011 -0700
@@ -30,7 +30,7 @@
 import sun.misc.FloatConsts;
 import java.util.regex.*;
 
-public strictfp class FormattedFloatingDecimal{
+public class FormattedFloatingDecimal{
     boolean     isExceptional;
     boolean     isNegative;
     int         decExponent;  // value set at construction, then immutable
@@ -247,8 +247,7 @@
      * More difficult if subtracting and the argument
      * is a normalized a power of 2, as the ULP changes at these points.
      */
-    private static double
-    ulp( double dval, boolean subtracting ){
+    private static double ulp( double dval, boolean subtracting ){
         long lbits = Double.doubleToLongBits( dval ) & ~signMask;
         int binexp = (int)(lbits >>> expShift);
         double ulpval;
@@ -1157,8 +1156,7 @@
      * for a single-precision float.
      */
 
-    public double
-    doubleValue(){
+    public strictfp double doubleValue(){
         int     kDigits = Math.min( nDigits, maxDecimalDigits+1 );
         long    lValue;
         double  dValue;
@@ -1517,8 +1515,7 @@
      * ( because of the preference to a zero low-order bit ).
      */
 
-    public float
-        floatValue(){
+    public strictfp float floatValue(){
         int     kDigits = Math.min( nDigits, singleMaxDecimalDigits+1 );
         int     iValue;
         float   fValue;
--- a/test/java/lang/Double/ParseDouble.java	Tue Apr 26 12:49:34 2011 +0200
+++ b/test/java/lang/Double/ParseDouble.java	Tue Apr 26 10:35:06 2011 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4160406 4705734 4707389 4826774 4895911 4421494 7021568
+ * @bug 4160406 4705734 4707389 4826774 4895911 4421494 7021568 7039369
  * @summary Test for Double.parseDouble method and acceptance regex
  */