After years of programming in Java I still don't understand this!
The top level class is defined
public abstract class GenericCache<K, T, P> {
public ArrayList<T> getAll() {}
public T getSafe(K a_id) {}
}
The subclass is
public class SKUTypeCache<T extends SKUType, P> extends GenericCache<Integer, T, P> {
}
When I try to use it
SKUTypeCache l_cache = getTheCache();
for (SKUType t : l_cache.getAll()) {
}
I get the compile error: "incompatible types: Object cannot be converted to SKUType" on the for loop. Why? I have a similar issue using getSafe().