Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
1.6
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
32851
Description
When BeanUtils.copyProperties copies a String property to a BigDecimal property
it throws ConversionException when the String property is null or "".
The opposite, when it copies a null BigDecimal property to a String property,
works fine, the String is set to null.
When BeanUtils.copyProperties copy a null or "" String property to a Integer
property, it sets the Integer to 0. The opposite, when I copy a null Integer
property to a String property it is set to null. Copying a null String to a null
Integer instead of 0 would be more consistent. (happens with other numeric
wrapper classes too).
These 2 issues are problematic when there are optional fields inside a Struts
ActionForm and the empty values are copied to a TO.