org.sonar.l10n.java.rules.squid.S1258.html Maven / Gradle / Ivy
Non-abstract class
es and enum
s with non-static
,
private
members should explicitly initialize those members,
either in a constructor or with a default value.
Noncompliant Code Example
class A { // Noncompliant
private int field;
}
Compliant Solution
class A {
private int field;
A(int field) {
this.field = field;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy