Open fullben opened 1 year ago
The plugin reports Constructor makes call to non-final method when a constructor calls a private method.
public class SomeClass { private final String s; public SomeClass(String s) { doSomething(); this.s = s; } private void doSomething() { ... } }
A bug (Constructor makes call to non-final method) is reported.
No bug is reported, as private methods are implicitly final and cannot be overridden, therefore do not pose an issue.
does doSomething call public methods in the class?
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.