The project I'm working on has this method (in abbreviated form):
public <T> T query(
final Extractor<T> extractor, final List result) {
return extractor.extract(result)
}
using an Extractor defined as:
public interface Extractor<T> {
T extract(List<Map<String, Object>> result);
}
There is no error in Eclipse, but IntelliJ refuses to compile the class with Incompatible types: Required: T Found: Object, the only way is if I return the return value of T or return Object, and I cannot understand why this is otherwise.
source
share