Bug 285088

Summary: Compiler bug when mixing generic and non-generic types
Product: [Eclipse Project] JDT Reporter: Alex Blewitt <alex.blewitt>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 3.5   
Target Milestone: 3.6 M2   
Hardware: All   
OS: All   
Whiteboard:

Description Alex Blewitt CLA 2009-07-29 16:48:01 EDT
The following code generates an error with Sun's javac but Eclipse JDT compiles it without reporting an error:

--- 8< ---
import java.util.Collection;

public class CompilerBug {
	public int foo(Collection bar) { return 0; }
	public double foo(Collection<String> bar) {return 0; }
}
--- 8< ---
alblue:tmp alex$ javac CompilerBug.java 
CompilerBug.java:5: foo(java.util.Collection) is already defined in CompilerBug
	public double foo(Collection<String> bar) {return 0; }
	              ^
1 error

Note that making the first method a generic type (like Collection<Double>) results in it compiling fine in both Eclipse and javac.
Comment 1 Kent Johnson CLA 2009-09-11 14:32:34 EDT
Added MethodVerifyTest test200 in HEAD

*** This bug has been marked as a duplicate of bug 289247 ***