1

I have some large corporate Spring project unknown for me and I need to perform this kind of task above it:

"I have method A and method B. During the execution of method A, can method B be called?"

Well I found there is function Method Call Hierarchy in IntelliJ Idea. I can perform this function on method B and generate call hierarchy, where I can perform serarch for method A. Unfortunatelly, IntelliJ freeze during computing of this hierarchy becouse its so large and crashed after 5 hours of working.

I need Method Call Hierarchy utility with better performance than IntelliJ Idea have but I failed to find it. Can you help me?

5
  • 1
    Do you really need the full hierarchy, though? Chances are you can get a decent idea of what's what by navigating with 'find definition' and 'find usages'. Additionally, I think IntelliJ can show you dependencies between packages which is probably a better overall start. Commented Apr 1, 2017 at 20:19
  • I minimalized scope of call hierarchy as much as I can, to the minimum set of modules which I'm interesting it. I can't imagine to perform manual search even with Find Usages function. That extra size of call hierarchy tree above method B that even IntellJ freeze is proof how complex/complicated this project is :/ Commented Apr 1, 2017 at 20:24
  • Wait, are you saying it OOMs on a single 'find usages'? Also, have you tried giving it more memory? Commented Apr 1, 2017 at 20:28
  • Method call hierarchy is in fact "Find Usages above Find Usages above Find Usages etc.". It not crash during single Find Usages above method B, but after lets say 12th layer of Find Usages. I try to run IntelliJ Idea with 4096MB of memory, but it didn't crash becouse of low memory. I have been mnitoring performance during comuping process and method call hierarchy in Idea run only above one thread (which is veeery slow) and memory consumption by Idea before crash have been around 1700MB. Commented Apr 1, 2017 at 20:35
  • 1
    Well. You can take a look at this answer stackoverflow.com/questions/4951517/… for some other tools. Commented Apr 1, 2017 at 20:41

3 Answers 3

1

Consider using AOP functionality for method interception and execution path modification. Spring AOP support may be enough for this. this and this questions may help

Sign up to request clarification or add additional context in comments.

1 Comment

Question is really about static analysis not runtime instrumentation
0

try alt + f7, or also use debugger to use call sequence.

1 Comment

alt + f7 - Find Usages is exactly what the Call Method Hierarchy perform above each layer of method call hierarchy tree. It's the same and it can't help me finish my task becouse that project is really complicated.
0

A workaround may be to use the Debugger. Set breakpoint 1 in method A and set breakpoint 2 in method B. Then in the Breakpoints dialog configure breakpoint 1 to not suspend. And configure the breakpoint 2 to be disabled until selected breakpoint is hit and select breakpoint 1. Now run the project or some tests in the debugger and check if breakpoint 2 is hit.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.