score:1

although your warning message are inconsistent for some reason (you should get warnings on both), the fix for your situation is to change:

public <t extends ball> ballcontroller<t> getballcontroller(t ball) {

to

public <t extends ball> ballcontroller<?> getballcontroller(t ball) {

and remove the casts:

        return (ballcontroller<t>) getbaseballcontroller();
        return (ballcontroller<t>) someotherclass.getfootballcontroller();

like:

        return getbaseballcontroller();
        return someotherclass.getfootballcontroller();

Related Query

More Query from same tag