diff options
author | wisberg <wisberg> | 2004-02-13 01:21:03 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2004-02-13 01:21:03 +0000 |
commit | 95f2f555025370059b4acdb9aca17b9db3b640a0 (patch) | |
tree | 4860177122896e6657c58ad9d166ee9d6f03e4c9 /tests/bugs | |
parent | 8555cabe0c41e204aad4dac0c5c6236dc8144e7d (diff) | |
download | aspectj-95f2f555025370059b4acdb9aca17b9db3b640a0.tar.gz aspectj-95f2f555025370059b4acdb9aca17b9db3b640a0.zip |
mailing list verify error
Diffstat (limited to 'tests/bugs')
-rw-r--r-- | tests/bugs/protectedvf/main/Driver.java | 18 | ||||
-rw-r--r-- | tests/bugs/protectedvf/main/p1/ConcreteTest.aj | 23 | ||||
-rw-r--r-- | tests/bugs/protectedvf/main/p2/AbstractTest.aj | 20 |
3 files changed, 61 insertions, 0 deletions
diff --git a/tests/bugs/protectedvf/main/Driver.java b/tests/bugs/protectedvf/main/Driver.java new file mode 100644 index 000000000..6590760eb --- /dev/null +++ b/tests/bugs/protectedvf/main/Driver.java @@ -0,0 +1,18 @@ +package main; + +public class Driver{ + + public static void main(String[] args) { + Driver d = new Driver(); + d.doStuff(); + d.doOtherStuff(); + } + + private void doOtherStuff() { + System.out.println("doing other stuff"); + } + + private void doStuff() { + System.out.println("doing stuff"); + } +} diff --git a/tests/bugs/protectedvf/main/p1/ConcreteTest.aj b/tests/bugs/protectedvf/main/p1/ConcreteTest.aj new file mode 100644 index 000000000..be044e544 --- /dev/null +++ b/tests/bugs/protectedvf/main/p1/ConcreteTest.aj @@ -0,0 +1,23 @@ +package main.p1;
+
+import main.p2.AbstractTest;
+import main.Driver;
+
+final aspect ConcreteTest extends AbstractTest {
+
+ protected pointcut pc(): execution(* Driver.doStuff());
+
+ protected pointcut pc2(): execution(* Driver.doOtherStuff());
+
+ Object around(): pc2() {
+ System.out.println("adding to the other stuff");
+ /*If we comment out the next line we don't get a verify error.*/
+ System.out.println("The value of the field when replacing is " + getField());
+ return proceed();
+ }
+
+ protected void hook() {
+ /*This doesn't cause a verify error seemably because the advice calling it is in AbstractTest*/
+ System.out.println("The value of the field is " + getField());
+ }
+}
\ No newline at end of file diff --git a/tests/bugs/protectedvf/main/p2/AbstractTest.aj b/tests/bugs/protectedvf/main/p2/AbstractTest.aj new file mode 100644 index 000000000..0c8b040c4 --- /dev/null +++ b/tests/bugs/protectedvf/main/p2/AbstractTest.aj @@ -0,0 +1,20 @@ +package main.p2;
+
+public abstract aspect AbstractTest {
+
+ private int field;
+
+ protected abstract pointcut pc();
+
+ Object around(): pc() {
+ this.field++;
+ hook();
+ return proceed();
+ }
+
+ protected final int getField() {
+ return this.field;
+ }
+
+ protected abstract void hook();
+}
\ No newline at end of file |