Browse Source

added test for Bugzilla Bug 29662

   VerifyError on accessing objects not accessible to the weaver: Incompatible object argument for invokespecial
tags/V_1_1_b5
jhugunin 21 years ago
parent
commit
2d297d7a36
2 changed files with 50 additions and 0 deletions
  1. 7
    0
      tests/ajcTests.xml
  2. 43
    0
      tests/bugs/AroundAccess.java

+ 7
- 0
tests/ajcTests.xml View File

@@ -5546,4 +5546,11 @@
<message kind="error" line="14"/>
</compile>
</ajc-test>
<ajc-test dir="bugs" pr="29662"
title="VerifyError on accessing objects not accessible to the weaver">
<compile files="AroundAccess.java">
</compile>
<run class="AroundAccess"/>
</ajc-test>
</suite>

+ 43
- 0
tests/bugs/AroundAccess.java View File

@@ -0,0 +1,43 @@

import org.aspectj.testing.Tester;

/** @testcase Bugzilla Bug 29662
VerifyError on accessing objects not accessible to the weaver: Incompatible object argument for invokespecial
*/
public class AroundAccess {
public static void main(String args[]) throws Throwable {
AroundAccess ve = new AroundAccess();
ve.foo();
Tester.checkEqual(FinalizeContract.fromAround, "s3:2,ME");
}

protected void foo() throws Throwable {}
}

class Foo {
private static int x;
}


aspect FinalizeContract {
public static String fromAround;
pointcut finalizeCall(Object o):
this(Object+) &&
this(o) &&
execution(void foo());

void around(Object o) throws Throwable: finalizeCall(o) {
String p = getS(3.14, 2); // + Foo.x;
fromAround = p + "," + toString();
Tester.checkNotEqual(super.toString(), toString());
proceed(o);
counter++;
}

private String getS(double d, int i) { return "s" + ((int)d) + ":" + i; }

public String toString() { return "ME"; }
private long counter = 0;
}

Loading…
Cancel
Save