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+)?

Hi Mark,

> Is there any difference between !within(@MyAnn *) and within(!@MyAnn *)?

Yes, here is an example of the difference:

@MyAnn
public class Target {
	void m() {	}
	class Bar {
		void m() {	}
	}
}

Here is some advice:
  before(): execution(* *(..)) && !within(@MyAnn *){	}
This matches nothing at all in Target.

Here is some more advice:
  before(): execution(* *(..)) && within(!@MyAnn *){ }
This *does* match the method Bar.m() - that method is within a type
not marked @MyAnn.

Similar story for within(IMyIntf+)

Andy

On 18 December 2011 02:51, Mark <mark.kharitonov@xxxxxxxxx> wrote:
> The title says it all.
>
> Thanks.
>
> --
> 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-tp4210544p4210544.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