Amit,
Your before advice isn't written correctly. It should look like (remove type
from the expression):
@*Before* (*"permissionMethod(permission)"*)
*public* *void* permissionCheck(PermissionNeeded permission) {
-Ramnivas
On Thu, Nov 11, 2010 at 4:16 PM, Amit Chaudhary <[email protected]> wrote:
> 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)"*)
>
>
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users