From: Geoghegan, S. <Sea...@ds...> - 2003-07-31 03:35:25
|
Hi guys. I've seem to have found a bug in the Numeric DefaultAttributeType inner class in the parse(Object) method. If I create an AttributeType that has a type that is a sub-class of Number but not one of the classes that is explicitly checked, such as BigDecimal or BigInteger, when the method gets down to the if final if statement: If ( type.isAssignableFrom(Number.class) ) This fails and a runtime exception is thrown. It seems that the condition is back to front. That should be no need to check if the type is assignable from Number since Number's only super class is object. I think the way it is supposed to be is Number.class.isAssignableFrom(type.getClass()) that way any subclasses of Number that aren't caught by the previous checks will be converted to a Double and all is good. So I thought I would check with IanS or Chris before committing any changes, just to make sure I have the intention of the method correct. Cheers Sean Geoghegan Information Exploitation Group Command and Intelligence Environments Branch Command and Control Division Defence Science and Technology Organisation sea...@ds... ph +61 08 82595895 |