mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-15 02:13:50 +02:00
19 lines
332 B
Plaintext
19 lines
332 B
Plaintext
public aspect HasMethod {
|
|
|
|
declare parents : hasmethod(* print(..)) implements Printable;
|
|
|
|
public static void main(String[] args) {
|
|
C c = new C();
|
|
if (! (c instanceof Printable)) {
|
|
throw new RuntimeException("declare parents : hasmethod failed");
|
|
}
|
|
}
|
|
}
|
|
|
|
class C {
|
|
|
|
public void print() {}
|
|
|
|
}
|
|
|
|
interface Printable {}; |