RE: [classlib] generics puzzler (was: Re: Thanks Stepan! (was: Re: [jira] Resolved: (HARMONY-454) [classlib][luni] java.util.Set generics uplift and related changes))

2006-05-31 Thread Nathan Beyer
ison [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 11, 2006 3:30 AM > To: harmony-dev@incubator.apache.org > Subject: [classlib] generics puzzler (was: Re: Thanks Stepan! (was: Re: > [jira] Resolved: (HARMONY-454) [classlib][luni] java.util.Set generics > uplift and related changes)) >

[classlib] generics puzzler (was: Re: Thanks Stepan! (was: Re: [jira] Resolved: (HARMONY-454) [classlib][luni] java.util.Set generics uplift and related changes))

2006-05-11 Thread Tim Ellison
But the question remains in my mind whether there is any generic type definition you could write that would allow you to cast the entrySet() to a "Set>" equivalent? To put it another way, I would expect that for (Map.Entry entry : map.entrySet()) should complain that the declaration of '

Re: Thanks Stepan! (was: Re: [jira] Resolved: (HARMONY-454) [classlib][luni] java.util.Set generics uplift and related changes)

2006-05-11 Thread Neil Bartlett
Nathan, It's a tricky one to be sure. The problem is that the entrySet() method is returning a "Set>", which is incompatible with the type "Set>". It's easier to describe why if I drop the "extends K" and "extends V" part. So we have "Set" and "Set>". The first one, "Set>" is a set of Map.Entri

Re: Thanks Stepan! (was: Re: [jira] Resolved: (HARMONY-454) [classlib][luni] java.util.Set generics uplift and related changes)

2006-05-10 Thread Stepan Mishura
On 5/10/06, Tim Ellison wrote: Stepan Mishura (JIRA) wrote: > 2) To avoid casting while-loop was replaced with for-loop. Could you review the change? I was scratching my head about this cast, so I was very pleased to see your elegant solution. I must admit that I don't really understand why t

RE: Thanks Stepan! (was: Re: [jira] Resolved: (HARMONY-454) [classlib][luni] java.util.Set generics uplift and related changes)

2006-05-10 Thread Nathan Beyer
Does someone understand why this works this way? This seems so odd. I know there are quirks to the generics syntax, but this in an edge I haven't run into yet. I haven't been able to make this one click in my head yet. This compiles fine: public synchronized void putAll(Map map) {