summaryrefslogtreecommitdiffstats
path: root/tests/bugs174
diff options
context:
space:
mode:
authorAndy Clement <aclement@gopivotal.com>2013-10-01 10:00:14 -0700
committerAndy Clement <aclement@gopivotal.com>2013-10-18 11:36:29 -0700
commit2314eaf48a35a249e63fae12151ce926ea98c97c (patch)
tree27fb10ca8254958b652f22e8adf229c506fb1e47 /tests/bugs174
parentaba10968da43b517e68308e14681a14311a76d42 (diff)
downloadaspectj-2314eaf48a35a249e63fae12151ce926ea98c97c.tar.gz
aspectj-2314eaf48a35a249e63fae12151ce926ea98c97c.zip
418129: annos on top most implementor method
Diffstat (limited to 'tests/bugs174')
-rw-r--r--tests/bugs174/pr418129/Target.java27
-rw-r--r--tests/bugs174/pr418129/Target2.java27
-rw-r--r--tests/bugs174/pr418129/Target3.java27
-rw-r--r--tests/bugs174/pr418129/Target4.java25
4 files changed, 106 insertions, 0 deletions
diff --git a/tests/bugs174/pr418129/Target.java b/tests/bugs174/pr418129/Target.java
new file mode 100644
index 000000000..a3d1b2e97
--- /dev/null
+++ b/tests/bugs174/pr418129/Target.java
@@ -0,0 +1,27 @@
+import java.lang.annotation.*;
+
+interface Behavior {
+String hello();
+}
+
+aspect Trait {
+ // public String Behavior.name;
+
+ public String Behavior.hello() {
+ return "hello";
+ }
+}
+
+public class Target implements Behavior {
+ public static aspect A {
+// declare @field: * Target.name: @Tagged; // NO WORKY
+ declare @method: * Target.hello(..): @Tagged; // NO WORKY
+ }
+
+ public static void main(String []argv) throws Exception {
+ System.out.println(Target.class.getDeclaredMethod("hello").getDeclaredAnnotations()[0]);
+ }
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Tagged {}
diff --git a/tests/bugs174/pr418129/Target2.java b/tests/bugs174/pr418129/Target2.java
new file mode 100644
index 000000000..cc8b9e839
--- /dev/null
+++ b/tests/bugs174/pr418129/Target2.java
@@ -0,0 +1,27 @@
+import java.lang.annotation.*;
+
+interface Behavior {
+ String hello();
+}
+
+aspect Trait {
+// public String Behavior.name;
+
+ public String Behavior.hello() throws java.io.IOException {
+ return "hello";
+ }
+}
+
+public class Target2 implements Behavior {
+ public static aspect A {
+// declare @field: * Target2.name: @Tagged; // NO WORKY
+ declare @method: * Target2.hello(..): @Tagged; // NO WORKY
+ }
+
+ public static void main(String []argv) throws Exception {
+ System.out.println(Target2.class.getDeclaredMethod("hello").getDeclaredAnnotations()[0]);
+ }
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Tagged {}
diff --git a/tests/bugs174/pr418129/Target3.java b/tests/bugs174/pr418129/Target3.java
new file mode 100644
index 000000000..cba868929
--- /dev/null
+++ b/tests/bugs174/pr418129/Target3.java
@@ -0,0 +1,27 @@
+import java.lang.annotation.*;
+
+interface Behavior {
+ String hello();
+}
+
+aspect Trait {
+ @Wibble
+ public String Behavior.hello() throws java.io.IOException {
+ return "hello";
+ }
+}
+
+public class Target3 implements Behavior {
+ public static aspect A {
+ declare @method: * Target3.hello(..): @Tagged;
+ }
+
+ public static void main(String []argv) throws Exception {
+ System.out.println(Target3.class.getDeclaredMethod("hello").getDeclaredAnnotations().length);
+ System.out.println(Target3.class.getDeclaredMethod("hello").getDeclaredAnnotations()[0]);
+ System.out.println(Target3.class.getDeclaredMethod("hello").getDeclaredAnnotations()[1]);
+ }
+}
+
+@Retention(RetentionPolicy.RUNTIME) @interface Tagged {}
+@Retention(RetentionPolicy.RUNTIME) @interface Wibble {}
diff --git a/tests/bugs174/pr418129/Target4.java b/tests/bugs174/pr418129/Target4.java
new file mode 100644
index 000000000..4bae09c1f
--- /dev/null
+++ b/tests/bugs174/pr418129/Target4.java
@@ -0,0 +1,25 @@
+import java.lang.annotation.*;
+
+interface Behavior {
+ String hello();
+}
+
+aspect Trait {
+ @Tagged(31)
+ public String Behavior.hello() throws java.io.IOException {
+ return "hello";
+ }
+}
+
+public class Target4 implements Behavior {
+ public static aspect A {
+ declare @method: * Target4.hello(..): @Tagged;
+ }
+
+ public static void main(String []argv) throws Exception {
+ System.out.println(Target4.class.getDeclaredMethod("hello").getDeclaredAnnotations().length);
+ System.out.println(Target4.class.getDeclaredMethod("hello").getDeclaredAnnotations()[0]);
+ }
+}
+
+@Retention(RetentionPolicy.RUNTIME) @interface Tagged { int value() default 42;}