setColor is redundant and only calls super.setColor, consider removing it
11 }
12
13 @Override
14 public void setColor(CardColor color) {15 super.setColor(color);16 }17
18 @Override
19 public boolean isPlayable(Card card) {
setColor is redundant and only calls super.setColor, consider removing it
9 }
10
11 @Override
12 public void setColor(CardColor color) {13 super.setColor(color);14 }15
16 @Override
17 public boolean isPlayable(Card card) {
play is redundant and only calls super.play, consider removing it
24 }
25
26 @Override
27 public void play(Game game, Player player) {28 super.play(game, player);29 }30
31}
setColor is redundant and only calls super.setColor, consider removing it
8 super(CardType.SKIP, color);
9 }
10 @Override
11 public void setColor(CardColor color) {12 super.setColor(color);13 }14
15 @Override
16 public boolean isPlayable(Card card) {
Description
This method appears to only call its superclass implementation, while directly passing its parameters to the super method. This method can be removed, as it provides no additional value.
Bad Practice
@Override
public String getName() {
return super.getName();
}
This getName
method is redundant, since the same behavior would occur even without explicitly overriding the parent method.
Recommended
Remove the redundant overriding method. If this was not intended, and there is further logic to be implemented, consider marking this method with a TODO
comment to ensure it is not missed in future work.
@Override
public String getName() {
// TODO: this method requires extra logic to be implemented.
return super.getName();
}
References
- SpotBugs - USM_USELESS_SUBCLASS_METHOD