Community
Participate
Working Groups
Hi! I do not know, whether this is an eclipse bug or not: Assume, you have the following interface: import java.util.Collection; import javax.swing.JLabel; public interface SuperInterface { public <A extends JLabel> void doIt(Collection<A> as); } and the following class, that inherits from the interface: import java.util.Collection; import javax.swing.JLabel; public class ProblemClass implements SuperInterface { public void doIt(Collection<? extends JLabel> as) { } } Eclipse 3.2RC7 does not recognize the implementing method as an implementation. It says, there is a name clash. ciao Volker
Created attachment 45450 [details] SuperInterface The given interface is in a package called "inheritance".
Created attachment 45451 [details] ProblemClass The given interface is in a package called "inheritance".
This is the intended behavior. Javac 1.6b88 agrees with us. Now I agree on the surface this is questionnable as a wildcard is usually considered to act as a type parameter when only referenced once... To avoid the problem, define instead the following, which will be somewhat equivalent. class ProblemClass implements SuperInterface { public <B extends JLabel> void doIt(Collection<B> as) { } } Added MethodVerifyTest#test095-096
Actually, tests are MethodVerifyTest#test096-097