With Eclipse, given the following classes:
class Dao {
public void one() {}
public void two() {}
public void three() {}
}
class ServiceA {
Dao dao;
public void a() {
dao.one();
dao.two();
}
public void b() {
dao.one();
}
}
class ServiceB {
Dao dao;
public void z() {
dao.two();
dao.three();
}
}
... is it possible to see a list of all Dao
methods referenced from ServiceA
? I'm looking for one view that will show that ServiceA
uses one()
and two()
(don't mind it if one()
is listed twice).
I know how to see callers of one specific method. I really need a list of all methods referenced within a class. Think of legacy code orders of magnitude larger: dao and services that have tens (hundreds?) of methods. I don't feel like going through call hierarchy method by method.
Actually you can click by right mouse button at Dao method and then click at 'Open Call Hierarchy Ctrl+Alt+H' and Eclipse will find for you all Dao method calls.
Konrad Garus Jun 30 '11 at 7:37 said in a comment:
Yes, except for that I need it from the opposite side. See all methods called from Service, not all calls of Dao.conreteMethod().
– I need to create a new answer because I'll use two pictures to illustrate my point. (Cannot use images in comments)
'Ctrl+Alt+H' brings up call hierarchy, as has been mentioned here by other people.
Then you need to click on these icons, depending on what you need:
And
Edit:
What about VonC's answer here (it's the one with the saw-tooth-rimmed screenshot image inside)?
Here I've used CTRL-H to code-search for calls to Dao.one().
Result: In the search result view, there's another little icon "group by type).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With