Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] pointcut for any method of any type except those of anonymous inner classes

Hello guys

I'm struggling with writing pointcut in aspectj for any method of any type except those of anonymous inner classes.

Does anybody know what should I add to
    pointcut all() : execution(* *.*(..))
if I want to exclude methods of anonymous inner classes?

I can't google it out. I found only this https://bugs.eclipse.org/bugs/show_bug.cgi?id=73050#c6
Adrian Colyer 2005-11-04 08:15:01 EST
I've just commited the fix for this and it will be available in the next
published build. Anonymous types are 
now only matched by the name pattern "*" - any other pattern fails to match
since anonymous types are 
treated as having no name.
so I tried:
    pointcut all() : execution(* *.*(..)) && !within(*.*)

which surprisingly works but only for types that are in same package as aspect is.

Peter

Back to the top