Java 7
I had an interface:
public interface MyInt{
public Map<String, WhereClause> createClauses(Parameters<Object> params);
}
and some of its implementations:
public class MyImpl implements MyInt{
@Override
public Map<String, WhereClause> createClauses(Parameters<Object> p) {
}
}
Now I could make its return type be generic. I tried this:
public interface MyInt <T extends SomeType>{
public Map<String, ? extends WhereClause> createClauses(Parameters<Object> params);
}
But I got a compile-time error in the implementation in //1
:
The method createClauses(Parameters<Object>) of type `MyImpl` must
override or implement a supertype method
But when I remove Generation, the implementation compiles fine.
Why generation influences compilation even though it is not used type parameter
.
source
share