5

I have two method methodA and methodB, and I want to find the call paths from methodA to methodB, if any.

Eclipse and IntelliJ has function to find call hierarchy. However, I need to expand the calling relation one level at a time. When projects become complex, it is time-consuming. (it is like doing a BFS manually.)

This is useful in some senarios: For example, methodA may be the doPost() method in a servlet, while methodB is a method in an arbitrary class. I am assigned to do some bug fix on methodB, but I am not familiar with the entire project which is done by a large team. So I want to find the calling path (methodA -> method1->method2-> ... -> methodB) to quickly get an idea of the overall control flow, as well as checking whether some resource used in methodB is thread safe.

modeller
  • 3,770
  • 3
  • 25
  • 49
  • I'm not sure if you're only looking for programmatic solutions, but I believe Sublime Text may have a similar feature to what you are looking for. – Barney Chambers Apr 05 '17 at 06:09
  • You probably want the [call hierarchy](http://stackoverflow.com/questions/4650021/more-intelligent-eclipse-open-call-hierarchy) in eclipse. There is similar functon in Netbeans. Don't know Intellik (well I know Android Studio which is the same) and there is a similar but can't remember the name of it – AxelH Apr 05 '17 at 06:43
  • @CarlosHeuberger I don't know how I missed that line ... Well, instedd, the debugging tool would give a complete call stack but this need to be executed in the specific way to get this method used. Not possible in every case but for a bugfix, I hope you can reproduce the bug so this would do it. So add the breakpoint in the methodB. Edit . Not sure of the look of a call stack in the case of a redirection in a Servlet – AxelH Apr 05 '17 at 08:25

0 Answers0