Field can be made 'static'
Reports instance variables that can safely be made static
. A field can be static if it is declared final
and initialized with a constant.
Example:
public final String str = "sample";
The inspection does not report final fields that can be implicitly written. Use the "Annotations" button to modify the list of annotations that assume implicit field write.
Inspection options
Option | Type | Default |
---|---|---|
Custom | None |
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for JVM 2023.3 |
Plugin: | Java, 233.SNAPSHOT |
Last modified: 13 July 2023