aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-01-21 23:58:42 +0000
committerjhugunin <jhugunin>2003-01-21 23:58:42 +0000
commit2d297d7a3626266c3ec47a695a0d15b13feccd30 (patch)
treef8880f48edf3349264fc206a8d1f43b857358255 /tests
parent5e510183142837a16fbea87129a3d6203072d59c (diff)
downloadaspectj-2d297d7a3626266c3ec47a695a0d15b13feccd30.tar.gz
aspectj-2d297d7a3626266c3ec47a695a0d15b13feccd30.zip
added test for Bugzilla Bug 29662
VerifyError on accessing objects not accessible to the weaver: Incompatible object argument for invokespecial
Diffstat (limited to 'tests')
-rw-r--r--tests/ajcTests.xml7
-rw-r--r--tests/bugs/AroundAccess.java43
2 files changed, 50 insertions, 0 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml
index e7a063a57..cad73762e 100644
--- a/tests/ajcTests.xml
+++ b/tests/ajcTests.xml
@@ -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>
diff --git a/tests/bugs/AroundAccess.java b/tests/bugs/AroundAccess.java
new file mode 100644
index 000000000..23b510026
--- /dev/null
+++ b/tests/bugs/AroundAccess.java
@@ -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;
+} \ No newline at end of file