aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs161/pr235597
diff options
context:
space:
mode:
authoraclement <aclement>2008-06-04 17:21:14 +0000
committeraclement <aclement>2008-06-04 17:21:14 +0000
commit14714d87d8e6822bb980c6fe6e3f5ef0a26537f7 (patch)
treeb828b3019dbbe6cb4036b786fc11f349b8dd53bc /tests/bugs161/pr235597
parent52e8c2b37de4e4f18efe303b0e49e471ea75077e (diff)
downloadaspectj-14714d87d8e6822bb980c6fe6e3f5ef0a26537f7.tar.gz
aspectj-14714d87d8e6822bb980c6fe6e3f5ef0a26537f7.zip
235597: test and fix: annotations on generic methods
Diffstat (limited to 'tests/bugs161/pr235597')
-rw-r--r--tests/bugs161/pr235597/AnnotationTest1.java35
-rw-r--r--tests/bugs161/pr235597/SomeAnnotation.java10
-rw-r--r--tests/bugs161/pr235597/SomeAspect.java29
3 files changed, 74 insertions, 0 deletions
diff --git a/tests/bugs161/pr235597/AnnotationTest1.java b/tests/bugs161/pr235597/AnnotationTest1.java
new file mode 100644
index 000000000..5106fe1ed
--- /dev/null
+++ b/tests/bugs161/pr235597/AnnotationTest1.java
@@ -0,0 +1,35 @@
+public class AnnotationTest1 {
+
+ @SomeAnnotation
+ public void test() {
+ System.out.println("test 1");
+ }
+
+ public static void main(String[] args) {
+ //CASE 1
+ AnnotationTest1 test1 = new AnnotationTest1();
+ test1.test();
+ //CASE 2
+ AnnotationTest2<Integer> test2 = new AnnotationTest2<Integer>();
+ test2.test2();
+ //CASE 3
+ AnnotationTest3 test3 = new AnnotationTest3();
+ test3.test3();
+ }
+
+ public static class AnnotationTest2<Type extends Object> {
+
+ @SomeAnnotation
+ public void test2() {
+ System.out.println("test 2");
+ }
+ }
+
+ public static class AnnotationTest3 extends AnnotationTest2<Double> {
+
+ @SomeAnnotation
+ public void test3() {
+ System.out.println("test 3");
+ }
+ }
+}
diff --git a/tests/bugs161/pr235597/SomeAnnotation.java b/tests/bugs161/pr235597/SomeAnnotation.java
new file mode 100644
index 000000000..3ac1453b1
--- /dev/null
+++ b/tests/bugs161/pr235597/SomeAnnotation.java
@@ -0,0 +1,10 @@
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface SomeAnnotation {
+
+}
diff --git a/tests/bugs161/pr235597/SomeAspect.java b/tests/bugs161/pr235597/SomeAspect.java
new file mode 100644
index 000000000..072e133e2
--- /dev/null
+++ b/tests/bugs161/pr235597/SomeAspect.java
@@ -0,0 +1,29 @@
+public aspect SomeAspect {
+
+ void around(final SomeAnnotation someAnnotation) :
+ call(@SomeAnnotation void *.*(..)) && @annotation(someAnnotation) {
+
+ System.out.println("@someAspect annotation parameter (call)");
+//CASES 1, 3 only
+ proceed(someAnnotation);
+ }
+
+ void around(final SomeAnnotation someAnnotation) :
+ execution(@SomeAnnotation void *.*(..)) &&
+@annotation(someAnnotation) {
+
+ System.out.println("@someAspect annotation parameter (execution)"); //CASES 1, 2, 3
+ proceed(someAnnotation);
+ }
+
+ void around() : call(@SomeAnnotation void *.*(..)) {
+ System.out.println("@someAspect annotation no parameter");
+//CASES 1, 2, 3
+ proceed();
+ }
+
+ void around() : call(void *.test*(..)) {
+ System.out.println("@someAspect method name"); //CASES 1, 2, 3
+ proceed();
+ }
+}