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