Bug 238014

Summary: [1.5][compiler] Missing "name clash" error?
Product: [Eclipse Project] JDT Reporter: Eric Jain <eric.jain>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jerome_lanneluc, Olivier_Thomann
Version: 3.3.2   
Target Milestone: 3.4.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Eric Jain CLA 2008-06-20 21:06:19 EDT
The following three classes appear to compile fine in Eclipse:

Foo.java
--------

interface Foo<T> {
    void foo(T item);
}

Bar.java
--------

public class Bar {
    
    public void foo(Object item) {
        
    }
    
    public void foo(String item) {
        
    }
}

Test.java
---------

public class Test extends Bar implements Foo<String> {
    
}


However compiling the same classes with javac (Sun 1.5.0_15) results in the following error:

Test.java:1: name clash: foo(java.lang.Object) in Bar and foo(T) in Foo<java.lang.String> have the same erasure, yet neither overrides the other
public class Test extends Bar implements Foo<String> {
       ^
1 error
Comment 1 Philipe Mulet CLA 2008-06-30 07:29:30 EDT
Reproduced with 3.4.0. We differ from Javac6.0 or 7.0.
Comment 2 Kent Johnson CLA 2008-07-24 14:43:50 EDT
Released for 3.5M1

Released for 3.4.1

Added MethodVerifyTest 166
Comment 3 Kent Johnson CLA 2008-07-24 14:45:47 EDT
Patch for HEAD is attached to bug 238817
Comment 4 Olivier Thomann CLA 2008-08-06 14:15:46 EDT
Verified for 3.5M1 using I20080805-1307
Comment 5 Jerome Lanneluc CLA 2008-08-29 04:42:47 EDT
Verified for 3.4.1 using M20080827-2000