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

Ramnivas,

 

Thanks a lot, that worked.

 

Regards

Amit

 

From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ramnivas Laddad
Sent: Friday, November 12, 2010 10:57 AM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] With @Aspect syntax & @annotation, @Pointcut does not compile

 

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 <amitch@xxxxxxxxxx> 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
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users