All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.java.rules.java.S1258.html Maven / Gradle / Ivy

There is a newer version: 8.10.0.38194
Show newest version

Why is this an issue?

Non-abstract classes and enums 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;
  }
}

Exceptions





© 2015 - 2025 Weber Informatics LLC | Privacy Policy