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); |
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 |
|
/** |
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) { |