Java
Redundant field initialization
Warning
New
Last modified: 03 December 2024Reports fields explicitly initialized to their default values.
Example:
class Foo {
int foo = 0;
List bar = null;
}
After the quick-fix is applied:
class Foo {
int foo;
List bar;
}
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
RedundantFieldInitialization
Use the inspection settings to only report explicit null
initialization, for example:
class Foo {
int foo = 0; // no warning
List bar = null; // redundant field initialization warning
}
Here you can find the description of settings available for the Redundant field initialization inspection, and the reference of their default values.
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Java, 243.23126 |
Thanks for your feedback!
Was this page helpful?