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

Bug 330434

Summary: Errors when use two or more methods with different generic parameters
Product: [Eclipse Project] JDT Reporter: Vladimir <vladimir.mk.ua>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: VERIFIED INVALID QA Contact:
Severity: major    
Priority: P3 CC: amj87.iitr, Olivier_Thomann, srikanth_sankaran, vladimir.mk.ua
Version: 3.7   
Target Milestone: 3.7.1   
Hardware: PC   
OS: Linux   
Whiteboard:

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.