8015978: Incorrect transformation of XPath expression "string(-0)"

Reviewed-by: darcy, joehw
This commit is contained in:
Aleksej Efimov 2013-06-14 15:14:49 +04:00 committed by Sean Coffey
parent b914f8d6be
commit e6d0dba36c

View file

@ -952,9 +952,12 @@ public final class BasisLibrary {
return result; return result;
} }
else { else {
if (Double.isNaN(d) || Double.isInfinite(d)) if (!Double.isFinite(d))
return(Double.toString(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 // Use the XPath formatter to ignore locales
StringBuffer result = threadLocalStringBuffer.get(); StringBuffer result = threadLocalStringBuffer.get();
result.setLength(0); result.setLength(0);