1
0
Mirror von https://github.com/eclipse-aspectj/aspectj.git synchronisiert 2024-08-27 17:54:40 +02:00

mailing list verify error

Dieser Commit ist enthalten in:
wisberg 2004-02-13 01:21:03 +00:00
Ursprung 8555cabe0c
Commit 95f2f55502
4 geänderte Dateien mit 67 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -133,4 +133,10 @@
<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>

Datei anzeigen

@ -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");
}
}

Datei anzeigen

@ -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());
}
}

Datei anzeigen

@ -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();
}