[
https://issues.apache.org/jira/browse/LANG-513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Henri Yandell closed LANG-513.
------------------------------
Resolution: Fixed
Thanks for the patch Ivan. Applied.
svn ci -m "Applying Ivan Bilenjkij's patch from LANG-513, improving the
generics of the getEnumMap method" src
Sending src/java/org/apache/commons/lang/EnumUtils.java
Sending src/test/org/apache/commons/lang/EnumUtilsTest.java
Transmitting file data ..
Committed revision 792051.
> 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.