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;
|
package com.ibm.wala.util.collections;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* A debugging aid. When HashSetFactory.DEBUG is set, this class creates ParanoidHashMaps. Otherwise,
|
* A debugging aid. When HashSetFactory.DEBUG is set, this class creates ParanoidHashMaps. Otherwise,
|
||||||
* it returns java.util.HashMaps
|
* it returns {@link LinkedHashMap}
|
||||||
*
|
*
|
||||||
* @author sfink
|
* @author sfink
|
||||||
*/
|
*/
|
||||||
|
@ -24,37 +25,37 @@ public class HashMapFactory {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param size
|
* @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) {
|
public static <K,V> HashMap<K,V> make(int size) {
|
||||||
if (HashSetFactory.DEBUG) {
|
if (HashSetFactory.DEBUG) {
|
||||||
return new ParanoidHashMap<K,V>(size);
|
return new ParanoidHashMap<K,V>(size);
|
||||||
} else {
|
} 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() {
|
public static <K,V> HashMap<K,V> make() {
|
||||||
if (HashSetFactory.DEBUG) {
|
if (HashSetFactory.DEBUG) {
|
||||||
return new ParanoidHashMap<K,V>();
|
return new ParanoidHashMap<K,V>();
|
||||||
} else {
|
} else {
|
||||||
return new HashMap<K,V>();
|
return new LinkedHashMap<K,V>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param t
|
* @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) {
|
public static <K,V> HashMap<K,V> make(Map<K,V> t) {
|
||||||
if (HashSetFactory.DEBUG) {
|
if (HashSetFactory.DEBUG) {
|
||||||
return new ParanoidHashMap<K,V>(t);
|
return new ParanoidHashMap<K,V>(t);
|
||||||
} else {
|
} 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.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* A debugging aid. When HashSetFactory.DEBUG is set, this class creates ParanoidHashSets. Otherwise,
|
* 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
|
* @author sfink
|
||||||
*/
|
*/
|
||||||
public class HashSetFactory {
|
public class HashSetFactory {
|
||||||
|
@ -33,7 +34,7 @@ public class HashSetFactory {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
return new ParanoidHashSet<T>(size);
|
return new ParanoidHashSet<T>(size);
|
||||||
} else {
|
} else {
|
||||||
return new HashSet<T>(size);
|
return new LinkedHashSet<T>(size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@ public class HashSetFactory {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
return new ParanoidHashSet<T>();
|
return new ParanoidHashSet<T>();
|
||||||
} else {
|
} else {
|
||||||
return new HashSet<T>();
|
return new LinkedHashSet<T>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +68,7 @@ public class HashSetFactory {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
return new ParanoidHashSet<T>(s);
|
return new ParanoidHashSet<T>(s);
|
||||||
} else {
|
} else {
|
||||||
return new HashSet<T>(s);
|
return new LinkedHashSet<T>(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue