org.aspectj/tests/new/PR600/My_error.java
2002-12-16 18:51:06 +00:00

31 lines
873 B
Java

aspect My_error {
interface Queue {}
Queue Queue.next = null;
public void Queue.doIt() {
if (next == null) {
System.out.println("End of queue reached");
} else {
System.out.println("\tCall received by: "+this.getClass().getName());
System.out.println("\tCall forwarded to: "+next.getClass().getName());
next.doIt();
}
}
public void Queue.setNext(Queue next) {
this.next = next;
}
declare parents: A implements Queue;
declare parents: B implements Queue;
declare parents: C implements Queue;
// This is the problematic declaration. If removed, the program works fine.
// If replaced by an around advice, the program also works fine.
public void C.doIt() {
System.out.println("Hurray! The call has been received by C!");
}
}