commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "António Mota" <>
Subject MultiValueMap collections not type safe?
Date Fri, 31 Aug 2007 17:00:36 GMT

My first post in here, so bare with me...

I was trying to do something like this:

private static MultiValueMap mapValidators = MultiValueMap.decorate(new
> Hashtable<Class<?>, HashSet<Validator>>(), HashSet.class);

in order to use a Hashtable as a Map so it gets synchronized, and a HashSet
as Collection so i don't get duplicates. Later on the code i

    for (Class<?> keyClass : mapValidators.keySet()) {
>         mapValidators.getCollection(keyClass).remove(validator);
>     }
 but this gives me

Type mismatch: cannot convert from element type Object to Class<?>
So it seems MultiValueMap is not type safe? Or am I doing something wrong?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message