Parameter annotation being ignored

View: New views
1 Messages — Rating Filter:   Alert me  

Parameter annotation being ignored

by Tahir Akhtar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users