Bug 285088 - Compiler bug when mixing generic and non-generic types
Summary: Compiler bug when mixing generic and non-generic types
Status: CLOSED DUPLICATE of bug 289247
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.6 M2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-29 16:48 EDT by Alex Blewitt CLA
Modified: 2009-09-11 14:32 EDT (History)
1 user (show)

See Also:


Attachments

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