mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
35 lines
711 B
HTML
35 lines
711 B
HTML
<html>
|
|
<body>
|
|
Reports non-final fields in enumeration types.
|
|
Non-final fields introduce global mutable state, which is generally considered undesirable.
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
enum Enum {
|
|
FIRST("first"),
|
|
SECOND("second");
|
|
|
|
public String str;
|
|
|
|
Enum(String str) {
|
|
this.str = str;
|
|
}
|
|
}
|
|
</code></pre>
|
|
<p>After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
enum Enum {
|
|
FIRST("first"),
|
|
SECOND("second");
|
|
|
|
public final String str;
|
|
|
|
Enum(String str) {
|
|
this.str = str;
|
|
}
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
Use the `Ignore fields that cannot be made 'final'` option to only warn on fields
|
|
that can be made final using the quick-fix.
|
|
</body>
|
|
</html> |