Hi,
I want to
write a pointcut that whenever this is a call to Throwable.printStackTrace,
I want to get the throwable and do something with it. So I need to do
something like this:
pointcut
printStackTracePrintStream(PrintStream s, Throwable
myObject):
execution(void Throwable.printStackTrace(PrintStream))
&& args(s) && this(myObject);
This won't work
because I think it only weaves at the definition of printStackTrace, which
is in JAVA codes, but I am only running ajc on my codes. If I replace
"execution" with "call", my codes will get weaved, but the object I get is the
class that's calling printStackTrace, but the throwable object. Can anyone
help me? Thanks!