| Summary: | [compiler]method "Name clash" errors are reported | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Christian Dupuis <christian> | ||||
| Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> | ||||
| Status: | VERIFIED DUPLICATE | QA Contact: | |||||
| Severity: | critical | ||||||
| Priority: | P3 | CC: | amj87.iitr, Olivier_Thomann, satyam.kandula, srikanth_sankaran | ||||
| Version: | 3.6.1 | ||||||
| Target Milestone: | 3.7.1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Christian Dupuis
Created attachment 181914 [details]
Sample Java class to reproduce
This was a bug in java 6 which has been fixed in java7. Eclipse's behaviour is correct and also consistent with java 7.
See that the attached file gives the following error when compiled with javac 7 ver. b76
C:\Documents and Settings\Administrator\My Documents\Downloads\MappedLinkedColle
ction.java:24: name clash: put(Key,Value) in MappedLinkedCollection and put(K,V)
in HashMap have the same erasure, yet neither overrides the other
public Collection<Value> put(Key k, Value v) {
^
where Key,Value,K,V are type-variables:
Key extends Object declared in class MappedLinkedCollection
Value extends Object declared in class MappedLinkedCollection
K extends Object declared in class HashMap
V extends Object declared in class HashMap
C:\Documents and Settings\Administrator\My Documents\Downloads\MappedLinkedColle
ction.java:33: name clash: get(Key) in MappedLinkedCollection and get(Object) in
LinkedHashMap have the same erasure, yet neither overrides the other
public Collection<Value> get(Key k) {
^
where Key,Value,V are type-variables:
Key extends Object declared in class MappedLinkedCollection
Value extends Object declared in class MappedLinkedCollection
V extends Object declared in class LinkedHashMap
2 errors
*** This bug has been marked as a duplicate of bug 317719 ***
Verified with I20101027-1800 Reverified for 3.7 RC0 using Build id: I20110428-0848 junit has been added as a part of the fix for bug 317719 Verified for 3.7.1 RC2 using build M20110824-0800 Verified for 3.8M2 using build id I20110912-0800 |