This tutorial belongs to Eclipse JDT Tutorial Series.
I will explore how we can compute fan in i.e. find all the methods that call a particular method (all callers of a method).
In Eclipse, one can right click on a method and choose “open call hierarchy” and eclipse shows all the methods that call the selected method and all the methods that are called from the selected method (callers and callees of the selected method).
We can programtically find callers and callees and I will explain how I have done it.
There are a couple of different ways that I know:
- Use the eclipse JDT internal classes : these are the same classes used by eclipse to show the callers and callees of a method
- Use the eclipse ast visitor