I have an interface
with a default
method and a private
method, where the private
method is called from the default
method.
When running Spotbugs, it issues an error that the private
method is never called: UPM_UNCALLED_PRIVATE_METHOD.
public interface Foo {
default boolean foo(int value1, int value2) {
return bar(value1 + value2);
}
private boolean bar(int value) {
return value == 0;
}
}
I'm doing something wrong or it's a Spotbugs issue?
Note 1: When modifying the private method to static
, it doesn't report the error.
Note 2: I've seen similar issues reported, but all are closed and related to class
instead of interface
.
UPDATE
A similar issue was recently reported on Github (#1988), but hasn't been solved yet.