Possibly unintended overload of method from superclass
Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type.
In this case, the method in a subclass will be overloading the method from the superclass instead of overriding it. If it is unintended, it may result in latent bugs.
Example:
public class Foo {
void foo(int x) {}
}
public class Bar extends Foo {
void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,
// when overriding might have been intended
}- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
MethodOverloadsMethodOfSuperclass
Use the option to choose whether the inspection should also report cases where parameter types are not compatible.
Here you can find the description of settings available for the Possibly unintended overload of method from superclass inspection, and the reference of their default values.
You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:
//noinspection MethodOverloadsMethodOfSuperclassnote
Actual comment syntax will depend on the code language you are working with
More detailed instructions as well as other ways and options that you have can be found in the product documentation:
Inspection Details | |
|---|---|
By default bundled with: |