Static field may not be initialized
Reports static
variables that may be uninitialized upon class initialization.
Example:
class Foo {
public static int bar;
static { }
}
Note that this inspection uses a very conservative dataflow algorithm and may incorrectly report static
variables as uninitialized. Variables reported as initialized will always be initialized.
Use the Ignore primitive fields option to ignore uninitialized primitive fields.
Inspection options
Option | Type | Default |
---|---|---|
Ignore primitive fields | Checkbox | false |
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for JVM 2023.3 |
Plugin: | Java, 233.SNAPSHOT |
Last modified: 13 July 2023