Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330434 - Errors when use two or more methods with different generic parameters
Summary: Errors when use two or more methods with different generic parameters
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 3.7.1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-17 05:25 EST by Vladimir CLA
Modified: 2011-08-25 08:08 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir CLA 2010-11-17 05:25:10 EST
Build Identifier: 20100917-0705

The test code:

import java.util.List;

public class TestMain {

	public String getInfo(List<String> data) {
	    return "";
	}

	public String getInfo(List<Integer> data) {
	    return "";
	}
}


Eclipse doesn't compiles the code and outputs the error:
"Method getInfo(List<Integer>) has the same erasure getInfo(List<E>) as another method in type TestMain"

However java and Idea compile the code fine.

Reproducible: Always

Steps to Reproduce:
1. Write the code:
import java.util.List;

public class TestMain {

	public String getInfo(List<String> data) {
	    return "";
	}

	public String getInfo(List<Integer> data) {
	    return "";
	}
}
2. Try to run or compile it.
Comment 1 Olivier Thomann CLA 2010-11-17 08:48:42 EST

*** This bug has been marked as a duplicate of bug 317719 ***
Comment 2 Srikanth Sankaran CLA 2011-08-09 10:13:03 EDT
junit has been added as a part of the fix for bug 317719
Comment 3 Ayushman Jain CLA 2011-08-25 08:07:01 EDT
I think this was wrongly marked as dup. 

This is invalid because the given code neither compiles with java6 nor with java7. (and hence also not with ECJ in 1.6 or 1.7 compliances).
Comment 4 Ayushman Jain CLA 2011-08-25 08:08:31 EDT
Verified using build  M20110824-0800.