8015978: Incorrect transformation of XPath expression "string(-0)"
authorcoffeys
Fri, 14 Jun 2013 15:14:49 +0400
changeset 18355 381a149016f9
parent 18354 ce3ebc4a1aec
child 18356 105e99e6ea5d
8015978: Incorrect transformation of XPath expression "string(-0)" Reviewed-by: darcy, joehw Contributed-by: aleksej.efimov@oracle.com
jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java	Mon Jun 10 14:42:57 2013 -0700
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java	Fri Jun 14 15:14:49 2013 +0400
@@ -952,9 +952,12 @@
                 return result;
         }
         else {
-            if (Double.isNaN(d) || Double.isInfinite(d))
+            if (!Double.isFinite(d))
                 return(Double.toString(d));
 
+            //Convert -0.0 to +0.0 other values remains the same
+            d = d + 0.0;
+
             // Use the XPath formatter to ignore locales
             StringBuffer result = threadLocalStringBuffer.get();
             result.setLength(0);