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 2005/02/08 15:40:42 UTC

DO NOT REPLY [Bug 19857] - [beanutils] Methods ConvertUtilsBean.convert could check for converters registered with base classes

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=19857>.
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=19857





------- Additional Comments From vitali.schevchuk@bnpparibas.com  2005-02-08 15:40 -------
Proposed resolution: extend ConvertUtilsBean.lookup() method implementation as 
following:

Class: org.apache.commons.beanutils.ConvertUtilsBean

     public Converter lookup(Class clazz) {

         // lookup direct class 
         Converter converter = ((Converter) converters.get(clazz));
         
         // recursive superclasses lookup
         if (converter == null && (!clazz.equals(Object.class)))
            converter = lookup(clazz.getSuperclass());

         // interfaces lookup
         if (converter ==null){
             Class[] interfaces = clazz.getInterfaces();
             for (int i = 0; converter !=null && i < interfaces.length; i++)
                 converter=lookup(interfaces[i]);
         }
         return converter; 
    }


-- 
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