Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0
-
None
-
None
-
Operating System: All
Platform: All
-
14884
Description
NumberRange assumes everything is representable by a double. This is not the
case. In particular the classes Long, BigInteger and BigDecimal are standard
parts of J2SE that do not obey to assumption. As an example the following test
fails.
assertFalse(new NumberRange(new Long(Long.MAX_VALUE)).includesNumber(new
Long(Long.MAX_VALUE-1)));
I guess this bug is really a problem with the design of the class. You could
check the exact class and take appropriate action, but that would be long,
complicated and quite possibly pointless. I would suggest that the class is
replaced with one that assumes doubles instead of Number.