--- jsr166/src/main/java/util/TreeMap.java 2005/05/25 14:05:06 1.16 +++ jsr166/src/main/java/util/TreeMap.java 2005/06/16 02:11:13 1.18 @@ -6,6 +6,7 @@ */ package java.util; +import java.util.*; // for javadoc /** * A Red-Black tree based {@link NavigableMap} implementation. @@ -1066,11 +1067,11 @@ public class TreeMap } public boolean containsKey(Object key) { - return inRange((K) key) && TreeMap.this.containsKey(key); + return inRange(key) && TreeMap.this.containsKey(key); } public V get(Object key) { - if (!inRange((K) key)) + if (!inRange(key)) return null; return TreeMap.this.get(key); } @@ -1082,7 +1083,7 @@ public class TreeMap } public V remove(Object key) { - if (!inRange((K) key)) + if (!inRange(key)) return null; return TreeMap.this.remove(key); } @@ -1351,13 +1352,13 @@ public class TreeMap return navigableTailMap(fromKey); } - private boolean inRange(K key) { + private boolean inRange(Object key) { return (fromStart || compare(key, fromKey) >= 0) && (toEnd || compare(key, toKey) < 0); } // This form allows the high endpoint (as well as all legit keys) - private boolean inRange2(K key) { + private boolean inRange2(Object key) { return (fromStart || compare(key, fromKey) >= 0) && (toEnd || compare(key, toKey) <= 0); } @@ -1519,7 +1520,7 @@ public class TreeMap } /** - * Test two values for equality. Differs from o1.equals(o2) only in + * Test two values for equality. Differs from o1.equals(o2) only in * that it copes with null o1 properly. */ private static boolean valEquals(Object o1, Object o2) {