| Summary: | Some classes fail to compile in Helios that compile under Sun javac | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Dan Fabulich <dan> |
| Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> |
| Status: | VERIFIED DUPLICATE | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | amj87.iitr, Olivier_Thomann, satyam.kandula, srikanth_sankaran |
| Version: | 3.7 | ||
| Target Milestone: | 3.7.1 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
Eclipse Helios generates the error: "Duplicate method foo() in type Test" Frankly, I think I agree with Helios here, but if it compiles in javac, it has to compile in Helios, too. (In reply to comment #1) > Eclipse Helios generates the error: "Duplicate method foo() in type Test" > > Frankly, I think I agree with Helios here, but if it compiles in javac, it has > to compile in Helios, too. See that this fails to compile with javac 7 (b91): Test.java:6: name clash: <T#1>foo() and <T#2>foo() have the same erasure public <T extends Set> T foo() { return null; } ^ where T#1,T#2 are type-variables: T#1 extends Set declared in method <T#1>foo() T#2 extends List declared in method <T#2>foo() Test.java:5: warning: [rawtypes] found raw type: List public <T extends List> T foo() { return null; } ^ missing type parameters for generic class List<E> where E is a type-variable: E extends Object declared in interface List Test.java:6: warning: [rawtypes] found raw type: Set public <T extends Set> T foo() { return null; } ^ missing type parameters for generic class Set<E> where E is a type-variable: E extends Object declared in interface Set 1 error 2 warnings *** This bug has been marked as a duplicate of bug 317719 *** Verified for 3.7M1. junit has been added as a part of the fix for bug 317719 Verified for 3.7.1 using build M20110824-0800 Verified for 3.8M2. |
Build Identifier: 20100617-1415 This test class compiles under javac, but doesn't compile in Eclipse Helios: import java.util.List; import java.util.Set; public class Test { public <T extends List> T foo() { return null; } public <T extends Set> T foo() { return null; } } $ javac -version javac 1.6.0_20 $ javac Test.java $ ls Test.class Test.class Reproducible: Always Steps to Reproduce: 1. Copy and paste the above source into a file called Test.java inside an Eclipse Java project.