Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re : [aspectj-users] does not match because annotation has @Target{ElementType.METHOD}

Shouldn't it be 

private pointcut avoidLockedMethodInvocation( AgentProxy proxy, Lock
 lockingAnnotation ) : call( @Lock public * AgentProxy+.*(..) )
                                                                        &&
                                                                       
 @annotation(lockingAnnotation)
                                                                        &&
                                                                        target( 
proxy );

instead ?

Cheers,
Anwar.


----- Message d'origine ----
De : Andy Clement <andrew.clement@xxxxxxxxx>
À : aspectj-users@xxxxxxxxxxx
Envoyé le : Mar 20 juillet 2010, 17h 06min 02s
Objet : Re: [aspectj-users] does not match because annotation has  
@Target{ElementType.METHOD}

Looks like a bug to me, given that the subject at the relevant
joinpoint should be a method object.

Andy

On 20 July 2010 05:00, Luca Ferrari <fluca1978@xxxxxxxxxxx> wrote:
> Hi all,
> I've got the following pointcut:
>
> private pointcut avoidLockedMethodInvocation( AgentProxy proxy, Lock
> lockingAnnotation ) : call( public @Lock * AgentProxy+.*(..) )
>                                                                        &&
>                                                                       
> @annotation(lockingAnnotation)
>                                                                        &&
>                                                                        target( 
>proxy );
>
> that is I'd like to advice any method call that is annotated with @Lock. The
> problem is that the ajdt tells me that:
>
> does not match because annotation @Lock has @Target{ElementType.METHOD}
> [Xlint:unmatchedTargetKind]
>
> that is right, since I'd like to lock some method execution. What am I doing
> wrong here?
>
> Thanks,
> Luca
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users






Back to the top