Here's the sample code:
public static BaseListAdapter<? extends Item> getListAdapter() {
...
}
...
public class MyClass<T extends Item> {
...
BaseListAdapter<T> adapter = (BaseListAdapter<T>) getListAdapter();
...
}
The compiler complains that there's an unchecked cast.
java: unchecked cast
need: BaseListAdapter<T>
found: BaseListAdapter<capture#1, ? extends Item>
I want to know why this warning is produced and how to resolve it.