[abc-users] args question

From: Jennifer LHOTAK <jlhotak@sable.mcgill.ca>
Date: Fri Jan 07 2005 - 01:24:28 GMT


I'm new to AspectJ... and I'm trying make an Aspect that uses args match.
My aspect works just fine (matches) when I don't have any args but
I get a Warning -- Advice declaration doesn't apply anywhere when I have
them. I don't understand what this has to do with matching. Shouldn't it
match the same way in both cases and simply expose the args for use in the
advice in the second case (with args)?

Here's a copy of my aspect with no args that works:

public aspect CheckRetAspect {

    pointcut caseSession():
        cflow(execution(* DepthFirstAdapter.caseASession(..)));

    pointcut inRet(): execution(* DepthFirstAdapter.inAReturnStm(..)) ||
        execution(* DepthFirstAdapter.inARetexpStm(..));

    pointcut inWeed(): cflow(execution(* WeedPhase1.weed(..)));

    after() : caseSession() && inRet() && inWeed(){
               ... do some stuff here


And here is a version where I attempt to use args:

public aspect CheckRetAspect {

    pointcut caseSession(ASession node): args(node) && cflow(execution(*

    pointcut inRet(): execution(* DepthFirstAdapter.inAReturnStm(..)) ||
        execution(* DepthFirstAdapter.inARetexpStm(..));

    pointcut inWeed(Node ast, String fileName, DataMap dataMap): args(ast,
        fileName, dataMap) && cflow(execution(* WeedPhase1.weed(..)));

    after(ASession node, Node ast, String fileName, DataMap dataMap) :
        caseSession(node) && inRet() && inWeed(ast, fileName, dataMap){
        ... do some stuff here with the args


Received on Fri Jan 7 01:24:31 2005

This archive was generated by hypermail 2.1.8 : Fri Jan 07 2005 - 02:30:03 GMT