Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-JSR-5
-
None
-
None
Description
This bug occurs in MetaClassHelper.java on line 393. It unnecessarily creates a new BigDecimal when one was already passed in. Calling doubleValue() changes the original value.
Java Class:
import java.math.BigDecimal;
class BigDecimalEcho {
public static BigDecimal echoX ( BigDecimal x, BigDecimal y)
}
GroovyTest:
import BigDecimalEcho
println BigDecimalEcho.echoX(9.95, 1.0)
println BigDecimalEcho.echoX(9.95, 1)
Output:
9.95
9.949999999999999289457264239899814128875732421875