ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/TreeMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/TreeMap.java (file contents):
Revision 1.16 by dl, Wed May 25 14:05:06 2005 UTC vs.
Revision 1.17 by dl, Thu May 26 12:07:07 2005 UTC

# Line 1066 | Line 1066 | public class TreeMap<K,V>
1066          }
1067  
1068          public boolean containsKey(Object key) {
1069 <            return inRange((K) key) && TreeMap.this.containsKey(key);
1069 >            return inRange(key) && TreeMap.this.containsKey(key);
1070          }
1071  
1072          public V get(Object key) {
1073 <            if (!inRange((K) key))
1073 >            if (!inRange(key))
1074                  return null;
1075              return TreeMap.this.get(key);
1076          }
# Line 1082 | Line 1082 | public class TreeMap<K,V>
1082          }
1083  
1084          public V remove(Object key) {
1085 <            if (!inRange((K) key))
1085 >            if (!inRange(key))
1086                  return null;
1087              return TreeMap.this.remove(key);
1088          }
# Line 1351 | Line 1351 | public class TreeMap<K,V>
1351              return navigableTailMap(fromKey);
1352          }
1353  
1354 <        private boolean inRange(K key) {
1354 >        private boolean inRange(Object key) {
1355              return (fromStart || compare(key, fromKey) >= 0) &&
1356                     (toEnd     || compare(key, toKey)   <  0);
1357          }
1358  
1359          // This form allows the high endpoint (as well as all legit keys)
1360 <        private boolean inRange2(K key) {
1360 >        private boolean inRange2(Object key) {
1361              return (fromStart || compare(key, fromKey) >= 0) &&
1362                     (toEnd     || compare(key, toKey)   <= 0);
1363          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines