Modifying these classes to use the JDK 1.2 WeakHashMap constructors as that is all we need to maintain JDK 1.2 compatibility

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@637362 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2008-03-15 06:09:41 +00:00
parent c7b0550bbb
commit 986e79355c
2 changed files with 4 additions and 2 deletions

View File

@ -360,7 +360,8 @@ public abstract class Enum implements Comparable, Serializable {
entry = (Entry) cEnumClasses.get(enumClass);
if (entry == null) {
entry = createEntry(enumClass);
Map myMap = new WeakHashMap( cEnumClasses );
Map myMap = new WeakHashMap( ); // we avoid the (Map) constructor to achieve JDK 1.2 support
myMap.putAll( cEnumClasses );
myMap.put(enumClass, entry);
cEnumClasses = myMap;
}

View File

@ -406,7 +406,8 @@ public abstract class Enum implements Comparable, Serializable {
entry = (Entry) cEnumClasses.get(enumClass);
if (entry == null) {
entry = createEntry(enumClass);
Map myMap = new WeakHashMap( cEnumClasses );
Map myMap = new WeakHashMap( ); // we avoid the (Map) constructor to achieve JDK 1.2 support
myMap.putAll( cEnumClasses );
myMap.put(enumClass, entry);
cEnumClasses = myMap;
}