commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 19857] New: - Methods ConvertUtilsBean.convert could check for converters registered with base classes
Date Mon, 12 May 2003 16:38:49 GMT
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=19857>.
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=19857

Methods ConvertUtilsBean.convert could check for converters registered with base classes

           Summary: Methods ConvertUtilsBean.convert could check for
                    converters registered with base classes
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Bean Utilities
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: abo@mid.de


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

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