aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs150/pr114005/Declaration1.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs150/pr114005/Declaration1.java')
-rw-r--r--tests/bugs150/pr114005/Declaration1.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/bugs150/pr114005/Declaration1.java b/tests/bugs150/pr114005/Declaration1.java
new file mode 100644
index 000000000..787be727b
--- /dev/null
+++ b/tests/bugs150/pr114005/Declaration1.java
@@ -0,0 +1,32 @@
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface SampleAnnotation { }
+
+interface TestInterface { }
+
+class Test implements TestInterface{}
+
+// First case: the ITD on the interface is annotated, it should make it through
+// to the member added to the implementor
+public aspect Declaration1 {
+
+ // ITD directly on the implementor
+ @SampleAnnotation
+ public String Test.firstProperty;
+
+ // ITD on the interface
+ @SampleAnnotation
+ public String TestInterface.secondProperty;
+
+ public static void main(String[] args) {
+ for (Field field: Test.class.getFields()) {
+ StringBuffer sb = new StringBuffer();
+ sb.append(field.toString());
+ boolean b = field.isAnnotationPresent(SampleAnnotation.class);
+ sb.append(" has annotation:").append(b);
+ System.out.println(sb.toString());
+ }
+ }
+} \ No newline at end of file