Tuesday, July 26, 2011

Is this a Design issue or Eclipse's issue or Java's loophole

Let us have the following classes defined in eclipse's work space:

public abstract class A {
public void foo() {
System.out.println("Hi.. this is foo()");
}
}

public interface I {
void foo();
}

public class B extends A implements I {
public void bark() {
System.out.println("Hi.. this is bark()");
}
}

public class C {
public void woo() {
I i = new B();
i.foo();
}
}

Now the problem is eclipse doesn't show any references for A.foo() on searching through
References -> Project or
References - Hierarchy

I see this a design issue. What do you think? Please post your comment on this.