Method cannot be private if called on subclass
Eclipse Plugin to find unused Java code
Brought to you by:
spj
Using UCdetector 1.3.0 on the following code, i get a marker for "bar" method, but if i change it to private, i can't compile any more...
public class TestCallSubClass {
void foo1() { // NO_UCD
bar();
}
void foo2() { // NO_UCD
bar();
}
void bar() {
subField.bar();
}
private final Sub subField = new Sub();
private class Sub extends TestCallSubClass {
}
}
The sub class doesn't override the method, only calling the method prevent the private modifier on it.
Anonymous
You are right. I will fix this bug for next version 1.5.0.
Ups, I did not manage to include it in version 1.5.0
I added a warnings in the settings dialog:
"Applying visibility warnings for classes or methods may cause compile errors"