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

45 lines
1.0 KiB
HTML

<html>
<body>
Reports local variables or parameters unnecessarily declared <code>final</code>.
<p>Some coding standards frown upon variables declared <code>final</code> for reasons of terseness.</p>
<p><b>Example:</b></p>
<pre><code>
class Foo {
Foo(Object o) {}
void bar(final Object o) {
new Foo(o);
}
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
class Foo {
Foo(Object o) {}
void bar(Object o) {
new Foo(o);
}
}
</code></pre>
<!-- tooltip end -->
<p>
Use the inspection options to toggle the reporting for:
</p>
<ul>
<li>
local variables
</li>
<li>
parameters (including
parameters of <code>catch</code> blocks and enhanced <code>for</code> statements)
</li>
</ul>
<p>
Also, you can configure the inspection to only report <code>final</code> parameters of <code>abstract</code> or interface
methods, which may be considered extra unnecessary as such markings don't
affect the implementation of these methods.
</p>
</body>
</html>