Possible duplicate:
Java Generics, how to avoid unchecked task warning when using class hierarchy?
Intellij gives me a warning below. Not sure how to solve it, or even if I need to solve it. The warning information says that this only applies to JDK 5, and I'm using 6. I'm wondering if I need to respond to this, and if so, how?
Method call
List<T> refObject = cache.getCachedRefObject(cacheKey, List.class);
Method called
public <T> T getCachedRefObject(String objectKey, Class<T> type) { return type.cast(refObjectCache.get(objectKey)); }
Warning Information
Unchecked Assignment JDK 5.0 only. Signals places where an unchecked warning is issued by the compiler, for example: void f(HashMap map) { map.put("key", "value"); }
source share