> > Hello!
> >
[quoted text clipped - 32 lines]
> as an ordinary variable name either, even though
> it might do no harm.
I fear I stripped off too much code in my snippet. Now, the problem is
not visible any more. Here is a less reduced version of foo3:
public static <K, Integer> List<K> foo3(Map<K, Integer> map)
{
List<Integer> values = new ArrayList<Integer>();
for(Integer i : map.values())
values.add(i);
Collections.sort(values); // compiler error happens here
}
I found the problem now: it is caused by "public static <K, Integer>".
The compiler error disappears when it is changed to "public static
<K>". Just wanted to pass this on.
Regards, Oliver
Larry Barowski - 31 Oct 2004 05:42 GMT
> I fear I stripped off too much code in my snippet. Now, the problem is
> not visible any more. Here is a less reduced version of foo3:
[quoted text clipped - 10 lines]
> The compiler error disappears when it is changed to "public static
> <K>". Just wanted to pass this on.
This is the same problem I explained - you have used "Integer"
as a generic type parameter name.