"Fix" Map.containsKey() and Map.containsValue()

java.util.Map.containsKey() and java.util.Map.containsValue() take
Object parameters, not K and V.  Changed to improve classpath
compatibility.
This commit is contained in:
Eric Scharff
2009-04-17 08:57:49 -06:00
parent d11195165f
commit af784f4cbc
6 changed files with 14 additions and 14 deletions

View File

@ -44,12 +44,12 @@ public class WeakHashMap<K, V> implements Map<K, V> {
return map.size();
}
public boolean containsKey(K key) {
public boolean containsKey(Object key) {
poll();
return map.containsKey(key);
}
public boolean containsValue(V value) {
public boolean containsValue(Object value) {
poll();
return map.containsValue(value);
}