You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Niall Pemberton (JIRA)" <ji...@apache.org> on 2007/05/20 08:50:16 UTC

[jira] Resolved: (BEANUTILS-249) BeanUtilsBean does not convert objects using custom convertors properly

     [ https://issues.apache.org/jira/browse/BEANUTILS-249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton resolved BEANUTILS-249.
---------------------------------------

    Resolution: Fixed
      Assignee: Niall Pemberton

I just finised the changes for BEANUTILS-258 which will resolve this in most situations, but I modified that piece of code anyway to remove the toString() and use the new flavour convert method in ConvertUtilsBean

> BeanUtilsBean does not convert objects using custom convertors properly
> -----------------------------------------------------------------------
>
>                 Key: BEANUTILS-249
>                 URL: https://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
>         Assigned To: Niall Pemberton
>            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.
-
You can reply to this email to add a comment to the issue online.


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