0

Given that-

public class Demo{ 
  public void Find(){ 
    Example.A(); 
    String str = new Example().B(); 
  } 
} 

I want to find out the name of all the methods that are called inside the Find() method in the Demo class and store it in an ArrayList (Method A() and Method B() in this case). How do I achieve that?

Example is another class in the same package with two methods: A static method A() and non-static method B() which returns a String.

Ishtar
  • 11,542
  • 1
  • 25
  • 31
Aritro Sen
  • 357
  • 7
  • 14
  • 2
    I haven't done anything like that, but I guess you need to go through the bytecode to do something like this. – fabian Oct 11 '15 at 17:43
  • oh i see. I didnt know about the javassist API. Used it and nw its working lik a charm. Thanks guys ! – Aritro Sen Oct 12 '15 at 06:58

0 Answers0