0

I would like to list all callers of method from parent interface only, but I cannot find such a feature in both Eclipse and IntelliJ, Anyone can advise?

< Current Limitation > Both Eclipse and Intellij's show usage/call hierarchy/show reference will list all callers to child interfaces and parent interface

< Workaround > My current workaround is just to rename the method name and check compile errors on caller. But it only works when parent and child interface has the same method, so that callers to parent method will have error while callers to child's will not.

e.g. interface B extends interface A

A has doX() method, B might have doX() method, too.

Given methodC() calls A.doX(), methodD() calls B.doX()

Requirement: list only methodC()

Thanks a lot : )

Jim Horng
  • 1,587
  • 1
  • 13
  • 23

1 Answers1

0
public interface A {
    void doX();
}

Now B,

public interface  B extends A{
    void doX(); // this will override method in A
}

This may help you to figure out issue in your case.

Ruchira Gayan Ranaweera
  • 34,993
  • 17
  • 75
  • 115
  • Ruchira, maybe I was not stating clearly. I mean how to find caller of A.doX() of existing interface A. :) – Jim Horng Aug 24 '13 at 02:12