On 30 April 2013 21:54, Thomas Neidhart <[email protected]> wrote:

> On 04/30/2013 10:49 PM, sebb wrote:
> > I've just been looking at fixing generics warnings in the test code.
> >
> > There are no current warnings in the main code.
> >
> > However, I've just discovered that this is because the warnings have been
> > suppressed, regardless of whether that is justified or not.
> >
> > I think this needs to be fixed before a release; it's quite likely that
> > some API changes will be needed. In turn these may change the test code.
> >
>
> Well, we have to look at them case by case


Yes.


> I did not add a single
> SuppressWarning so far myself).


Me neither.


> Most of them are needed because of casts
> from Object to the actual generic type, e.g. when doing a clone.
>
> Perhaps, but I must admit I don't understand some of them.

For example in FunctorUtils:

    static <T> Closure<T> coerce(final Closure<? super T> closure){
        return (Closure<T>) closure;
    }

If the closure parameter is not of type T, surely the cast is bound to fail?
So why use <? super T> ?


> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to