org.sonar.l10n.java.rules.squid.S2039.html Maven / Gradle / Ivy
The newest version!
Failing to explicitly declare the visibility of a member variable could result it in having a visibility you don't expect, and potentially leave it open to unexpected modification by other classes.
Noncompliant Code Sample
class Ball {
String color="red"; // Noncompliant
}
enum A {
B;
int a;
}
Compliant Solution
class Ball {
private String color="red"; // Compliant
}
enum A {
B;
private int a;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy