Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] access local variable in a method

Hi,

I have a question about accessing local variables. For example,

public class Test{

  public void run(){
     ClassA A = new ClassA();
     doSomething(); 
  }
  
  public void doSomething(){}
  
}

How to access variable A in the run() method? I can write a pointcut to
pick up the line, "ClassA A = new ClassA()". However, as I know so far, we
only can expose context by using target, args, this. None of them can expose
the return value of a method or constructor.

Therefore, is it possible to get the value of A in this case?


Thanks,

Dapeng Gao





Back to the top