[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Withincode pointcut??

Ok, I have to admit that the difference in semantics you point out looks
strange. I can only estimate that it has to do with the execution
pointcut semantics or invokevirtual (used for non-private methods) vs.
invokespecial (used for constructor execution) bytecodes.

The other point is that - I know this is not a satisfying answer - your
pointcut specifications do not make much sense. What does it mean if you
state that a method execution (or constructor execution) should occur
within the code of a method? Either this is always the case or never?
Maybe execution(* g()) && cflow(withincode(* f())) or something like
this is what you actually want to express.

Still, it's an interesting observation. Maybe the ajc guys can shed some
light on us. 

Eric Bodden
Sable Research Group, McGill University
Montreal, Canada

> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-
> bounces@xxxxxxxxxxx] On Behalf Of Nadia Belblidia-Guerroumi
> Sent: Monday, May 29, 2006 7:20 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] Withincode pointcut??
> Hi everyone!
> Could somebody explain me why the pointcut withincode can match only
> against the following join points:
> method-call
> field-set
> constructor-call
> field-get
> exception-handler
> constructor-execution
> preinitialization
> initialization
> and not on execution-method also!?? Why Constructor-execution and not
> method execution??
> For example:
> withincode(public static void Main.f()) && execution(public static
> Main.f())
> Doesn't match but for the execution of public static void Main.f().
> whereas
> withincode(Main.new()) && execution(Main.new()) matches against
> execution of Main constructor.
> Thank you very much!