Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Is there any difference between !within(@MyAnn *) and within(!@MyAnn *)? How about !within(IMyIntf+) and within(!IMyIntf+)?

I understand this can be hard to get your brain round.  Remember
within is a lexically matching pointcut:

 before(): execution(* *(..)) && !within(@MyAnn *){    }
'execution of any method that isn't lexically within a type marked
@MyAnn'.  The methods in the inner type are lexically within a type
marked @MyAnn (the surrounding outer type) - so no matches.

 before(): execution(* *(..)) && within(!@MyAnn *){ }
'execution of any method that is lexically within a type that is not
marked @MyAnn'.  The methods in the inner type are inside a type not
marked @MyAnn (the Bar type).  Yes they are also inside an outer type
that is marked @MyAnn but that doesn't matter.

Andy

This *does* match the method Bar.m() - that method is within a type
not marked @MyAnn.

On 19 December 2011 09:33, Mark <mark.kharitonov@xxxxxxxxx> wrote:
> I have checked your answer and it is really so (of course). But I must admin,
> I cannot understand why.
>
> --
> View this message in context: http://aspectj.2085585.n4.nabble.com/Is-there-any-difference-between-within-MyAnn-and-within-MyAnn-How-about-within-IMyIntf-and-within-IM-tp4210544p4214945.html
> Sent from the AspectJ - users mailing list archive at Nabble.com.
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top