Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

HasPrivateFieldInherited.aj 514B

12345678910111213141516171819202122232425262728
  1. public aspect HasPrivateFieldInherited {
  2. declare parents : D && hasfield(* printer) implements Printable;
  3. public static void main(String[] args) {
  4. C c = new C();
  5. if ((c instanceof Printable)) {
  6. throw new RuntimeException("declare parents : hasfield failed on super");
  7. }
  8. D d = new D();
  9. if ((d instanceof Printable)) {
  10. throw new RuntimeException("declare parents : hasfield failed on sub");
  11. }
  12. }
  13. }
  14. class C {
  15. private String printer;
  16. }
  17. class D extends C {
  18. }
  19. interface Printable {};