Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 379794 - Strange "same erasure" error
Summary: Strange "same erasure" error
Status: VERIFIED DUPLICATE of bug 317719
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.8 RC2   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-17 07:53 EDT by Szymon Ptaszkiewicz CLA
Modified: 2012-05-29 08:58 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 Szymon Ptaszkiewicz CLA 2012-05-17 07:53:55 EDT
The following test case gives three different results for different Eclipse versions:
 - 3.4.2: no error, no warning
 - 3.6.2: 2 errors about "same erasure"
 - latest 3.8 I-build: 2 warnings about "same erasure"

The same test case can be compiled with no errors on IBM JDK 1.6 without any problem. Is there anything wrong in this test case or this is a bug in compiler?

--------------%<------------------
import java.util.List;

public class X {
	public String a(List<Integer> b) {
		return null;
	}

	public Integer a(List<String> b) {
		return null;
	}
}
--------------%<------------------
Comment 1 Srikanth Sankaran CLA 2012-05-17 08:22:58 EDT
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=317719.
JDK7 refuses to compile the program.

*** This bug has been marked as a duplicate of bug 317719 ***
Comment 2 Szymon Ptaszkiewicz CLA 2012-05-17 08:32:42 EDT
Thanks, Srikanth. Does it mean that this is a bug in JDK6 that was fixed in JDK7? If yes, then Eclipse correctly shows error when compliance level is set to 1.6, right?
Comment 3 Srikanth Sankaran CLA 2012-05-17 21:48:13 EDT
(In reply to comment #2)
> Thanks, Srikanth. Does it mean that this is a bug in JDK6 that was fixed in
> JDK7? If yes, then Eclipse correctly shows error when compliance level is set
> to 1.6, right?

Yes, this is a bug in JDK6 that was fixed in JDK7. Eclipse's reaction
has been to make it an error in 1.7 mode while issuing a warning in
1.6 mode (to alert users of future trouble lurking there)
Comment 4 Ayushman Jain CLA 2012-05-29 08:58:46 EDT
Verified for 3.8RC2 using build I20120527-2100