Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Different resolution scope for Named and Anonymous pointcut annotations?

I am using AspectJ annotations and for some reason it seems that the
resolution scope of pointcuts differs for a named pointcut versus an
anonymous pointcut.

For example in the code below an identical pointcut is resolved if anonymous
but not when it is named. The named pointcut will however match if I use a
wildcard instead of a specific type or if the aspect is moved to the same
package as the Account class.

Any thoughts?


import ... .Account;

@Aspect
public class MyClass {


//this does not match... but matches if Account is replaced by *
@Pointcut("execution(* Account.withdraw(..)) && args(amount)")
public void withdr(double amount){}

@Before("withdr(amount)")
public void dosomething1(double amount){}


//this matches
@Before("execution(* Account.withdraw(..)) && args(amount)")
public void dosomthing2(double amount){}

}



--
View this message in context: http://aspectj.2085585.n4.nabble.com/Different-resolution-scope-for-Named-and-Anonymous-pointcut-annotations-tp4650774.html
Sent from the AspectJ - users mailing list archive at Nabble.com.


Back to the top