Igor Vaynberg wrote:

i do like generics. did i ever say otherwise? the problem here is that
if we scope something as Class<? extends Component> then even though
you ARE using generics in your code you will still get a warning
because we did not scope the class as Class<? extends Component<?>>.

on the other hand if we do scope it as Class<? extends Component<?>>
then you can no longer pass a raw reference when calling the function.

But that's exactly the point isn't it? If you're using generics then you shouldn't be using raw Components anymore...

so we are screwed if we do and we are screwed if we dont, i expected
generics to be better.

Well they definitely could have been better (erasure is terrible if you ask me), but I don't see what's wrong in this case. It warns you if you should be using a parameterized type but you don't.

And especially if you look at the vote result, I think the majority wants
the generics...

that vote was before we uncovered this issue. we voted on the idea of
generics, not on the implementation.

That's true, but I wonder if this issue would change the vote much. I don't really understand why it's an issue, because you can use generified Components always: Component<Object> if you don't want to constrain the model object, and Component<Void> if you don't need a model.

The question that started the thread was about StringResourceModel which was not yet generified, and in that case, the warning seems to me to be perfectly ok: it just says StringResourceModel should be generified. It's not a release yet, so that some users who use the current snapshot run into these kind of warnings which cannot be removed seems to be fine to me...

Regards,
Sebastiaan

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to