<run class="InterfaceInitializerOrder"/>
</ajc-test>
+ <ajc-test dir="bugs/protectedvf"
+ title="mail list VerifyError with protected access">
+ <compile files="main/Driver.java,main/p2/AbstractTest.aj,main/p1/ConcreteTest.aj"/>
+ <run class="main.Driver"/>
+ </ajc-test>
+
</suite>
--- /dev/null
+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");
+ }
+}
--- /dev/null
+package main.p1;\r
+\r
+import main.p2.AbstractTest;\r
+import main.Driver;\r
+\r
+final aspect ConcreteTest extends AbstractTest {\r
+\r
+ protected pointcut pc(): execution(* Driver.doStuff());\r
+\r
+ protected pointcut pc2(): execution(* Driver.doOtherStuff());\r
+\r
+ Object around(): pc2() {\r
+ System.out.println("adding to the other stuff");\r
+ /*If we comment out the next line we don't get a verify error.*/\r
+ System.out.println("The value of the field when replacing is " + getField());\r
+ return proceed();\r
+ }\r
+\r
+ protected void hook() {\r
+ /*This doesn't cause a verify error seemably because the advice calling it is in AbstractTest*/\r
+ System.out.println("The value of the field is " + getField());\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+package main.p2;\r
+\r
+public abstract aspect AbstractTest {\r
+\r
+ private int field;\r
+\r
+ protected abstract pointcut pc();\r
+\r
+ Object around(): pc() {\r
+ this.field++;\r
+ hook();\r
+ return proceed();\r
+ }\r
+\r
+ protected final int getField() {\r
+ return this.field;\r
+ }\r
+\r
+ protected abstract void hook();\r
+}
\ No newline at end of file