You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/12/27 19:24:07 UTC

DO NOT REPLY [Bug 32851] New: - copyProperties and null/empty values.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32851>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32851

           Summary: copyProperties and null/empty values.
           Product: Commons
           Version: 1.6 Final
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Bean Utilities
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: mauricio_noda@hotmail.com


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.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org