summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2010-11-24 19:38:28 +0000
committeraclement <aclement>2010-11-24 19:38:28 +0000
commit6d5d6bf4d7b86c691fb391884890095c55847ba0 (patch)
tree2bd8f6da5f1be5f8a1e082234ea2c332a9af6f94 /tests
parenta10c68cd874faf0f790da2db144fadcb4d5bb550 (diff)
downloadaspectj-6d5d6bf4d7b86c691fb391884890095c55847ba0.tar.gz
aspectj-6d5d6bf4d7b86c691fb391884890095c55847ba0.zip
329925: declare @field remove annotation
Diffstat (limited to 'tests')
-rw-r--r--tests/features1611/declareMinus/OnOffITD.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/features1611/declareMinus/OnOffITD.java b/tests/features1611/declareMinus/OnOffITD.java
new file mode 100644
index 000000000..438dd77bd
--- /dev/null
+++ b/tests/features1611/declareMinus/OnOffITD.java
@@ -0,0 +1,32 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Anno {}
+
+aspect Foo {
+ // one way round
+ declare @field: * OnOffITD.field: -@Anno;
+ declare @field: * OnOffITD.field: @Anno;
+
+ // the other way round
+ declare @field: * OnOffITD.field2: @Anno;
+ declare @field: * OnOffITD.field2: -@Anno;
+}
+
+aspect B {
+ public static int OnOffITD.field;
+ public int OnOffITD.field2;
+}
+
+public class OnOffITD {
+
+
+ public static void main(String[]argv) throws Exception {
+ Object o = OnOffITD.class.getDeclaredField("field").getAnnotation(Anno.class);
+ System.out.println("field annotated? "+(o==null?"no":"yes"));
+
+ o = OnOffITD.class.getDeclaredField("field2").getAnnotation(Anno.class);
+ System.out.println("field2 annotated? "+(o==null?"no":"yes"));
+ }
+}
+