Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] With @Aspect syntax & @annotation, @Pointcut does not compile

Hello,

 

With @Aspect syntax & @annotation, I can define & use an anonymous pointcut. Using a named one, @Pointcut does not compile.

 

I am using Aspject 1.6.10, JDK 1.6.0_18, the command and error are

 

\DevTools\aspectj1.6\bin\ajc -1.5 -inpath src\test;src\taspect -aspectpath src\taspect -d src\woven -cp src;\DevTools\aspectj1.6\lib\aspectjrt.jar;

taspect\TestAspect.java [error] Invalid pointcut 'permissionMethod(PermissionNeeded permission)': org.aspectj.weaver.patterns.ParserException: ) at position 34

1 error

 

Both the code snippets are below. Ignore the errors, my Eclipse is not setup for AJDT properly

 

Any ideas?

 

Thanks

Amit

 

Anonymous, works (compiles, weaves & executes)

    @Before("execution (@test.PermissionNeeded * *(*)) && @annotation(permission)")

    public void permissionCheck(PermissionNeeded permission)

 

Named, does not compile

    @Pointcut("execution (@test.PermissionNeeded * *(*)) && @annotation(permission)")

    public void permissionMethod(PermissionNeeded permission) {}

 

    @Before ("permissionMethod(PermissionNeeded permission)")

 


Back to the top