mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
35 lines
1.1 KiB
HTML
35 lines
1.1 KiB
HTML
<html>
|
|
<body>
|
|
Reports fields in a derived class that are named identically a field of a superclass.
|
|
Java fields cannot be overridden in derived classes,
|
|
so the field in the derived class will hide the field from the superclass.
|
|
<p>
|
|
As a result of such naming, you may accidentally use the field of the derived class
|
|
where the identically named field of a base class is intended.
|
|
</p>
|
|
<p>A quick-fix is suggested to rename the field in the derived class.</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>class Parent {
|
|
Parent parent;
|
|
}
|
|
class Child extends Parent {
|
|
Child parent;
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
You can configure the following options for this inspection:
|
|
</p>
|
|
<ol>
|
|
<li>
|
|
<strong>Ignore non-accessible fields</strong> - indicates whether this inspection should report all name clashes,
|
|
or only clashes with fields which are visible from the subclass.
|
|
</li>
|
|
<li>
|
|
<strong>Ignore static fields hiding static fields</strong> - ignore <code>static</code> fields
|
|
which hide <code>static</code> fields in base classes.
|
|
</li>
|
|
</ol>
|
|
|
|
</body>
|
|
</html> |