commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (BEANUTILS-187) [beanutils] Methods ConvertUtilsBean.convert could check for converters registered with base classes
Date Wed, 08 Nov 2006 01:50:57 GMT
    [ http://issues.apache.org/jira/browse/BEANUTILS-187?page=comments#action_12448004 ] 
            
Henri Yandell commented on BEANUTILS-187:
-----------------------------------------

+1 to WONTFIX on this one. 

Superclass registering is also a pain as people have different views about the order of lookup.
Extends first, or interfaces first? Depth first or breadth first?

Mostly though it causes too much confusion to the system to have converters who are supertype
converters and may or may not offer the subclass (bizarre as that would be).

> [beanutils] Methods ConvertUtilsBean.convert could check for converters registered with
base classes
> ----------------------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-187
>                 URL: http://issues.apache.org/jira/browse/BEANUTILS-187
>             Project: Commons BeanUtils
>          Issue Type: Improvement
>          Components: ConvertUtils & Converters
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Alexander Borschet
>            Priority: Minor
>
> When converting a value to a class instance it is possible tu register user
> defined classes that implement the converter interface.
> The method convert(String value, Class clazz) in ConvertUtilsBean tries to get
> an instance of a converter class simply by checking the collection of registered
> converters.
> Unfortunately converters that have been registered for super classes are not
> considered.
> REQUEST: How about improving the method convert by the following code lines:
> Class baseclazz     = clazz;
> Converter converter = null;
> do {
>        	converter = (Converter) converters.get(baseclazz);
>        	if (converter != null)
> 		break;
>        	baseclazz = clazz.getSuperclass();
> } while (baseclazz != null);

-- 
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message