Files
openide/java/java-impl/resources/inspectionDescriptions/MethodOverloadsParentMethod.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

25 lines
836 B
HTML

<html>
<body>
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.
<p>
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.
</p>
<p><b>Example:</b></p>
<pre><code>
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
}
</code></pre>
<!-- tooltip end -->
<p>
Use the option to choose whether the inspection should also report cases where parameter types are not compatible.
<p>
</body>
</html>