[ http://issues.apache.org/jira/browse/BEANUTILS-249?page=comments#action_12449277 ] Niall Pemberton commented on BEANUTILS-249: -------------------------------------------
I think theres a few of these types of bugs with Converters. We need to review all the places BeanUtils calls ConvertUtils, which is what I plan to do as a Phase 2 of BEANUTILS-258 (phase 1 was improve Converter impl.) and come up with a set of changes. I'd rather to that than fixing each of these types of tickets peice meal > BeanUtilsBean does not convert objects using custom convertors properly > ----------------------------------------------------------------------- > > Key: BEANUTILS-249 > URL: http://issues.apache.org/jira/browse/BEANUTILS-249 > Project: Commons BeanUtils > Issue Type: Bug > Components: ConvertUtils & Converters > Affects Versions: 1.7.0 > Environment: Linux/Java5 > Reporter: Brad > Priority: Critical > Fix For: 1.8.0 > > > BeanUtilsBean.setProperty(Object bean, String name, Object value) cannot > properly convert any custom class using convertor. > Line 1007 > It calls toString() on every object regardless of its type (unless it was a > string or an array). This prevent custom convertors from functioning. > > } else if (getConvertUtils().lookup(value.getClass()) != null) { > newValue = getConvertUtils().convert(value.toString(), type); > //<--- WRONG! > } else { > newValue = value; > } > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
