Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323927

Summary: Java generics code compiles with Galileo, fails with Helios (method argument erasure clash)
Product: [Eclipse Project] JDT Reporter: Dominic Owen <d.owen>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: d.owen, Olivier_Thomann, prakash, rivashin, satyam.kandula, srikanth_sankaran
Version: 3.6   
Target Milestone: 3.7.1   
Hardware: All   
OS: Linux   
Whiteboard:

Description Dominic Owen CLA 2010-08-29 23:24:27 EDT
Build Identifier: Helios Release Build id: 20100617-1415

We have code that compiles and runs in all versions of eclipse (regardless of platform) except for Helios. The code below exhibits the bug:

public class BugExample {
    protected static <T extends String> T same(Collection<? extends T> p_col) {
        return null;
    }
    protected static <T extends Number> T same(Collection<? extends T> p_col) {
        return null;
    }
}

The error message is: "Method same(Collection<? extends T>) has the same erasure same(Collection<E>) as another method in type BugExample".

Reproducible: Always

Steps to Reproduce:
1. Attempt to compile the above code in Helios.
Comment 1 Prakash Rangaraj CLA 2010-08-29 23:29:27 EDT
Moving to JDT Core ...
Comment 2 Srikanth Sankaran CLA 2010-08-30 00:49:07 EDT
See that this fails to compile with JDK7 (b100) and
the error message is the same as eclipse.

*** This bug has been marked as a duplicate of bug 317719 ***
Comment 3 Olivier Thomann CLA 2010-09-14 10:25:55 EDT
Verified for 3.7M2 using I20100914-0100
Comment 4 Srikanth Sankaran CLA 2011-08-09 10:13:03 EDT
junit has been added as a part of the fix for bug 317719
Comment 5 Satyam Kandula CLA 2011-08-25 09:06:13 EDT
Verified for 3.7.1 RC2 using build M20110824-0800
Comment 6 Olivier Thomann CLA 2011-09-14 11:31:41 EDT
Verified for 3.8M2