Bug 326108 - Method has the same erasure as another method in type
Summary: Method has the same erasure as another method in type
Status: VERIFIED DUPLICATE of bug 317719
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-23 21:40 EDT by Carlos Ferreira CLA
Modified: 2011-09-14 11:32 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Ferreira CLA 2010-09-23 21:40:06 EDT
Build Identifier: I20100608-0911

Compiling below class in eclipse fails with error message "Method first(List<Number>) has the same erasure first(List<E>) as another method in type GenericsTest". It compiles and runs without issues using JDK 1.6.0_17

public class GenericsTest {

	public static Number first(List<Number> args) {
		return args.get(0);
	}

	public static String first(List<String> args) {
		return args.get(0);
	}

	public static void main(String[] args) {
		System.out.println(first(new ArrayList<Number>(Arrays
				.asList(new Integer[] { new Integer(1), new Integer(2) }))));

		System.out.println(first(new ArrayList<String>(Arrays
				.asList(new String[] { "one", "two" }))));
	}
}

Reproducible: Always

Steps to Reproduce:
1. Define JDK compliance level as 1.6 in eclipse
2. Create new class using above code.
Comment 1 Olivier Thomann CLA 2010-09-23 21:49:26 EDT
Srikanth, please review if this is indeed the same issue.
The code doesn't compile with javac 1.7 so this is likely the same problem.

*** This bug has been marked as a duplicate of bug 317719 ***
Comment 2 Srikanth Sankaran CLA 2010-09-24 00:17:20 EDT
Yes, this is a duplicate of bug 317719
Comment 3 Olivier Thomann CLA 2010-09-29 07:58:52 EDT
Verified.
Comment 4 Srikanth Sankaran CLA 2011-08-09 10:13:00 EDT
junit has been added as a part of the fix for bug 317719
Comment 5 Satyam Kandula CLA 2011-08-25 09:08:39 EDT
Verified for 3.7.1 RC2 using build M20110824-0800
Comment 6 Olivier Thomann CLA 2011-09-14 11:32:25 EDT
Verified for 3.8 M2