Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » Circular advice precedence - how to?
Circular advice precedence - how to? [message #815130] Wed, 07 March 2012 09:12 Go to next message
Ashish Missing name is currently offline Ashish Missing nameFriend
Messages: 4
Registered: July 2009
Junior Member
I am trying to achieve the following:

I have a annotation: @A except that @A takes a shortcut if a method it is applied to has its first Method parameter of type say, X.

I have two Pointcuts as:

@Pointcut(value="execution(@A * *(..)) " +
"&& @annotation(annotation) ")
public void trackAnnotatedMethod(A annotation) {}

@Pointcut(value="execution(@A * *(" +
"X,..)) &&" +
"args(x,..) && @annotation(annotation) ")
public void splAnnotatedMethodWithX(A annotation, X x) {}

I get the following exception:
circular advice precedence: can't determine precedence between two or more pieces of advice that apply to the same join point: method-execution(...)

When a method similar to the following is annotated with A:

public void someMethod(X x) {..}

Is there a way to do this? Either by changing the aspect or a different way to achieve the same? Thanks for your help,


Re: Circular advice precedence - how to? [message #815683 is a reply to message #815130] Wed, 07 March 2012 23:49 Go to previous message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
I think you are hitting a variant of this "bug" I say "bug" and not bug since the compiler behavior is probably correct. I can't say that for certain since you didn't attach your entire aspect.

As the bug states, you can probably get around this by grouping all your before and all your after advice together. Between them should go your around advice.

If this still doesn't work, feel free to attach the complete aspect and a simple target java file.
Previous Topic:AJDT compiler results in errors
Next Topic:Adding a method to the Object Class
Goto Forum:

Current Time: Thu Feb 20 04:59:36 GMT 2020

Powered by FUDForum. Page generated in 0.01552 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top