super
.
This is also known as a refused bequest. Such methods may represent a failure of abstraction and cause hard-to-trace bugs.
The inspection doesn't report default methods and methods overridden
from java.lang.Object
, except for clone()
.
The clone()
method is expected to call its super
, which will automatically return an object of the correct type.
Examples:
class A {
@Override
public Object clone() { // reported, because it does not call 'super.clone()'
return new A();
}
}
interface I {
default void foo() {}
}
class A implements I {
// warning on method when 'Ignore 'default' super methods' and 'Ignore annotated' options are disabled
@Override
public void foo(){}
}
Configure the inspection:
super
methods marked with the annotations
from the provided list. You can manually add annotations to the list.
super
methods that are either empty or only throw an exception.
super
methods with the default
keyword.