You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Seth Falco (Jira)" <ji...@apache.org> on 2021/07/19 11:33:00 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=17383274#comment-17383274 ]
Seth Falco commented on BEANUTILS-346:
--------------------------------------
It looks like the PR for this has been merged already, can this be closed/resolved?
> 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
> Priority: Major
> Fix For: 2.0.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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 was sent by Atlassian Jira
(v8.3.4#803005)