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

Bug 319342

Summary: compiler regression in generic methods + return types
Product: [Eclipse Project] JDT Reporter: Thomas.Aigner
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: amj87.iitr, satyam.kandula, srikanth_sankaran
Version: 3.7   
Target Milestone: 3.7.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Thomas.Aigner CLA 2010-07-09 02:40:44 EDT
Build Identifier: I20100608-0911

overloading a static generic method doesn't work any more.
It works in javac 1.6 and eclipse 3.5

Reproducible: Always

Steps to Reproduce:
compile:
import java.util.List;

public class CovarReturnTest {

    public static String doIt(final List<String> arg) {
        return "1";
    }

    public static CharSequence doIt(final List<CharSequence> arg) {
        return "2";
    }
}
Comment 1 Ayushman Jain CLA 2010-07-09 02:56:18 EDT
I believe this was a bug in java 6 which got fixed in java 7. See that this test case doesnt compile with java 7 (b76), giving an error "name clash.... same erasure". Eclipse compiler also gives the same error and is thus compatible with javac and also JLS3 - 8.4.3.
Srikanth, whats your take?
Comment 2 Srikanth Sankaran CLA 2010-07-11 23:09:48 EDT
(In reply to comment #1)
> I believe this was a bug in java 6 which got fixed in java 7. See that this
> test case doesnt compile with java 7 (b76), giving an error "name clash....
> same erasure". Eclipse compiler also gives the same error and is thus
> compatible with javac and also JLS3 - 8.4.3.
> Srikanth, whats your take?

Yes, this is a duplicate of bug 317719

*** This bug has been marked as a duplicate of bug 317719 ***
Comment 3 Ayushman Jain CLA 2010-08-03 09:06:31 EDT
Verified for 3.7M1
Comment 4 Srikanth Sankaran CLA 2011-08-09 10:12:56 EDT
junit has been added as a part of the fix for bug 317719
Comment 5 Satyam Kandula CLA 2011-08-25 08:59:32 EDT
Verified for 3.7.1 RC2 using build M20110824-0800
Comment 6 Satyam Kandula CLA 2011-09-14 02:20:36 EDT
Verified for 3.8M2 using build I20110912-0800