Re: [abc-users] AroundWeaver$InternalAroundError: ARD around weaver internal error

From: Oege de Moor <Oege.de.Moor@comlab.ox.ac.uk>
Date: Fri Oct 14 2005 - 21:12:30 BST

Dear Eduardo,

Many thanks for reporting this bug. I am happy to say that the new
version of abc, to be released very very shortly (probably tonight)
includes a much improved around weaver. The program below compiles
fine with the new version, so please be patient for a few hours.

Best wishes,

-Oege

On Fri, 14 Oct 2005, Eduardo Santos Cordeiro wrote:

> Hi there
>
> I was to compile a simple test using abc, but I got the following exception:
> "abc.weaving.weaver.AroundWeaver$InternalAroundError: ARD around weaver
> internal error"
>
> This exception was thrown by AroundWeaver.java at line 1874. Does this
> mean a bug in the compiler? Please consider the base code:
>
> public class A {
> int notPositive;
> int notNegative;
>
> public A() {
> setNotNegative(0);
> setNotPositive(0);
> }
> public int getNotNegative() {
> return notNegative;
> }
> public void setNotNegative(int value) {
> this.notNegative = value;
> System.out.println("notNegative was set to " + this.notNegative);
> }
> public int getNotPositive() {
> return notPositive;
> }
> public void setNotPositive(int value) {
> this.notPositive = value;
> System.out.println("notPositive was set to " + this.notPositive);
> }
> public void exchange() {
> int x = getNotPositive();
> setNotPositive(this.notNegative);
> setNotNegative(x);
> }
> }
>
>
>
> public class Test {
> public static void main(String[] args) {
> A a = new A();
>
> a.setNotNegative(1);
> a.setNotPositive(-1);
> a.exchange();
> }
> }
>
>
> And then the aspects:
>
> public aspect RangeCheckAspectV1 {
> pointcut notPositiveSet(int val)
> : call(* A.setNotPositive(..)) && args(val);
> pointcut notNegativeSet(int val)
> : call(* A.setNotNegative(..)) && args(val);
>
> void around(int val) : notPositiveSet(val) {
> if (val > 0)
> proceed(0);
> else
> proceed(val);
> }
> void around(int val) : notNegativeSet(val) {
> if (val < 0)
> proceed(0);
> else
> proceed(val);
> }
> }
>
> public aspect RangeCheckAspectV2 {
> pointcut notPositiveSet(int val)
> : set(* A.notPositive) && args(val);
> pointcut notNegativeSet(int val)
> : set(* A.notNegative) && args(val);
>
> void around(int val) : notPositiveSet(val) {
> if (val > 0)
> proceed(0);
> else
> proceed(val);
> }
> void around(int val) : notNegativeSet(val) {
> if (val < 0)
> proceed(0);
> else
> proceed(val);
> }
> }
>
> By compiling the base code along with RangeAspectV1, I get the expected
> result, both with ajc and abc. However, a separated attempt to compile
> the base code along with RangeCheckAspectV2 causes the exception
> described above -- it compiles successfully in ajc, though.
>
> The only conclusion I have arrived with this test is that there may be a
> problem in the weaving of field-set advices, since that is the only
> difference between the different versions of RangeCheckAspect.
>
> I hope this helps!
>
Received on Fri Oct 14 21:12:34 2005

This archive was generated by hypermail 2.1.8 : Mon Oct 17 2005 - 12:00:07 BST