I have a static method in my base class:
private static <T extends BaseClass<? super T>> T getIt(Class<T> theClass, T obj)
{ ... }
I want to have an instance method in the base class that can pass this
to that method:
public <T extends BaseClass<? super T>> T getSelfChanged()
{
T changedSelf = getIt( getClass(), this );
}
But the use ofthis
throws the error:
Wrong 2nd argument type. Found BaseClass<T> required "? extends BaseClass"
Trying to cast it, doesn't work either:
//DOESN'T WORK
T changedSelf = getIt( getClass(), ( T ) this );
How do I make this work?