[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Parameter annotation being ignored

Hi,
I have written this pointcut

pointcut annotatedWithManageConnection(ManageConnection m): (call(void *(..) throws Exception+) && @args(m)) ;

I was expecting that this will only pick call to methods whose first argument is annotated with @ManageConnection but somehow it appears to be picking all the methods with single argument including following

public void onlyParamIsString(String string) throws Exception {
}


public void onlyParamIsConnection(Connection conn) throws Exception{
}


I also tried this pointcut
pointcut annotatedWithManageConnection(): (execution(void *((@ManageConnection *)) throws Exception+) ) ;
which gives warning "does not match because annotation @util.ManageConnection has @Target{ElementType.PARAMETER} [Xlint:unmatchedTargetKind]"


What am I doing wrong?

Regards
Tahir Akhtar