Community
Participate
Working Groups
The following test case gives three different results for different Eclipse versions: - 3.4.2: no error, no warning - 3.6.2: 2 errors about "same erasure" - latest 3.8 I-build: 2 warnings about "same erasure" The same test case can be compiled with no errors on IBM JDK 1.6 without any problem. Is there anything wrong in this test case or this is a bug in compiler? --------------%<------------------ import java.util.List; public class X { public String a(List<Integer> b) { return null; } public Integer a(List<String> b) { return null; } } --------------%<------------------
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=317719. JDK7 refuses to compile the program. *** This bug has been marked as a duplicate of bug 317719 ***
Thanks, Srikanth. Does it mean that this is a bug in JDK6 that was fixed in JDK7? If yes, then Eclipse correctly shows error when compliance level is set to 1.6, right?
(In reply to comment #2) > Thanks, Srikanth. Does it mean that this is a bug in JDK6 that was fixed in > JDK7? If yes, then Eclipse correctly shows error when compliance level is set > to 1.6, right? Yes, this is a bug in JDK6 that was fixed in JDK7. Eclipse's reaction has been to make it an error in 1.7 mode while issuing a warning in 1.6 mode (to alert users of future trouble lurking there)
Verified for 3.8RC2 using build I20120527-2100