[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [aspectj-users] Logging variables
- From: Jochen Wuttke <jochen.wuttke@xxxxxx>
- Date: Fri, 10 Oct 2008 15:32:45 +0200
- Delivered-to: firstname.lastname@example.org
On Oct 10, 2008, at 2:41 PM, rmahmood wrote:
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.