Affects Version/s: 1.9.2
Fix Version/s: 1.9.3
Component/s: ConvertUtils & Converters
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
When converting a domain specific object which extends BigDecimal to a regular java.math.BigDecimal, precision is lost at time of conversion. A BigDecimal of e.g. value 3200.11 will be converted to a BigDecimal with value 3200. This happens due to org.apache.commons.beanutils.converters.NumberConverter does a BigDecimal.valueOf(value.longValue()) at line 375 (in the current trunk). I've created a reproducing test case which demonstrates the behavior (please see attached patch file).
Adding the following code to NumberConverter where targetType equals BigDecimal seems to fix this issue (and all project test cases pass):
else if (value instanceof BigDecimal)
Adding an attachment containing a patch for the propsed solution.
Filing this bug after receiving feedback on user mailing list: