mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
27 lines
949 B
HTML
27 lines
949 B
HTML
<html>
|
|
<body>
|
|
Reports methods with the same signature as an inaccessible method of a superclass,
|
|
for example, a private method, or a package-private method of a superclass in another package.
|
|
<p>
|
|
Such method names may be confusing because the method in the subclass may look like an override when in fact
|
|
it hides the inaccessible method of the superclass.
|
|
Moreover, if the visibility of the method in the superclass changes later,
|
|
it may either silently change the semantics of the subclass or cause a compilation error.
|
|
</p>
|
|
<p>A quick-fix is suggested to rename the method.</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
public class Super {
|
|
private void test() {
|
|
}
|
|
}
|
|
|
|
public class Sub extends Super {
|
|
void test() { // making 'Super.test()' public causes a compilation error
|
|
// making 'Super.test()' package-private makes 'Sub.test()' an override
|
|
}
|
|
}</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
</body>
|
|
</html> |