« Return to Thread: point cut on:: Annotated field + new ArrayList()

Re: point cut on:: Annotated field + new ArrayList()

by Andy Clement :: Rate this Message:

Reply to Author | View in Thread

The proceed() call in the around advice proceeds to do whatever was intended at the join point originally.  Because it is a 'set' join point, the proceed will proceed to set the field being intercepted, so if we supply a different value in the proceed call, the field will be set to that instead.

Andy

2009/6/27 Ravi Chandra <ravi.eze@...>
This way you are pointcutting the field variable. How does it return/ set the variable to new MyList() back?. In other words if i say

System.out.println('class::'  + u.alias.getClass() );// we are point cutting u.alias variable

its not printing MyList; instead its showing ArrayList.

any ideas?

Are ther any standard tutorials available on the net by which we can get such problems clarified? Googling hardly helps. Any ideas/ links... kindly help.

ravi


On Fri, Jun 26, 2009 at 9:57 PM, Andy Clement <andrew.clement@...> wrote:
Here is a working solution:

public aspect INAspect {

    pointcut listCut(ArrayList value, LIST in ) : set(@LIST * * ) && args(value) && @annotation(in);

    void around(ArrayList value, LIST in) :listCut(value,in) {

        System.out.println("**annotation " + thisJoinPoint + " ann:" + in.value());
        proceed(new MyList(),in);
    }

}

_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users



_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users



_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users

 « Return to Thread: point cut on:: Annotated field + new ArrayList()