You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2009/07/08 08:36:14 UTC

[jira] Commented: (LANG-513) Better EnumUtils

    [ https://issues.apache.org/jira/browse/LANG-513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12728533#action_12728533 ] 

Henri Yandell commented on LANG-513:
------------------------------------

The constructor needs to stay. I'll update the comment to explain why (namely to support systems that need object instances - velocity always being the canonical example). 

> Better EnumUtils
> ----------------
>
>                 Key: LANG-513
>                 URL: https://issues.apache.org/jira/browse/LANG-513
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 3.0
>            Reporter: Ivan Bilenjkij
>             Fix For: 3.0
>
>         Attachments: EnumUtils.patch, EnumUtilsTest.patch
>
>
> Parametrize the getEnumMap() method with <E extends Enum<E>>.  This narrows down the argument so that non-enums and {{null}} are rejected at compile time. Also, at its current state the EnumUtils should never be instantiated. 
> {code:title=EnumUtils.java} public static Map<String, Enum<?>> getEnumMap(Class enumClass) {code}
> changes to:
> {code:title=EnumUtils.java} public static <E extends Enum<E>> Map<String, Enum<E>> getEnumMap(Class<E> enumClass) {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.