Bug 238014 - [1.5][compiler] Missing "name clash" error?
Summary: [1.5][compiler] Missing "name clash" error?
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4.1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-20 21:06 EDT by Eric Jain CLA
Modified: 2008-08-29 04:42 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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