[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Logging variables


On Oct 10, 2008, at 2:41 PM, rmahmood wrote:


Hi All,

i am looking for some way to weave variable assignment statements.
From different discussions it seems that the only possibility is to
advice Setter methods for member variable assignment.

But what about local variables within a method or assignment to
a variable by a method return value.

For assignments with late bindings it looks that this is not possible
with AspectJ as it provides load time weaving.

I'm not sure what you mean by "late bindings". But the problem with AJ is, AFAIK, that the names of local variables are not stored in class files, i.e. they are not available for weaving. Instead the Java compiler assigns them numbers (which show up in the class file for LOAD instructions), but since there is no mapping between these numbers and the named variables in the source that the AspectJ weaver has access to, it is not possible to weave into local variable accesses.


Jochen