Hi Simone,
Thanks for your reply, but the this and target are both returning the same
instance!
I am providing a snippet from my aspect class below
// Point cut that matches any private method
pointcut anyPrivate() : call(private * *.*(..));
// Point cut that matches all methods which return a void and are not
private.
pointcut allNonPrivateVoid() : call(void *.*(..)) && !anyPrivate();
// Matches non-private, void methods in all classes that are annotated with
@AppManaged
pointcut doParallelForVoid(AgentWrapper wrapper) :
@within(AppManaged) && allNonPrivateVoid() && this(wrapper);
// Note that the AgentWrapper is an interface I introduced to the aspect to
wrap a GPars Agent class
// The advice
void around(final AgentWrapper wrapper, final Object me, final Object other)
:
doParallelForVoid (wrapper) && this(me) && target(other){
Agent agentOfAppManaged = wrapper.getAgent();
// If agent is null, then this app managed object is not really an
agent.
if(null != agentOfAppManaged && me!=other)
// rest of the code.
Am I doing something wrong?
The me!=other is failing, since both are the same class for some reason.
// Not adviced test class
TestClass{
AdvisedClass ad = new AdvisedClass();
ad.someMethod();// When it reaches the around advise I get the
//me and the other as "AdvisedClass" while I was expecting "me" to be
//TestClass
}
--
View this message in context:
http://aspectj.2085585.n4.nabble.com/Finding-nested-method-calls-within-the-same-class-tp3246144p3248875.html
Sent from the AspectJ - users mailing list archive at Nabble.com.
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users