Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Constructor execution advice is called twice

Hello List,

 I'm trying to capture the execution of aspect constructors in a hierarchy.
 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 implemented).
I have debugged it, and the advice code is called twice before the constructor execution.

If an "after " advice is used, it is called before and after constructor execution.

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.


regards.
arturo





Back to the top