8224698: ConcurrentSkipListMap.java does not compile with the Eclipse Java Compiler

Reviewed-by: martin, clanger, smarks, dfuchs
This commit is contained in:
Doug Lea 2019-05-24 08:39:37 -07:00
parent ee040e4be2
commit 579854e397

View File

@ -1712,9 +1712,8 @@ public class ConcurrentSkipListMap<K,V> extends AbstractMap<K,V>
Map<?,?> m = (Map<?,?>) o;
try {
Comparator<? super K> cmp = comparator;
@SuppressWarnings("unchecked")
Iterator<Map.Entry<?,?>> it =
(Iterator<Map.Entry<?,?>>)m.entrySet().iterator();
// See JDK-8223553 for Iterator type wildcard rationale
Iterator<? extends Map.Entry<?,?>> it = m.entrySet().iterator();
if (m instanceof SortedMap &&
((SortedMap<?,?>)m).comparator() == cmp) {
Node<K,V> b, n;