[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-dev] cflow question
|
Hi Frederik,
You should try your questions on the aspectj-users list instead.
That said, I think you need to exclude your aspect from the advice:
pointcut flowDisplay(): cflow(call(* Test.display())) && !within(testAspect);
or exclude the cflow:
pointcut flowDisplay(): call(* Test.display());
You'll note that in the first version your advice gets called four times! That's
because there are four join points in the cflow of the call to Test.display. I
assume you want the non cflow form.
-Macneil
> Hi,
>
> I have a simple example
> class Test{
> public static void main(String[] args){
> Test test = new Test();
> test.display();
> }
> public void display(){
> System.out.println("testing");
> }
> }
> aspect testAspect{
> pointcut flowDisplay(): cflow(call(*
> Test.display()));
> before(): flowDisplay(){
> System.out.println("entered advice");
> }
> }
> I get stackOverflows all the time. Can someone tell
> why this loops?
>
> thx
> volvin
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more
> http://tax.yahoo.com
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-dev