commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <>
Subject [jira] [Commented] (BEANUTILS-384) ConvertUtilsBean unable to process javassist classes
Date Tue, 22 Mar 2011 11:13:06 GMT


Niall Pemberton commented on BEANUTILS-384:

Switching from a straight Map.get() to looping over all entries to find a converter may have
a negative impact where BeanUtils is heavily used.

You can override the ConvertUtilsBean's lookup(Class, Class) method to implement this behaviour
yourself and then register your custom ConvertUtilsBean using:

BeanUtilsBean.setInstance(new BeanUtilsBean(new CustomConvertUtilsBean()));

> ConvertUtilsBean unable to process javassist classes
> ----------------------------------------------------
>                 Key: BEANUTILS-384
>                 URL:
>             Project: Commons BeanUtils
>          Issue Type: Improvement
>          Components: ConvertUtils & Converters
>    Affects Versions: 1.8.3
>            Reporter: smallufo
>         Attachments:
>   Original Estimate: 0h
>  Remaining Estimate: 0h
> The ConvertUtils uses ConvertUtils.register(userConverter , User.class) to register a
> And use converters.get(clazz) in Converter.lookup() to find proper converter.
> It won't work for javassist modified object . 
> for example , the User.class runtime becomes User_$$_javassist_0.class , and Converter
is unable to find the corresponding converter.
> So , I suggest the future version can loop the converters map , and use User.class.isAssignableFrom(clazz_in_map)
to find corresponding converter.

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message