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.11 by jsr166, Mon May 2 16:35:52 2005 UTC vs.
Revision 1.12 by jsr166, Mon May 2 21:44:01 2005 UTC

# Line 351 | Line 351 | public class TreeMap<K,V>
351          // Offload comparator-based version for sake of performance
352          if (comparator != null)
353              return getEntryUsingComparator(key);
354 <        Comparable<K> k = (Comparable<K>) key;
354 >        Comparable<? super K> k = (Comparable<? super K>) key;
355          Entry<K,V> p = root;
356          while (p != null) {
357              int cmp = k.compareTo(p.key);
# Line 1760 | Line 1760 | public class TreeMap<K,V>
1760       * Compares two keys using the correct comparison method for this TreeMap.
1761       */
1762      private int compare(K k1, K k2) {
1763 <        return (comparator==null ? ((Comparable</*-*/K>)k1).compareTo(k2)
1764 <                                 : comparator.compare((K)k1, (K)k2));
1763 >        return comparator==null ? ((Comparable<? super K>)k1).compareTo(k2)
1764 >                                : comparator.compare(k1, k2);
1765      }
1766  
1767      /**
# Line 2193 | Line 2193 | public class TreeMap<K,V>
2193      }
2194  
2195      /** Intended to be called only from TreeSet.addAll **/
2196 <    void addAllForTreeSet(SortedSet<Map.Entry<K,V>> set, V defaultVal) {
2196 >    void addAllForTreeSet(SortedSet<? extends K> set, V defaultVal) {
2197          try {
2198              buildFromSorted(set.size(), set.iterator(), null, defaultVal);
2199          } catch (java.io.IOException cannotHappen) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines