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

47 lines
1.1 KiB
HTML

<html>
<body>
Reports calls to a simple property getter from within the property's class.
<p>
A simple property getter is defined as one which simply returns the value of a field,
and does no other calculations. Such simple getter calls can be safely inlined using the quick-fix.
Some coding standards also suggest against the use of simple getters for code clarity reasons.
</p>
<p><b>Example:</b></p>
<pre><code>
public class Salient {
private String name;
public String getName() {
return name;
}
@Override
public String toString() {
return getName();
}
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
public class Salient {
private String name;
public String getName() {
return name;
}
@Override
public String toString() {
return name;
}
}
</code></pre>
<!-- tooltip end -->
<p>Use the following options to configure the inspection:</p>
<ul>
<li>Whether to only report getter calls on <code>this</code>, not on objects of the same type passed in as a parameter.</li>
<li>Whether to ignore non-<code>private</code> getters.</li>
</ul>
</body>
</html>