Hi andrew, Thanks for the answer!
All the best, Henrique On Tue, Mar 23, 2010 at 11:57 AM, Andrew Eisenberg <[email protected]>wrote: > If you could use execution instead of call, then the solution would be > easy. One of the main reasons to use call pointcuts is to take > advantage of polymorphic calls as below. When you don't want to do > that, you could do something like: > > pointcut callMeth() : execution(public void A.m()) && within(A); > > Of course, this will not work with call joinpoints. And > unfortunately, I can't think of a clean way of doing what you want. > > 2010/3/22 Henrique Rebêlo <[email protected]>: > > Hi all, > > > > Consider the following simple hierarchy: > > > > class A { public void m() {} } > > class B extends A { public void m() {} } > > class C extends B { public void m() } > > > > along with the simple call pointcut > > > > pointcut callMeth() : call (public void A.m()); > > > > The call pointcut callMeth() will match any call to A.m() but it includes > > all m's calls in subtypes of A. > > > > The question is: Is there a straightforward solution to avoid matches in > > subtypes of A (and without using any special variable such as > > thisJoinPointStaticPart)? > > > > I know that we can explicitly eliminate all descendants of A: > > > > pointcut callMeth() : call (public void A.m()) && > > !call (public void B.m()) && > > !call (public void C.m()) ; > > > > but, Is there another way? > > > > > > Kind Regards, > > Henrique > > > > > > -- > > > ............................................................................................................................... > > Henrique Rebelo > > http://www.cin.ufpe.br/~hemr <http://www.cin.ufpe.br/%7Ehemr> > > Informatics Center, UFPE, Brazil > > > > _______________________________________________ > > aspectj-users mailing list > > [email protected] > > https://dev.eclipse.org/mailman/listinfo/aspectj-users > > > > > _______________________________________________ > aspectj-users mailing list > [email protected] > https://dev.eclipse.org/mailman/listinfo/aspectj-users > -- ............................................................................................................................... Henrique Rebelo http://www.cin.ufpe.br/~hemr Informatics Center, UFPE, Brazil
_______________________________________________ aspectj-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/aspectj-users
