Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Pointcut test

I am working on a the AJ 165 code base so it may have been moved.
What I am aiming at is generating aspect-oriented debug information. If I have the original residue string, when debugging the code and seeing an advice that was skipped it will be possible to show the user the condition that failed.

-----Original Message----- From: Andy Clement
Sent: Thursday, June 30, 2011 7:39 AM
To: AspectJ developer discussions
Subject: Re: [aspectj-dev] Pointcut test

I don't see a getPointCutTest() method on BcelAdvice?

Due to support for binary weaving, the only thing accessible from the
Bcel artifacts is likely to be that which is serialized into the class
file attributes by compilation.  I can't honestly remember what gets
stuffed in there but I wouldn't be surprised if it is not preserved.
Looking at IfPointcut it seems (write/read methods) like the test
method is the key thing.  Remember that the residue isn't necessarily
just your if() bit, suppose another component of your pointcut could
not be statically matched, the test to check at runtime would be an
additional piece of residue that were merged with the call to the if()
function.  I guess I'm saying there is a difference here between being
interested in the runtime tests (the full residue) or being interested
in the if() component pointcuts the advice is related to.

If preserving this source rep enables you to add some killer feature
to AspectJ, I'm not against adding that :)  Perhaps a simple
attribute/annotation on the if() function indicating the text that
gave rise to it would be enough.

cheers
Andy

2011/6/29 Yoav A. <yoav_@xxxxxxxxxxx>:
Hi

I am trying to extract information of a pointcut residue. I notice that by
weave time it is reduced to function calls that perform the actual test. For
example if I have

pointcut pointCutBeforeA(): within(A) && execution(void foo()) &&
if(useAspect);

I see that the the actual test that is returned from
BcelAdvice.getPointCutTest() is a function call to some synthetic function
that actually does the check. Is there some way, in the context of the
weaver, to get the original syntax or is it discarded after the compiler is
done?


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


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


Back to the top