You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "smallufo (JIRA)" <ji...@apache.org> on 2010/12/16 09:29:00 UTC
[jira] Created: (BEANUTILS-384) ConvertUtilsBean unable to process
javassist classes
ConvertUtilsBean unable to process javassist classes
----------------------------------------------------
Key: BEANUTILS-384
URL: https://issues.apache.org/jira/browse/BEANUTILS-384
Project: Commons BeanUtils
Issue Type: Improvement
Components: ConvertUtils & Converters
Affects Versions: 1.8.3
Reporter: smallufo
The ConvertUtils uses ConvertUtils.register(userConverter , User.class) to register a converter.
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.
-
You can reply to this email to add a comment to the issue online.
[jira] [Commented] (BEANUTILS-384) ConvertUtilsBean unable to
process javassist classes
Posted by "smallufo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009601#comment-13009601 ]
smallufo commented on BEANUTILS-384:
------------------------------------
Hi , can somebody patch this ?
> ConvertUtilsBean unable to process javassist classes
> ----------------------------------------------------
>
> Key: BEANUTILS-384
> URL: https://issues.apache.org/jira/browse/BEANUTILS-384
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: ConvertUtils & Converters
> Affects Versions: 1.8.3
> Reporter: smallufo
> Attachments: ConvertUtilsBean.java
>
> Original Estimate: 0h
> Remaining Estimate: 0h
>
> The ConvertUtils uses ConvertUtils.register(userConverter , User.class) to register a converter.
> 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: http://www.atlassian.com/software/jira
[jira] Issue Comment Edited: (BEANUTILS-384) ConvertUtilsBean
unable to process javassist classes
Posted by "smallufo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972448#action_12972448 ]
smallufo edited comment on BEANUTILS-384 at 12/17/10 8:05 AM:
--------------------------------------------------------------
Solve issue BEANUTILS-384
Sorry , I am not a committer and unable to submit to SVN
Would somebody please patch this file ?
Thanks.
was (Author: smallufo):
Solve issue BEANUTILS-384
> ConvertUtilsBean unable to process javassist classes
> ----------------------------------------------------
>
> Key: BEANUTILS-384
> URL: https://issues.apache.org/jira/browse/BEANUTILS-384
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: ConvertUtils & Converters
> Affects Versions: 1.8.3
> Reporter: smallufo
> Attachments: ConvertUtilsBean.java
>
> Original Estimate: 0h
> Remaining Estimate: 0h
>
> The ConvertUtils uses ConvertUtils.register(userConverter , User.class) to register a converter.
> 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.
-
You can reply to this email to add a comment to the issue online.
[jira] [Commented] (BEANUTILS-384) ConvertUtilsBean unable to
process javassist classes
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009616#comment-13009616 ]
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:
{code}
BeanUtilsBean.setInstance(new BeanUtilsBean(new CustomConvertUtilsBean()));
{code}
> ConvertUtilsBean unable to process javassist classes
> ----------------------------------------------------
>
> Key: BEANUTILS-384
> URL: https://issues.apache.org/jira/browse/BEANUTILS-384
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: ConvertUtils & Converters
> Affects Versions: 1.8.3
> Reporter: smallufo
> Attachments: ConvertUtilsBean.java
>
> Original Estimate: 0h
> Remaining Estimate: 0h
>
> The ConvertUtils uses ConvertUtils.register(userConverter , User.class) to register a converter.
> 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: http://www.atlassian.com/software/jira
[jira] [Commented] (BEANUTILS-384) ConvertUtilsBean unable to
process javassist classes
Posted by "smallufo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13022176#comment-13022176 ]
smallufo commented on BEANUTILS-384:
------------------------------------
Hi , I think I need to override lookup(Class clazz)
but I cannot get converters in CustomConvertUtilsBean , because converters(map) is private , not protected.
> ConvertUtilsBean unable to process javassist classes
> ----------------------------------------------------
>
> Key: BEANUTILS-384
> URL: https://issues.apache.org/jira/browse/BEANUTILS-384
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: ConvertUtils & Converters
> Affects Versions: 1.8.3
> Reporter: smallufo
> Attachments: ConvertUtilsBean.java
>
> Original Estimate: 0h
> Remaining Estimate: 0h
>
> The ConvertUtils uses ConvertUtils.register(userConverter , User.class) to register a converter.
> 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: http://www.atlassian.com/software/jira
[jira] Issue Comment Edited: (BEANUTILS-384) ConvertUtilsBean
unable to process javassist classes
Posted by "smallufo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972448#action_12972448 ]
smallufo edited comment on BEANUTILS-384 at 12/17/10 8:09 AM:
--------------------------------------------------------------
Solve issue BEANUTILS-384 , and pass all tests,
Sorry , I am not a committer and unable to submit to SVN
Would somebody please patch this file ?
Thanks.
was (Author: smallufo):
Solve issue BEANUTILS-384
Sorry , I am not a committer and unable to submit to SVN
Would somebody please patch this file ?
Thanks.
> ConvertUtilsBean unable to process javassist classes
> ----------------------------------------------------
>
> Key: BEANUTILS-384
> URL: https://issues.apache.org/jira/browse/BEANUTILS-384
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: ConvertUtils & Converters
> Affects Versions: 1.8.3
> Reporter: smallufo
> Attachments: ConvertUtilsBean.java
>
> Original Estimate: 0h
> Remaining Estimate: 0h
>
> The ConvertUtils uses ConvertUtils.register(userConverter , User.class) to register a converter.
> 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.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (BEANUTILS-384) ConvertUtilsBean unable to process
javassist classes
Posted by "smallufo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
smallufo updated BEANUTILS-384:
-------------------------------
Remaining Estimate: 0h
Original Estimate: 0h
> ConvertUtilsBean unable to process javassist classes
> ----------------------------------------------------
>
> Key: BEANUTILS-384
> URL: https://issues.apache.org/jira/browse/BEANUTILS-384
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: ConvertUtils & Converters
> Affects Versions: 1.8.3
> Reporter: smallufo
> Original Estimate: 0h
> Remaining Estimate: 0h
>
> The ConvertUtils uses ConvertUtils.register(userConverter , User.class) to register a converter.
> 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.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (BEANUTILS-384) ConvertUtilsBean unable to process
javassist classes
Posted by "smallufo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
smallufo updated BEANUTILS-384:
-------------------------------
Attachment: ConvertUtilsBean.java
Solve issue BEANUTILS-384
> ConvertUtilsBean unable to process javassist classes
> ----------------------------------------------------
>
> Key: BEANUTILS-384
> URL: https://issues.apache.org/jira/browse/BEANUTILS-384
> Project: Commons BeanUtils
> Issue Type: Improvement
> Components: ConvertUtils & Converters
> Affects Versions: 1.8.3
> Reporter: smallufo
> Attachments: ConvertUtilsBean.java
>
> Original Estimate: 0h
> Remaining Estimate: 0h
>
> The ConvertUtils uses ConvertUtils.register(userConverter , User.class) to register a converter.
> 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.
-
You can reply to this email to add a comment to the issue online.