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 2003/07/24 14:39:06 UTC
DO NOT REPLY [Bug 21851] New: -
BeanUtils.populate fails with DoubleLocaleConverter on integer values
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21851>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21851
BeanUtils.populate fails with DoubleLocaleConverter on integer values
Summary: BeanUtils.populate fails with DoubleLocaleConverter on
integer values
Product: Commons
Version: 1.6 Final
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Bean Utilities
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: dpredovic@web.de
BeanUtils.populate fails with "java.lang.IllegalArgumentException: argument type
mismatch" when assigning strings containing integer values (like "123"), if they
are converted through DoubleLocaleConverter, because DecimalFormater.parse()
returns Long and not Double when possible.
My fix is:
DoubleLocaleConverter.java:
protected Object parse(Object value, String pattern) throws ParseException {
Number result = (Number) super.parse(value, pattern);
return new Double(result.doubleValue());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org