zero ha scritto:
> The following quick test compiled without warnings for me.
Your code works without any warning.
I was suprised because your code is basically identical to mine (the
one which generated the warnings). But when I tried to split your code
in several files (a class per file) the warning appeared again!
I don't know why. It would be interesting to know.
> Alternatively, have you tried
> class FooCollection<T extends Foo<?>> extends HashSet<T>
Bingo!
That works even in the "splitted" layout.
Thank you for your help.
> This will tell the compiler you want a FooCollection of any type of Foo,
> and you don't care which type - but this is still type-checked, unlike
> the raw Foo in <T extends Foo>.
Yes. That's what I missed before :)
Thank you again
zero - 02 Nov 2005 18:47 GMT
"Lemon Tree" <lemontree75@gmail.com> wrote in news:1130948806.773789.264120
@g44g2000cwa.googlegroups.com:
> zero ha scritto:
>
[quoted text clipped - 6 lines]
>
> I don't know why. It would be interesting to know.
That is indeed surprising. I can't think of a reason that may be. Maybe
someone else here has an idea?
>> Alternatively, have you tried
>> class FooCollection<T extends Foo<?>> extends HashSet<T>
[quoted text clipped - 11 lines]
>
> Thank you again
My pleasure