You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

My_error.java 873B

123456789101112131415161718192021222324252627282930
  1. aspect My_error {
  2. interface Queue {}
  3. Queue Queue.next = null;
  4. public void Queue.doIt() {
  5. if (next == null) {
  6. System.out.println("End of queue reached");
  7. } else {
  8. System.out.println("\tCall received by: "+this.getClass().getName());
  9. System.out.println("\tCall forwarded to: "+next.getClass().getName());
  10. next.doIt();
  11. }
  12. }
  13. public void Queue.setNext(Queue next) {
  14. this.next = next;
  15. }
  16. declare parents: A implements Queue;
  17. declare parents: B implements Queue;
  18. declare parents: C implements Queue;
  19. // This is the problematic declaration. If removed, the program works fine.
  20. // If replaced by an around advice, the program also works fine.
  21. public void C.doIt() {
  22. System.out.println("Hurray! The call has been received by C!");
  23. }
  24. }