How can I properly declare the generic type of a static collection variable which contains Class objects for other collections?
private static final Set<Class<? extends Collection>> COLLECTION_TYPES
= new HashSet<Class<? extends Collection>>(
Arrays.asList(Set.class, List.class));
This compiles, but with a warning about the raw Collection type. If I change "Collection" to "Collection<?>" for both the variable type and constructor I get this error.
The constructor HashSet<Class<? extends Collection<?>>>
(List<Class<? extends Collection>>) is undefined
Edited by: Nick_Radov on Nov 20, 2009 4:47 PM
Edited by: Nick_Radov on Nov 20, 2009 4:47 PM