Here is an example of some code I'm working on:
public interface FooMaker<T extends Enum<T> & FooType>
{
public List<Foo<T>> getFoos(String bar);
}
Let's further assume there will be many different concrete implementations of FooMaker. So I wrote some code to utilize the FooMakers.
FooMaker<?> maker = Foos.getRandomMaker();
List<Foo<?>> fooList = maker.getFoos("bar"); //error here!
The second line of code causes the issue, eclipse tells me the code should be:
FooMaker<?> maker = Foos.getRandomMaker();
List<?> fooList = maker.getFoos("bar");
I'm having trouble understanding why the Foo declaration as the parameterized type in List has to go away to make the return type correct.
Any ideas?