RFR: 8223553: Fix code constructs that do not compile with the Eclipse Java Compiler

Stuart Marks stuart.marks at oracle.com
Thu May 16 22:09:21 UTC 2019



On 5/14/19 9:16 PM, Martin Buchholz wrote:
>> src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java

Regarding the change in this particular file, I'd suggest the following:


diff -r 006dadb903ab -r 92e1fdce45e0 
src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java
--- 
a/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java 
Mon May 13 17:15:56 2019 -0700
+++ 
b/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java 
Thu May 16 15:04:30 2019 -0700
@@ -1712,9 +1712,7 @@
          Map<?,?> m = (Map<?,?>) o;
          try {
              Comparator<? super K> cmp = comparator;
-            @SuppressWarnings("unchecked")
-            Iterator<Map.Entry<?,?>> it =
-                (Iterator<Map.Entry<?,?>>)m.entrySet().iterator();
+            Iterator<? extends Map.Entry<?,?>> it = m.entrySet().iterator();
              if (m instanceof SortedMap &&
                  ((SortedMap<?,?>)m).comparator() == cmp) {
                  Node<K,V> b, n;



I have no idea if it will be accepted by the Eclipse IDE, but this seems like a 
cleaner change to me than introducing a raw type.

***

Christoph,

On the general issue of compilation differences between javac and the Eclipse 
IDE, have you raised a bug with them?

s'marks


More information about the net-dev mailing list