[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [aspectj-users] Constructor execution advice is called twice
I suspect that it is capturing EACH constructor executed. If you
have a flat hierarchy, this is your constructor plus Object(). If
you deepened your hierarchy, you probably get more because it is
logging Foo(), Bar(), Object() in the hiearchy Foo extends Bar
Hope this helps
On Sep 21, 2007, at 11:19 AM, Arturo Zambrano wrote:
I'm trying to capture the execution of aspect constructors in a
The problem is that I'm getting the advice executed twice.
The pointcut is something like
pointcut aspectConstructor(RO o):execution (RO+.new(..)) && target(o);
and the advice is
before (RO o): aspectConstructor(o)
logger.info("Captured creation of " + o);
I expected the logger line to be executed just once for each
aspect in the hierarchy (they all have just the default constructor
I have debugged it, and the advice code is called twice before the
If an "after " advice is used, it is called before and after
Similar results are obtained when "initialization" poincut is used
insted "execution" one.
Is this behavior supposed to happen? Maybe a bug?
I could not find any information regarding this issue.
aspectj-users mailing list