Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] More precedence

I can try to turn the example into a precedence test case. It may take a
few days as I'm under a deadline. 

By the way, does it have any meaning to put:

 aspect Dominates {
     declare dominates : Super, B;  // No +
 }

The changes page refered to the fact that only concrete aspects are
affected by precedence. Does this mean that Super (no plus) is illegal or
meaningless? Or does it mean the same as Super+?

Also, what should happen if you put a non-aspect type into the list?

Can I use a marker interface to pick out aspects for the list?


Cheers,
Nick
--- Jim.Hugunin@xxxxxxxx wrote:
> This is a bug as Wes says.  It's fixed in the current version of the
> compiler in cvs.  It was a simple matter of using the wrong API for type
> pattern matching in the implementation of declare dominates.
> 
> The test suite would benefit from a more extensive test than we currently
> have for this precedence case.  If Nick could turn his example into
> something that would throw an exception if the precedence was wrong that
> would be good.
> 
> -Jim
> 
> > -----Original Message-----
> > From: isberg@xxxxxxxx [mailto:isberg@xxxxxxxx]
> > Sent: Tuesday, December 31, 2002 9:36 AM
> > To: ndlesiecki@xxxxxxxxx; aspectj-users@xxxxxxxxxxx
> > Cc: support@xxxxxxxxxxx
> > Subject: RE: [aspectj-users] More precedence
> > 
> > It looks to me like
> > 
> >   declare dominates : Super+, ...
> > 
> > is just broken now.  Anyone care to submit a bug?
> > 
> > Wes
> > ------------- DominatesAdvice.java
> > 
> > public class DominatesAdvice {
> >     public static void main (String[] args) {
> >         new C().run();
> >     }
> >     pointcut run() : target(C) && call(void run());
> >     static void log(String s) {
> >         System.out.println(""+s);
> >     }
> > }
> > 
> > class C { void run() {}}
> > class Super {}
> > aspect A extends Super {
> >     before () : DominatesAdvice.run() {
> >         DominatesAdvice.log("A");
> >     }
> > }
> > aspect B {
> >     before () : DominatesAdvice.run() {
> >         DominatesAdvice.log("B");
> >     }
> > 
> > aspect Dominates {
> >     declare dominates : Super+, B;  // BUG: produces B, A
> >     //declare dominates : A, B;  // ok: produces A, B
> > }
> > 
> > 
> > > -----Original Message-----
> > > From: Lesiecki Nicholas [mailto:ndlesiecki@xxxxxxxxx]
> > > Sent: Tuesday, December 31, 2002 8:36 AM
> > > To: isberg@xxxxxxxx; aspectj-users@xxxxxxxxxxx
> > > Cc: support@xxxxxxxxxxx
> > > Subject: RE: [aspectj-users] More precedence
> > >
> > >
> > > Hello All,
> > >
> > > Sorry, my message got truncated. Unfortunately I've left the
> > > sample code at
> > > home.
> > >
> > > The upshot is that for:
> > >
> > > declare dominates : Security+, *;
> > >
> > > the precedence appears to be:
> > >
> > > Tracing
> > > Notification
> > > MoreSecurity
> > > CustomSecurity
> > > Security (abstract)
> > > Security (a second time)
> > > (JoinPoint)
> > >
> > > i.e. Security LAST.
> > >
> > > For:
> > >
> > > declare dominates : *Security*, *;
> > >
> > > The order is:
> > >
> > > MoreSecurity
> > > CustomSecurity
> > > Security (abstract)
> > > Security (a second time)
> > > Tracing
> > > Notification
> > > (JoinPoint)
> > >
> > > i.e. Security FIRST.
> > >
> > > Why should Security+ and *Security* produce different
> > > results? They both
> > > (should) select the same set of Concrete aspects (CustomSecurity and
> > > MoreSecurity). Am I missing something?
> > >
> > > BTW, the sample code is ridiculously simple. Each aspect has
> > > a single piece
> > > of before advice that prints what it's doing to the console.
> > > All of the
> > > advice affects call(void doSomething()). The only
> > > doSomething() method in
> > > the compilation unit appears in SomeObject.
> > >
> > > SomeObject's main:
> > > main(){
> > >   new SomeObject().doSomething();
> > > }
> > >
> > > Cheers,
> > > nick
> > > --- isberg@xxxxxxxx wrote:
> > > > Did the mailing list clip this question?
> > > > Did you decide against it, after accidental send?
> > > >
> > > > (btw, thanks for the bugs)
> > > >
> > > > Wes
> > > >
> > > > > -----Original Message-----
> > > > > From: Lesiecki Nicholas [mailto:
> > > > > Sent: Monday, December 30, 2002 9:16 PM
> > > > > To: aspectj-users@xxxxxxxxxxx
> > > > > Subject: [aspectj-users] More precedence
> > > > >
> > > > >
> > > > > Ok, I have several aspects that affect a single join point.
> > > > > They all define
> > > > > a single piece of before advice that prints a message about
> > > > > what they're
> > > > > doing.
> > > > >
> > > > > Aspects:
> > > > >
> > > > > Security (abstract)
> > > > > |
> > > > > --CustomSecurity
> > > > > |
> > > > > --MoreSecurity
> > > > >
> > > > > Tracing
> > > > >
> > > > > Notification
> > > > >
> > > > > I have the following declaration:
> > > > >
> > > > > declare dominates : Security+, *;
> > > > >
> > > > > __________________________________________________
> > > > > Do you Yahoo!?
> > > > > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > > > > http://mailplus.yahoo.com
> > > > > _______________________________________________
> > > > > aspectj-users mailing list
> > > > > aspectj-users@xxxxxxxxxxx
> > > > > http://dev.eclipse.org/mailman/listinfo/aspectj-users
> > > > >
> > >
> > > __________________________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > > http://mailplus.yahoo.com
> > >
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


Back to the top