Specify encoding to use; Use better JUnit; Add JCIP annotation depend

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@755269 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2009-03-17 14:40:26 +00:00
parent 654fb75d80
commit 8338eb2544
2 changed files with 14 additions and 6 deletions

12
pom.xml
View File

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -380,15 +380,23 @@
<!-- Lang should depend on very little -->
<dependencies>
<!-- TODO: replace with TestNG -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<version>3.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.jcip</groupId>
<artifactId>jcip-annotations</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compile.source>1.5</maven.compile.source>
<maven.compile.target>1.5</maven.compile.target>
<commons.componentid>lang</commons.componentid>

View File

@ -38,10 +38,10 @@ public class EnumUtils {
* @param enumClass the class of the <code>enum</code> to get
* @return the enum Map
*/
public static Map getEnumMap(Class enumClass) {
Map map = new LinkedHashMap();
Iterator itr = EnumSet.allOf(enumClass).iterator();
while(itr.hasNext()) { Enum enm = (Enum) itr.next(); map.put( enm.name(), enm ); }
public static Map<String, Enum<?>> getEnumMap(Class enumClass) {
Map<String, Enum<?>> map = new LinkedHashMap<String, Enum<?>>();
Iterator<? extends Enum<?>> itr = EnumSet.allOf(enumClass).iterator();
while(itr.hasNext()) { Enum<?> enm = itr.next(); map.put( enm.name(), enm ); }
return map;
}