There are several simple test-case classes:
public interface ListCriteria<T> {
// some stuff here
}
public class UserListCriteria implements ListCriteria<User> {
// implementation
}
public interface Editor<T> {
// sample method 1
List<T> listObjectsTest1(ListCriteria<T> criteria);
// sample method 2
<L extends ListCriteria<T>> List<T> listObjectsTest2(L criteria);
}
And there is an implementation of Editor which Java thinks it does not provide necessary implementation for both sample methods:
public class UserEditor implements Editor<User> {
@Override
public List<User> listObjectsTest1(UserListCriteria criteria) {
//
}
@Override
public List<User> listObjectsTest2(UserListCriteria criteria) {
//
}
}
Both method implementations are wrong. The question is why. Especially for the latter method.
Sure I could do interface Editor<T, L extends ListCriteria<T>>, and that would solve the issue, but I don't want to, I want to understand why I can't use method-level generics here.