aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs151
diff options
context:
space:
mode:
authoraclement <aclement>2006-03-24 10:10:02 +0000
committeraclement <aclement>2006-03-24 10:10:02 +0000
commit2fb86fe604b613774492df5185b1c5717c434d29 (patch)
tree9812ad9e7ec63083f5d73e703cc26e9e9d8067d8 /tests/bugs151
parent6aef2d916321e2a37837bc1cd3fa255b153bdfa0 (diff)
downloadaspectj-2fb86fe604b613774492df5185b1c5717c434d29.tar.gz
aspectj-2fb86fe604b613774492df5185b1c5717c434d29.zip
test and fix for 132926
Diffstat (limited to 'tests/bugs151')
-rw-r--r--tests/bugs151/Deca/DecA.java36
-rw-r--r--tests/bugs151/pr132926/AffectedType.java10
-rw-r--r--tests/bugs151/pr132926/InputAnnotation.java5
-rw-r--r--tests/bugs151/pr132926/InputAnnotation2.java5
4 files changed, 56 insertions, 0 deletions
diff --git a/tests/bugs151/Deca/DecA.java b/tests/bugs151/Deca/DecA.java
new file mode 100644
index 000000000..c668c740c
--- /dev/null
+++ b/tests/bugs151/Deca/DecA.java
@@ -0,0 +1,36 @@
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.reflect.Method;
+import java.util.Iterator;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface One {}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Two {}
+
+class Target {
+ public void m() {}
+}
+
+aspect X {
+ declare @method: * Target.*(..): @One;
+ declare @method: * Target.*(..): @Two;
+}
+
+public class DecA {
+ public static void main(String []argv) {
+ try {
+ Class c = Target.class;
+ Method m = c.getDeclaredMethod("m",null);
+ Annotation[] anns = m.getAnnotations();
+ System.err.println("There are "+anns.length+" annotations on public void m():");
+ for (int i = 0; i < anns.length; i++) {
+ System.err.println((i+1)+") "+anns[i]);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/bugs151/pr132926/AffectedType.java b/tests/bugs151/pr132926/AffectedType.java
new file mode 100644
index 000000000..41551645f
--- /dev/null
+++ b/tests/bugs151/pr132926/AffectedType.java
@@ -0,0 +1,10 @@
+public class AffectedType {
+
+ public static void main(String[] args) {
+
+ }
+}
+
+aspect X {
+ declare @type: AffectedType: @InputAnnotation;
+} \ No newline at end of file
diff --git a/tests/bugs151/pr132926/InputAnnotation.java b/tests/bugs151/pr132926/InputAnnotation.java
new file mode 100644
index 000000000..db4ebd9a4
--- /dev/null
+++ b/tests/bugs151/pr132926/InputAnnotation.java
@@ -0,0 +1,5 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@interface InputAnnotation {}
diff --git a/tests/bugs151/pr132926/InputAnnotation2.java b/tests/bugs151/pr132926/InputAnnotation2.java
new file mode 100644
index 000000000..7fb2afe9a
--- /dev/null
+++ b/tests/bugs151/pr132926/InputAnnotation2.java
@@ -0,0 +1,5 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+@interface InputAnnotation {}