8015978: Incorrect transformation of XPath expression "string(-0)"
Reviewed-by: darcy, joehw
Contributed-by: aleksej.efimov@oracle.com
--- 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);