[go: up one dir, main page]

Menu

#45 Method cannot be private if called on subclass

1.3.0
open
5
2012-07-19
2010-01-05
Anonymous
No

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.

Discussion

  • Joerg Spieler

    Joerg Spieler - 2010-01-05

    You are right. I will fix this bug for next version 1.5.0.

     
  • Joerg Spieler

    Joerg Spieler - 2010-06-10

    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"

     

Anonymous
Anonymous

Add attachments
Cancel