commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LANG-513) Better EnumUtils
Date Wed, 08 Jul 2009 06:36:14 GMT

    [ 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.


Mime
View raw message