[abc-users] polyglot.util.InternalCompilerError on around advice by tracematch

From: Kazunori Kawauchi <kazu_at_graco.c.u-tokyo.ac.jp>
Date: Mon, 07 Sep 2009 14:51:14 +0900

Hi,

I'm trying to compile a java project by a development version of aspectbench
compiler with tracematch extension (-ext abc.ja.tm) checked out from the svn
repository (http://abc.comlab.ox.ac.uk/products/trunk/abc-full) on September 2,
2009. But I can't compile the project when I define any piece of around advice
by tracemacth and receive the following error message:

> Exception in thread "main" polyglot.util.InternalCompilerError: unhandled exception during weaving/optimisation
> at abc.main.CompileSequence.runSequence(CompileSequence.java:142)
> at abc.main.Main.run(Main.java:406)
> at abc.main.Main.main(Main.java:144)
> Caused by: java.lang.ClassCastException: soot.SootMethod cannot be cast to abc.weaving.aspectinfo.MethodSig
> at abc.weaving.aspectinfo.AdviceDecl.getLocalSootMethods(AdviceDecl.java:327)
> at abc.weaving.weaver.around.AroundWeaver.buildAroundAdviceLocalMethodMap(AroundWeaver.java:295)
> at abc.weaving.weaver.around.AroundWeaver.getEnclosingAroundAdviceMethod(AroundWeaver.java:309)
> at abc.weaving.weaver.around.AdviceMethod.doWeave(AdviceMethod.java:193)
> at abc.weaving.weaver.around.AroundWeaver.doWeave(AroundWeaver.java:154)
> at abc.weaving.aspectinfo.AroundAdvice.weave(AroundAdvice.java:162)
> at abc.weaving.weaver.PointcutCodeGen.weave_one(PointcutCodeGen.java:359)
> at abc.weaving.weaver.PointcutCodeGen.weaveInAspectsPass(PointcutCodeGen.java:109)
> at abc.weaving.weaver.Weaver.weaveAdvice(Weaver.java:413)
> at abc.tm.weaving.weaver.TMWeaver.weaveAdvice(TMWeaver.java:75)
> at abc.weaving.weaver.Weaver.weave(Weaver.java:277)
> at abc.ja.tm.CompileSequence.weave(CompileSequence.java:221)
> at abc.main.CompileSequence.runSequence(CompileSequence.java:115)
> ... 2 more

Though it is not a problem to compile my small sample code with tracematch's
around advice, my target java code (about 2,000 lines of code) with any piece of
tracematch around advice causes the above compile error.
The error is caused by defining a simple tracematch's around advice like this:
    void tracematch() {
        sym callEvent around :
            call(void TextEditor.changeBlock());
        callEvent {
            proceed();
        }
    }
In addition, It is not a problem that I define after/before advice by tracematch
and 'normal'(pure AspectJ's) around advice.

In fact, I tried to compile my java code by the latest stable version of abc
(version 1.3.0), but I got a compile error about advice precedence. This bug is
fixed by the current development version of abc, isn't it?

Regards,

kazunori kawauchi
kazu_at_graco.c.u-tokyo.ac.jp
http://www.graco.c.u-tokyo.ac.jp/~kazu/
Received on Mon Sep 07 2009 - 06:51:28 BST

This archive was generated by hypermail 2.2.0 : Mon Sep 14 2009 - 22:10:11 BST