diff --git a/classpath/java/util/Collections.java b/classpath/java/util/Collections.java index 134c481322..d2391d7435 100644 --- a/classpath/java/util/Collections.java +++ b/classpath/java/util/Collections.java @@ -143,10 +143,10 @@ public class Collections { public void clear() { synchronized (lock) { map.clear(); } } - public boolean containsKey(K key) { + public boolean containsKey(Object key) { synchronized (lock) { return map.containsKey(key); } } - public boolean containsValue(V value) { + public boolean containsValue(Object value) { synchronized (lock) { return map.containsValue(value); } } public Set> entrySet() { diff --git a/classpath/java/util/HashMap.java b/classpath/java/util/HashMap.java index 43ee2e8148..913f58b696 100644 --- a/classpath/java/util/HashMap.java +++ b/classpath/java/util/HashMap.java @@ -158,12 +158,12 @@ public class HashMap implements Map { return c; } - public boolean containsKey(K key) { - return find(key) != null; + public boolean containsKey(Object key) { + return find((K)key) != null; } - public boolean containsValue(V value) { - return values().contains(value); + public boolean containsValue(Object value) { + return values().contains((V)value); } public V get(K key) { diff --git a/classpath/java/util/Hashtable.java b/classpath/java/util/Hashtable.java index 8ae75941a3..b08b4c3b67 100644 --- a/classpath/java/util/Hashtable.java +++ b/classpath/java/util/Hashtable.java @@ -40,11 +40,11 @@ public class Hashtable implements Map { return map.size(); } - public synchronized boolean containsKey(K key) { + public synchronized boolean containsKey(Object key) { return map.containsKey(key); } - public synchronized boolean containsValue(V value) { + public synchronized boolean containsValue(Object value) { return map.containsValue(value); } diff --git a/classpath/java/util/IdentityHashMap.java b/classpath/java/util/IdentityHashMap.java index 7a86c5a192..123c26990e 100644 --- a/classpath/java/util/IdentityHashMap.java +++ b/classpath/java/util/IdentityHashMap.java @@ -29,11 +29,11 @@ public class IdentityHashMap implements Map { return map.size(); } - public boolean containsKey(K key) { + public boolean containsKey(Object key) { return map.containsKey(key); } - public boolean containsValue(V value) { + public boolean containsValue(Object value) { return map.containsValue(value); } diff --git a/classpath/java/util/Map.java b/classpath/java/util/Map.java index 0b5fa550b2..bdb02e52c4 100644 --- a/classpath/java/util/Map.java +++ b/classpath/java/util/Map.java @@ -15,9 +15,9 @@ public interface Map { public int size(); - public boolean containsKey(K key); + public boolean containsKey(Object key); - public boolean containsValue(V value); + public boolean containsValue(Object value); public V get(K key); diff --git a/classpath/java/util/WeakHashMap.java b/classpath/java/util/WeakHashMap.java index 1618d58907..8a8da9c1c0 100644 --- a/classpath/java/util/WeakHashMap.java +++ b/classpath/java/util/WeakHashMap.java @@ -44,12 +44,12 @@ public class WeakHashMap implements Map { 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); }