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.

HasMethod.aj 332B

12345678910111213141516171819
  1. public aspect HasMethod {
  2. declare parents : hasmethod(* print(..)) 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 : hasmethod failed");
  7. }
  8. }
  9. }
  10. class C {
  11. public void print() {}
  12. }
  13. interface Printable {};