framework/tests/all-systems/Annotations.java
raw| 1 | import java.lang.annotation.Annotation; |
| 2 | |
| 3 | @interface Anno {} |
| 4 | |
| 5 | class Annotations { |
| 6 | void takeAnnotation(Annotation a) {} |
| 7 | |
| 8 | // test that a Tree works (source for Anno is in same compilation unit) |
| 9 | void takeTree(Anno a1) { |
| 10 | takeAnnotation(a1); |
| 11 | } |
| 12 | |
| 13 | // test that an Element works (annotation only available from class file) |
| 14 | void takeElem(SuppressWarnings a2) { |
| 15 | takeAnnotation(a2); |
| 16 | } |
| 17 | } |