Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0, 1.1-beta-2
-
None
-
Groovy 1.0, Windows XP/Pro
Description
The NumberMath.getMath(Number) treats Byte and Short values as unexpected Number subclasses. Whereas, NumberMath.getMath(Number,Number) handles Byte and Short using IntegerMath.instance.
It would be desirable if NumberMath.getMath(Number) would behave like NumberMath.getMath(Number,Number), so that single Number argument methods were behaved consistently with the two Number argument methods.
For example, NumberMath.negate( Byte.valueOf("1") ) and NumberMath.negate( Short.valueOf("1") ) fail with an IllegalArgumentException.