Re: [abc-users] Compilation error with intertypes when using the abc weaver

From: Eric Bodden <eric.bodden_at_mail.mcgill.ca>
Date: Mon, 18 May 2009 16:12:21 -0400

Hi Henrique.

Thanks for your bug report. However, I am a little bit confused. Java
and AspectJ identifiers are not allowed to have any "$". So are you
saying that ajc and abc actually parse the code that you gave? Both
would surprise me.

Eric

2009/5/18 Henrique Rebêlo <hemr_at_cin.ufpe.br>:
> Dear all abc experts,
>
>   I have a problem when I try to compile the following simple hierarchy with
> their respectively aspects:
>
>    public interface I {
>
>       public void m(int x);
>       }
>    }
>
>    public class C implements I{
>
>      public void m(int x) {
>      }
>    }
>
>   public privileged aspect Aspect_I {
>
>     private boolean I.m$I(int x) {
>         return true;
>     }
>   }
>
> public privileged aspect Aspect_C {
>
>   private boolean C.m$C(int x) {
>     return (m$I(x));  --> probably the root of error!!!
>   }
> }
>
>  The error is the following:
>
>  Buildfile:
> C:\Java\Eclipse-Workspace\PhD\Experimentos\J2SE\TestABCWeaver\build.xml
>  compile-abc-files:
>      [java] Exception in thread "main" polyglot.util.InternalCompilerError:
> unhandled exception during weaving/optimisation
>      [java]     at
> abc.main.CompileSequence.runSequence(CompileSequence.java:142)
>      [java]     at abc.main.Main.run(Main.java:406)
>      [java]     at abc.main.Main.main(Main.java:144)
>      [java] Caused by: polyglot.util.InternalCompilerError: Exception while
> processing <C: boolean accessor$m$I$6(int)>
>      [java]     at abc.main.CompileSequence.weave(CompileSequence.java:414)
>      [java]     at
> abc.main.CompileSequence.runSequence(CompileSequence.java:115)
>      [java]     ... 2 more
>      [java] Caused by: java.lang.NullPointerException
>      [java]     at soot.AbstractValueBox.setValue(AbstractValueBox.java:42)
>      [java]     at
> soot.jimple.internal.JimpleLocalBox.<init>(JimpleLocalBox.java:39)
>      [java]     at soot.jimple.Jimple.newLocalBox(Jimple.java:850)
>      [java]     at
> soot.jimple.internal.JInterfaceInvokeExpr.<init>(JInterfaceInvokeExpr.java:42)
>      [java]     at
> soot.jimple.Jimple.newInterfaceInvokeExpr(Jimple.java:463)
>      [java]     at
> abc.soot.util.MethodAccessorMethodSource.getBody(MethodAccessorMethodSource.java:100)
>      [java]     at
> soot.SootMethod.getBodyFromMethodSource(SootMethod.java:82)
>      [java]     at soot.SootMethod.retrieveActiveBody(SootMethod.java:329)
>      [java]     at abc.main.CompileSequence.weave(CompileSequence.java:410)
>      [java]     ... 3 more
>      [java] Java Result: 1
> BUILD SUCCESSFUL
> Total time: 6 seconds
>
>  When I compile just the Interface with its aspect, the compilation has no
> problem... But when I put the above scenario, the above error occurs. I
> tested and I figure out when I call the inherited intertype method m$I(x)
> within the intertype declared in C (m$C(int x)), the problem happens!
>
>  Can someone show me how to tackle this problem? The above scenario is just
> a illustration, in fact, I use several other applications, but all of them
> rely on the above
>  scenario!
>
>  It's important to note that such a problem does not occur when I employ the
> ajc weaver!!
>
> Regards,
>
> Henrique
>
>
> --
> Henrique Rebêlo, Centro de Informática, UFPE
> http://www.cin.ufpe.br/~hemr
>

-- 
Eric Bodden
Sable Research Group, McGill University
Montréal, Québec, Canada
Received on Mon May 18 2009 - 21:12:26 BST

This archive was generated by hypermail 2.2.0 : Tue May 19 2009 - 03:40:13 BST