You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Charlie Mordant (JIRA)" <ji...@apache.org> on 2010/07/27 09:49:17 UTC
[jira] Commented: (BEANUTILS-346) Enum type is not supported
[ https://issues.apache.org/jira/browse/BEANUTILS-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12892681#action_12892681 ]
Charlie Mordant commented on BEANUTILS-346:
-------------------------------------------
Same for BeanUtils.copyProperties(), throws a NullPointerException for Enum
> Enum type is not supported
> --------------------------
>
> Key: BEANUTILS-346
> URL: https://issues.apache.org/jira/browse/BEANUTILS-346
> Project: Commons BeanUtils
> Issue Type: Bug
> Components: Bean / Property Utils
> Affects Versions: 1.8.0-BETA
> Environment: JDK6
> Reporter: Miroslav Nachev
> Fix For: LATER THAN 1.8.4
>
>
> When I try to set some property of type Enum the exception is thrown. This can be fixed with the following code:
> private static class EnumConvertUtils extends ConvertUtilsBean {
> public EnumConvertUtils() {
> }
> @Override
> public Object convert(String value, Class clazz) {
> if(clazz.isEnum())
> return Enum.valueOf(clazz, value);
> return super.convert(value, clazz);
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.