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

30 lines
999 B
HTML

<html>
<body>
Reports unnecessary local variables that add nothing to the comprehensibility of a method, including:
<ul>
<li>Local variables that are immediately returned.</li>
<li>Local variables that are immediately assigned to another variable and then not used.</li>
<li>Local variables that always have the same value as another local variable or parameter.</li>
</ul>
<p><b>Example:</b></p>
<pre><code>
boolean yes() {
boolean b = true;
return b;
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
boolean yes() {
return true;
}
</code></pre>
<!-- tooltip end -->
<p>Configure the inspection:</p>
<ul>
<li>Use the <b>Ignore immediately returned or thrown variables</b> option to ignore immediately returned or thrown variables.
Some coding styles suggest using such variables for clarity and ease of debugging.</li>
<li>Use the <b>Ignore variables which have an annotation</b> option to ignore annotated variables.</li>
</ul>
</body>
</html>