Summary: | [1.5] enum types cannot define a compareTo(Object o) method | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> |
Component: | Core | Assignee: | Kent Johnson <kent_johnson> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | markus.kell.r, philippe_mulet |
Version: | 3.1 | ||
Target Milestone: | 3.1 M5 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Olivier Thomann
2004-12-09 14:20:30 EST
I20041208-1200: I guess this is the same problem: Eclipse compiles without error and makes all m(..) override. Javac 1.5.0 spits errors (inline comments). package override2; public class Override2 { public static void main(String[] args) { A a= new A(); B b= new B(); C c= new C(); a.m(new Integer(1)); b.m(new Integer(2)); // c.m(new Integer(3)); // after uncommenting, javac says: // reference to m is ambiguous, both method m(java.lang.Object) in override2.B // and method <E>m(E) in override2.C match a= b; a.m(new Integer(11)); a= c; a.m(new Integer(12)); b= c; b.m(new Integer(21)); } } class A { public <E extends Object> void m(E e) { System.out.println("A: " + e); } } class B extends A { public void m(Object e) { System.out.println("B: " + e); } } class C extends B { // javac says: name clash: <E>m(E) in override2.C and m(java.lang.Object) in // override2.B have the same erasure, yet neither overrides the other public <E extends Object> void m(E e) { System.out.println("C: " + e); } } Reworked our name clash detection. Added MethodVerify test035 Verified in I20050215-2300 |