Re: [abc-users] capturing aspects

From: Amjad Nusayr <anusayr_at_cs.nmsu.edu>
Date: Tue, 22 Jul 2008 11:34:24 -0600

Hi again
I was happy to see the reply I got below, I'm only seeing stuff from my
perspective and forgot that there may be an easier way for warping as
aspect!!! I tried the adviseexecution pointcut on my aspect but the
program did not compile and gave me the following.

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.jimple.internal.JNopStmt
at abc.soot.util.Restructure.addParameterToMethod(Restructure.java:1086)

        at
abc.weaving.weaver.around.AdviceLocalClass.addParameters(AdviceLocalClass.java:119)
        at
abc.weaving.weaver.around.AdviceLocalClass.addDefaultParameters(AdviceLocalClass.java:69)
        at
abc.weaving.weaver.around.AdviceMethod.<init>(AdviceMethod.java:175)
        at
abc.weaving.weaver.around.AroundWeaver.doWeave(AroundWeaver.java:138)

        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.weaving.weaver.Weaver.weave(Weaver.java:277)
        at abc.main.CompileSequence.weave(CompileSequence.java:496)
        at abc.main.CompileSequence.runSequence(CompileSequence.java:115)
        ... 2 more

does anyone have any idea what is wrong?

Thanks
Amjad

Julian Tibble wrote:
>> I mislead you in referring to an already-woven aspect, what
>> I really want to do is to wrap an aspect as it is getting
>> woven, with my own code. In other words, for an aspect A
>> that is getting woven, I want to weave in A', where A' is
>> [mycode]A[mycode].
>>
>
> Would the following AspectJ do the trick without the need
> for compiler-hacking?
>
> aspect A'
> {
> void around(): adviceexecution() && within(A)
> {
> // mycode
> proceed();
> // mycode
> }
> }
>
> Julian
>
>
Received on Tue Jul 22 2008 - 18:34:31 BST

This archive was generated by hypermail 2.2.0 : Tue Jul 22 2008 - 22:00:12 BST