Bug 83162 - Eclipse reports no name clash with equivalent bridge methods
Summary: Eclipse reports no name clash with equivalent bridge methods
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-19 04:17 EST by Markus Keller CLA
Modified: 2005-02-16 06:37 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2005-01-19 04:17:38 EST
Eclipse reports no name clash with equivalent bridge methods. The bridge method
equalTo(Object) cannot be:
    public boolean equalTo(String other) {
        return equalTo((String)other);
    }
, nor:
    public boolean equalTo(Integer other) {
        return equalTo((Integer)other);
    }
.

--------------------------------------------------
interface Equivalent<T> {
	boolean equalTo(T other);
}

interface EqualityComparable<T> {
	boolean equalTo(T other);
}

class SomeClass implements Equivalent<String>, EqualityComparable<Integer> {
// javac says:
// name clash: equalTo(T) in trying.Equivalent<java.lang.String> and equalTo(T)
// in pack.EqualityComparable<java.lang.Integer> have the same erasure, yet
// neither overrides the other
	public boolean equalTo(String other) {
		return true;
	}
	public boolean equalTo(Integer other) {
		return true;
	}
}
Comment 1 Kent Johnson CLA 2005-02-01 11:53:01 EST
Added MethodVerify test036
Comment 2 David Audel CLA 2005-02-16 06:37:23 EST
Verified in I20050215-2300