mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
45 lines
1.0 KiB
HTML
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> |