3 Replies Latest reply: Oct 26, 2008 10:14 PM by 843810 RSS

    Help, how to find a referencing variable

    843810
      Hi guys, I'm using ModificationWatchpointEvent from JDI to analyse the object behaviors.

      Now I catch a ModificationWatchpointEvent e for a int field of an object MaxNum( a simple self-defined class ), thus I know that the value of the field was modified. The question is, is there any appraoch to find out which local variable was used to define it?
      Say, like this:
      int A = 5;
      int a = 0;
      a = A;

      In this context, variable A was used to value variable a. In ModificationWatchpointEvent , I only know that the new value of a is 5, but I'm not aware of which local variable is used to define it.

      Is there any idea to find out which local variable is used? Thanks a lot.