| Summary: | [1.5][generics] Eclipse compiles code rejected by javac | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Srikanth Sankaran <srikanth_sankaran> |
| Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 3.6 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
I'll investigate this. Same issue as bug 322531 *** This bug has been marked as a duplicate of bug 322531 *** |
Eclipse 3.6 compiles the following code without any errors interface List<E> {} interface I {} public class X { <T extends I> void main(List<T> clazz, List<X> xList) { boolean b = clazz == xList || xList == clazz; } } while javac complains: X.java:6: incomparable types: List<T> and List<X> boolean b = clazz == xList || ^ X.java:7: incomparable types: List<X> and List<T> xList == clazz; ^ 2 errors C:\jtests>rem C:\ibm-java2-sdk-50-win-i386\bin\javac.exe -Xlint:unchecked -Xlint :rawtypes -verbose -sourcepath c:\jtests X.java but if you make Test a final class, eclipse also complains. In the exact same contexts, eclipse has no hesitation in flagging an assignment as being illegal. See also bug 322531