Use LinkedHash stuff by default
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2011 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
a8bdd943dd
commit
c098944ad8
|
@ -11,12 +11,13 @@
|
|||
package com.ibm.wala.util.collections;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* A debugging aid. When HashSetFactory.DEBUG is set, this class creates ParanoidHashMaps. Otherwise,
|
||||
* it returns java.util.HashMaps
|
||||
* it returns {@link LinkedHashMap}
|
||||
*
|
||||
* @author sfink
|
||||
*/
|
||||
|
@ -24,37 +25,37 @@ public class HashMapFactory {
|
|||
|
||||
/**
|
||||
* @param size
|
||||
* @return A ParanoidHashMap if DEBUG = true, a java.util.HashMap otherwise
|
||||
* @return A ParanoidHashMap if DEBUG = true, a LinkedHashMap otherwise
|
||||
*/
|
||||
public static <K,V> HashMap<K,V> make(int size) {
|
||||
if (HashSetFactory.DEBUG) {
|
||||
return new ParanoidHashMap<K,V>(size);
|
||||
} else {
|
||||
return new HashMap<K,V>(size);
|
||||
return new LinkedHashMap<K,V>(size);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A ParanoidHashMap if DEBUG = true, a java.util.HashMap otherwise
|
||||
* @return A ParanoidHashMap if DEBUG = true, a LinkedHashMap otherwise
|
||||
*/
|
||||
public static <K,V> HashMap<K,V> make() {
|
||||
if (HashSetFactory.DEBUG) {
|
||||
return new ParanoidHashMap<K,V>();
|
||||
} else {
|
||||
return new HashMap<K,V>();
|
||||
return new LinkedHashMap<K,V>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param t
|
||||
* @return A ParanoidHashMap if DEBUG = true, a java.util.HashMap otherwise
|
||||
* @return A ParanoidHashMap if DEBUG = true, a LinkedHashMap otherwise
|
||||
*/
|
||||
public static <K,V> HashMap<K,V> make(Map<K,V> t) {
|
||||
if (HashSetFactory.DEBUG) {
|
||||
return new ParanoidHashMap<K,V>(t);
|
||||
} else {
|
||||
return new HashMap<K,V>(t);
|
||||
return new LinkedHashMap<K,V>(t);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,11 +12,12 @@ package com.ibm.wala.util.collections;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
|
||||
/**
|
||||
*
|
||||
* A debugging aid. When HashSetFactory.DEBUG is set, this class creates ParanoidHashSets. Otherwise,
|
||||
* it returns java.util.HashSets
|
||||
* it returns {@link LinkedHashSet}s
|
||||
* @author sfink
|
||||
*/
|
||||
public class HashSetFactory {
|
||||
|
@ -33,7 +34,7 @@ public class HashSetFactory {
|
|||
if (DEBUG) {
|
||||
return new ParanoidHashSet<T>(size);
|
||||
} else {
|
||||
return new HashSet<T>(size);
|
||||
return new LinkedHashSet<T>(size);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,7 +45,7 @@ public class HashSetFactory {
|
|||
if (DEBUG) {
|
||||
return new ParanoidHashSet<T>();
|
||||
} else {
|
||||
return new HashSet<T>();
|
||||
return new LinkedHashSet<T>();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,7 +68,7 @@ public class HashSetFactory {
|
|||
if (DEBUG) {
|
||||
return new ParanoidHashSet<T>(s);
|
||||
} else {
|
||||
return new HashSet<T>(s);
|
||||
return new LinkedHashSet<T>(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue