Bug 195468 - [1.5][compiler] Eclipse compiler differs from javac with generics (name clash)
Summary: [1.5][compiler] Eclipse compiler differs from javac with generics (name clash)
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3.1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-05 00:03 EDT by Tony Weddle CLA
Modified: 2007-09-03 07:49 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 Tony Weddle CLA 2007-07-05 00:03:47 EDT
The following classes compile cleanly with JDK 6.0:

public abstract class Base<Tvalue> implements BaseInterface<Tvalue>{
	public void setValue(Object object) {
	}
}

public interface BaseInterface<Tvalue> {
	void setValue(Tvalue object);
}

public class BaseImpl extends Base<String> {
	public void setValue(String object) {
	}
}

However, the internal eclipse compiler reports the following error on BaseImpl (yes, BaseImpl):

Name clash: The method setValue(Tvalue) of type BaseInterface<Tvalue> has the same erasure as setValue(Object) of type Base<Tvalue> but does not override it

I can sort of see why the eclipse compiler might be correct but that doesn't help me, since the way to get round the problem with the real code (the above is a test case) is rather convoluted. I can't really use eclipse with this project, as a result.
Comment 1 Olivier Thomann CLA 2007-07-05 08:35:42 EDT
Reproduced with 3.3.0.
Comment 2 Kent Johnson CLA 2007-07-09 15:23:55 EDT
Likely related to bug 195802.

This problem also existed in 3.2.2
Comment 3 Kent Johnson CLA 2007-07-16 15:22:39 EDT
Added MethodVerifyTest test146

Released into HEAD for 3.4M1

Released for 3.3.1
Comment 4 Kent Johnson CLA 2007-07-16 15:50:57 EDT
fixed & released into both streams
Comment 5 Frederic Fusier CLA 2007-08-03 11:34:39 EDT
Verified for 3.4M1 using build I20070802-0800.
Comment 6 Philipe Mulet CLA 2007-08-29 06:27:00 EDT
+1 for 3.3.1
Comment 7 Maxime Daniel CLA 2007-09-03 07:49:49 EDT
Verified for 3.3.1 using build M20070831-2000.