Community
Participate
Working Groups
The code above doesn't compile with eclipse but compiles with javac (1.6 b99). public class Join { abstract class C<A extends CharSequence,B> { abstract void m(A a); public void m(B b) { } } class D extends C<String,String> { } } The eclipse seems to report the error too early : Duplicate methods named m with the parameters (B) and (A) are defined by the type Join.C<String,String> java-patch/src Join.java line 10 The eclipse doesn't report an error if the two methods are specified in an interface so a possible workaround is to insert a fake interface : public class Join { interface Fake<A extends CharSequence,B> { public void m(A a); public void m(B b); } abstract class C<A extends CharSequence,B> implements Fake<A,B>{ public void m(B b) { } } class D extends C<String,String> { } } Rémi Forax
We shouldn't complain about duplicates when a concrete method implements abstract methods because of type variable substitution. Added MethodVerifyTest 120 Released for 3.3 M5 in HEAD stream
Verified for 3.3M5 using I20070205-0009.
I've come across a similar problem which might be the same bug. I don't want to create a new bug if it is. My code: public class Foo<V, E> { public int getThing(V v) { return 1; } public boolean getThing(E e) { return true; } } public class Bar<V,E> extends Foo<V,E> { } The error is: Duplicate methods named getThing with the parameters (E) and (V) are defined by the type Foo<V,E> Is it the same?
Its definitely similar but not a duplicate of this bug. Please open a new bug. thx