Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] "can't determine precedence between two or more pieces of advice that apply to the same join point"

The behavior is well-defined, but the programmer can define a precedence 
cycle. See circularity discussion in programming guide semantic appendix 
section on advice precedence:

http://www.eclipse.org/aspectj/doc/released/progguide/semantics-advice.html#d0e6220

(A good rule is to always put after advice last.)

Wes

> ------------Original Message------------
> From: Eric Bodden <eric@xxxxxxxxx>
> To: aspectj-users@xxxxxxxxxxx
> Date: Sat, May-7-2005 1:37 AM
> Subject: [aspectj-users]  "can't determine precedence between two or more pieces of advice that apply to the same join point"
>
>  
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi.
> 
> I am getting a compile error, I cannot quite explain: I always
> thought there would be some well-defined behaviour with respect to
> advice precedence in any case for one single aspect unit. However,
> when I try to compile and weave the following aspect I get the error
> stated above.
> 
> - ------------
> 
> public aspect TestAspect {
> 
>     before(): call(* Test.baz()) {
>         System.out.println("before 1");
>     }
>     
>     after(): call(* Test.baz()) {
>         System.out.println("after 1");
>     }
>     
>     before(): call(* Test.baz()) {
>         System.out.println("before 2");
>     }
> 
> }
> 
> - ------------
> 
> Interestingly, when I comment out one of the last two pieces of
> advice, this gives me no error. So why am I getting this error? Why
> does the rule "advice executed in lexical order" not apply? Is this
> intended behavior? And most importantly: What could be an easy
> workaround?
> 
> Eric
> 
> - --
> Eric Bodden
> RWTH Aachen University
> ICQ UIN: 12656220, Skype: ericbodden, PGP: BB465582
> Website: http://www.bodden.de
> 
> -----BEGIN PGP SIGNATURE-----
> Version: PGP 8.0.3
> 
> iQA/AwUBQnx+RMwiFCm7RlWCEQLt6gCg1YbeFJKzRiyWl87O3LvuJTetg6EAoN2F
> Oh6DzwXwDn3NPn8izGra/2Dd
> =rI2R
> -----END PGP SIGNATURE-----
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 



Back to the top