Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

PrivateMethodOnInnerInterface.java 883B

123456789101112131415161718192021222324252627282930313233343536
  1. import org.aspectj.testing.Tester;
  2. /** @testcase PR#823 private abstract method declared on inner interface */
  3. public class PrivateMethodOnInnerInterface {
  4. public static void main(String[] args) {
  5. new C();
  6. Tester.expectEvent("method");
  7. Tester.checkAllEvents();
  8. // XXX CF test that method is not visible here
  9. }
  10. }
  11. class C { }
  12. abstract aspect A {
  13. // no bug unless not member of the same aspect
  14. interface I {}
  15. interface J extends I{}
  16. }
  17. aspect B extends A {
  18. declare parents : C implements J;
  19. private abstract int I.privateMethod();
  20. private int C.privateMethod() {
  21. Tester.event("method");
  22. return 0;
  23. }
  24. after(I i) returning : target(i) && initialization(I.new()) {
  25. i.privateMethod();
  26. }
  27. }