mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
40 lines
1.1 KiB
HTML
40 lines
1.1 KiB
HTML
<html>
|
|
<body>
|
|
Reports calls to a simple property setter from within the property's class.
|
|
<p>
|
|
A simple property setter is defined as one which simply assigns the value of its parameter to a field,
|
|
and does no other calculations. Such simple setter calls can be safely inlined.
|
|
Some coding standards also suggest against the use of simple setters for code clarity reasons.
|
|
</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
class Foo {
|
|
private int index;
|
|
public Foo(int idx) {
|
|
setIndex(idx);
|
|
}
|
|
public void setIndex(int idx) {
|
|
index = idx;
|
|
}
|
|
}
|
|
</code></pre>
|
|
<p>After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
class Foo {
|
|
private int index;
|
|
public Foo(int idx) {
|
|
index = idx;
|
|
}
|
|
public void setIndex(int idx) {
|
|
index = idx;
|
|
}
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>Use the following options to configure the inspection:</p>
|
|
<ul>
|
|
<li>Whether to only report setter 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> setters.</li>
|
|
</ul>
|
|
</body>
|
|
</html> |