The plugin reports Constructor makes call to non-final method when a constructor calls a private method.
Environment
- com.github.spotbugs version 5.0.13
- fb-contrib version 7.4.3.sb
- Gradle-based Java project, project has classes such as the one outlined below:
public class SomeClass {
private final String s;
public SomeClass(String s) {
doSomething();
this.s = s;
}
private void doSomething() {
...
}
}
Current Behavior
A bug (Constructor makes call to non-final method) is reported.
Expected Behavior
No bug is reported, as private methods are implicitly final and cannot be overridden, therefore do not pose an issue.
The plugin reports Constructor makes call to non-final method when a constructor calls a private method.
Environment
Current Behavior
A bug (Constructor makes call to non-final method) is reported.
Expected Behavior
No bug is reported, as private methods are implicitly final and cannot be overridden, therefore do not pose an issue.