commons-user mailing list archives

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

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?

TIA

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