Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] dont follow method calls within aspect

Nicholas Lesiecki wrote:

does !cflow(adviceexecution() && within(MyAspect)) work?


Nicholas Lesiecki
Software Craftsman, specializing in J2EE,
Agile Methods, and aspect-oriented programming
m: 520 591-1849

Books:
* Mastering AspectJ: http://tinyurl.com/66vf
* Java Tools for Extreme Programming: http://tinyurl.com/66vt

Articles on AspectJ:
* http://tinyurl.com/66vu and http://tinyurl.com/66vv
On Dec 20, 2004, at 6:02 AM, sirrurg wrote:

Hi all,

im currently trying to log some method executions and have pointcuts looking like

pointcut PubMethodCall(Point p) : execution(public * *(..)) && target(p);

and my advice looks like

before(Point p): PubMehtodCall(p) && !cflowbelow(PubMethodCall(Point){....}

At the moment i am using a private method within the aspect to create an proper output, by reading the parameters from the method call an parsing into a String,
if the parameters are Objects and they dont have a toString()-method i
try to create some kind of output by accesing it through getter-Methods if i find some. Now my Question, if i call sth like Point.equals(Point p) and Point has no toString() method, in this case i get some extra "log-output" for the calls to the parameter p.
Is there any possiblity to stop this?

Sincerely
   Sirrurg
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users


Thx for the advice, works also and i didnt have to use the "&& wihtin" clause. I thought i had already tried this out, but somehow i must have mixed it up with another error.
By the way, do i miss sth if i leave out the "&& wihtin" clause?

Sincerely
   Sirrurg


Back to the top