Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Confused by cflow interaction - totally new confusion

Hi Keith,

Any mismatches between the crosscutting structure views and the advice that
actually runs can be very confusing, and is probably the result of a bug
with the view.  Even without the enhancements suggested in my last email the
structure views should show *any* place that cflow advice *might* execute.

I'm a bit confused about your mentioning that only some of the advice is
"executed".  Could you please put together a bug report that describes any
mismatch between what executes and what shows up in the view?  Please
include this source code, the advice that actually ran, and the advice that
the structure view displayed.

Thanks,

Mik

> -----Original Message-----
> From: aspectj-users-admin@xxxxxxxxxxx [mailto:aspectj-users-
> admin@xxxxxxxxxxx] On Behalf Of SADER, KEITH D (CONTRACTOR)
> Sent: Monday, March 29, 2004 9:06 AM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] Confused by cflow interaction - totally new
> confusion
> 
> > Greetings,
> >
> > I've been working my way through the Gradecki and Leseicki
> > book _Mastering AspectJ_ and I've come across some confusing
> > behavior doing a cflow example.  The example I speak of is
> > divided over pp. 111-112.
> >
> > public class Flow{
> >     public void two() {
> >         System.out.println("two");
> >     }
> >
> >     public void one() {
> >         two();
> >     }
> >
> >     public static void main(String args[]) {
> >         new Flow().one();// shortened from the book
> >     }
> > }
> >
>  My aspect is as follows from the middle of pg. 112
> 
> public aspect FlowAspect {
>     // renamed like the next example on pg. 112
>     pointcut getPrint() : call (void java.io.PrintStream.println(String));
>     pointcut getTwo()   : call (public void two());
>     pointcut getOne()   : call (public void one());
> 
>     pointcut matchPrint() : getPrint() && cflow(getTwo() && getOne())
> && !within(FlowAspect);
> 
>     before() : matchPrint() {
>         System.out.println("before matchPrint");
>     }
> }
> 
> Now I actually am confused by the cflow pointcut vs. the visualizer :-)
> With the example above, I'm not seeing the before advice executed as I
> would expect from the text.  I.e. when I look at the console I expect to
> see:
> 
> before matchPrint
> two
> 
> and I just see
> 
> two
> 
> It seems like the cflow(getTwo() && getOne()) isn't working to bind the
> advice to execution flow that I'm trying to describe.  What am I missing?
> 
> thanks,
> Keith S.
> 
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top