generics不起作用的覆盖方法(未找到方法)

我试图@Override类中的方法可能看起来像一个复杂的inheritance结构,但它实际上应该很简单,但我不能让它工作。

 public interface Action { } public interface Result { } public interface Player { default public <P extends Player> void onPostAction(final P target, final A action, final R result) { } } abstract public class GesturePlayer implements Player { } abstract public class RPSPlayer extends GesturePlayer { } public class RPSHumanPlayer extends RPSPlayer { @Override public void onPostAction(final RPSPlayer target, final RPSGesture gesture, final RPSResult result) { } } 

我在onPostAction上得到错误,为什么找不到正确的覆盖方法?

这是一个Rock-Paper-Scissors实现,让人们想知道这个名字的来源。

确切的错误消息:

方法不会覆盖或实现超类型的方法

我的目标是仍然使用当前的类,因此对于RPSHumanPlayer我实际上想要这个签名:

 public void onPostAction(final RPSHumanPlayer target, final RPSGesture gesture, final RPSResult result) { }