commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32207] New: - BigDecimal converter is not allowing pass-tru nulls when used in BeanUtilsBean.copyProperty
Date Fri, 12 Nov 2004 18:28:09 GMT
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=32207>.
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=32207

BigDecimal converter is not allowing pass-tru nulls when used in BeanUtilsBean.copyProperty

           Summary: BigDecimal converter is not allowing pass-tru nulls when
                    used in BeanUtilsBean.copyProperty
           Product: Commons
           Version: 1.6 Final
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Bean Utilities
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: greg_slonim@fanniemae.com


BigDecimal converter gets invoked from copyProperty method of BeanUtilsBean.
It is instantiated and registered in ConvertUtilsBean and its default
constructor sets instance variable useDefault to false. Then in public Object
convert(Class type, Object value) it is checking for the value of this boolean
(useDefault) in case of null value
       if (value == null) {
            if (useDefault) {
                return (defaultValue);
            } else {
                throw new ConversionException("No value specified");
            }
        }
therefore, if your source object had null value of BigDecimal type, it would not
simply set null on target object, it will break with exception. I believe that
when you copy properties, nulls have to be propagated just as well as valid
values. Please advise ASAP.

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


Mime
View raw message