A class names a supertype it has anyway, such as extends Object or an interface its superclass in this file already implements
What it finds
Every class extends Object, and a class has every interface of its superclass. Naming them again adds nothing and suggests a difference that is not there.
Reported is extends Object, an interface named twice, and an interface also implemented by the superclass when that superclass is declared in this file.
From the rule's source, redundant_supertype.rs.
import java.io.Serializable; class Base implements Serializable {}class Child extends Base implements Serializable {}tx0 reports: already implementsclass Plain extends Object {}tx0 reports: extends Objectclass Twice implements Runnable, Runnable {tx0 reports: named twice public void run() {}} Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/java:repeated-supertype" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/java:repeated-supertype] reason="..."tx0 explain tx0/java:repeated-supertype shows the same in the terminal. Found a false positive? Report it.