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

org.sonar.l10n.java.rules.squid.HiddenFieldCheck.html Maven / Gradle / Ivy

There is a newer version: 8.9.0.37768
Show newest version

Shadowing fields with a local variable is a bad practice that reduces code readability: It makes it confusing to know whether the field or the variable is being used.

Noncompliant Code Example

class Foo {
  public int myField;

  public void doSomething() {
    int myField = 0;
    ...
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy