add testcase & remove unused code

This commit is contained in:
wenshao
2013-06-16 08:51:51 +08:00
parent 2aabdaea4b
commit da433839ee
98 changed files with 1424 additions and 1459 deletions
@@ -578,20 +578,6 @@ public class ConcurrentIdentityHashMap<K, V> extends AbstractMap<K, V> implement
}
}
/**
* Creates a new, empty map with the specified initial capacity and load factor and with the default reference types
* (weak keys, strong values), and concurrencyLevel (16).
*
* @param initialCapacity The implementation performs internal sizing to accommodate this many elements.
* @param loadFactor the load factor threshold, used to control resizing. Resizing may be performed when the average
* number of elements per bin exceeds this threshold.
* @throws IllegalArgumentException if the initial capacity of elements is negative or the load factor is
* nonpositive
*/
public ConcurrentIdentityHashMap(int initialCapacity, float loadFactor){
this(initialCapacity, loadFactor, DEFAULT_CONCURRENCY_LEVEL);
}
/**
* Creates a new, empty map with the specified initial capacity, and with default reference types (weak keys, strong
* values), load factor (0.75) and concurrencyLevel (16).
@@ -612,19 +598,6 @@ public class ConcurrentIdentityHashMap<K, V> extends AbstractMap<K, V> implement
this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_CONCURRENCY_LEVEL);
}
/**
* Creates a new map with the same mappings as the given map. The map is created with a capacity of 1.5 times the
* number of mappings in the given map or 16 (whichever is greater), and a default load factor (0.75) and
* concurrencyLevel (16).
*
* @param m the map
*/
public ConcurrentIdentityHashMap(Map<? extends K, ? extends V> m){
this(Math.max((int) (m.size() / DEFAULT_LOAD_FACTOR) + 1, DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR,
DEFAULT_CONCURRENCY_LEVEL);
putAll(m);
}
/**
* Returns <tt>true</tt> if this map contains no key-value mappings.
*
@@ -846,19 +819,6 @@ public class ConcurrentIdentityHashMap<K, V> extends AbstractMap<K, V> implement
return segmentFor(hash).put(key, hash, value, true);
}
/**
* Copies all of the mappings from the specified map to this one. These mappings replace any mappings that this map
* had for any of the keys currently in the specified map.
*
* @param m mappings to be stored in this map
*/
@Override
public final void putAll(Map<? extends K, ? extends V> m) {
for (Map.Entry<? extends K, ? extends V> e : m.entrySet()) {
put(e.getKey(), e.getValue());
}
}
/**
* Removes the key (and its corresponding value) from this map. This method does nothing if the key is not in the
* map.