I'm using a HashMap and the method show below to track change listeners for class types. The IDE is giving a warning
[rawtypes] found raw type: java.lang.Class
missing type parameters for generic class java.lang.Class<T>.
What type for Class needs to be specified to resolve the warning?
private HashMap<Class, Set<ChangeListener>> classChangeListeners;
/**
* Adds a ChangeListener to the listener list for the specified class type. The class type
* specified must be a subclass of {@link BusinessObject}.
*
* @param <T> the type of BusinessObject.
* @param cls the class type.
* @param listener the ChangeListener to be added.
*/
public <T extends BusinessObject> void addChangeListener(Class<T> cls, ChangeListener listener)
{
if (!classChangeListeners.containsKey(cls))
{
classChangeListeners.put(cls, new TreeSet<ChangeListener>());
}
classChangeListeners.get(cls).add(listener);
}