According to this entry in the Java Generics FAQ, there are some circumstances where a generic method has no equivalent non-generic method that uses wildcard types. According
Guess: The thing representing the first ? (ArrayList) does not 'implement' ArrayList
(by virtue of the double nested wildcard). I know this sounds funny but....
Consider (for the original listing):
void g(Class extends Iterable
And
// Compiles
public class Test{
> void f(ArrayList x) {}
void g(ArrayList extends Iterable>> x) {}
void d(){
ArrayList> d = new ArrayList>();
f(d);
g(d);
}
}
This
// Does not compile on g(d)
public class Test{
> void f(ArrayList x) {}
void g(ArrayList extends Iterable>> x) {}
void d(){
ArrayList d = new ArrayList();
f(d);
g(d);
}
}