summaryrefslogtreecommitdiffstats
path: root/tests/java5/generics/genericaspects/DecAnnGenericTest.aj
diff options
context:
space:
mode:
Diffstat (limited to 'tests/java5/generics/genericaspects/DecAnnGenericTest.aj')
-rw-r--r--tests/java5/generics/genericaspects/DecAnnGenericTest.aj35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/java5/generics/genericaspects/DecAnnGenericTest.aj b/tests/java5/generics/genericaspects/DecAnnGenericTest.aj
new file mode 100644
index 000000000..c42160f21
--- /dev/null
+++ b/tests/java5/generics/genericaspects/DecAnnGenericTest.aj
@@ -0,0 +1,35 @@
+import java.lang.annotation.*;
+
+
+abstract aspect DAGenTest<X> {
+
+ declare @type: X : @MyAnnotation;
+
+ declare @method: * X.*(..) : @MyAnnotation;
+
+ declare @constructor: X.new(..) : @MyAnnotation;
+
+ declare @field: X X.* : @MyAnnotation;
+
+}
+
+@interface MyAnnotation {}
+
+class C {
+
+ C c = null;
+
+ public C() {}
+
+ public void foo() {}
+
+}
+
+aspect Sub extends DAGenTest<C> {
+
+ declare warning : staticinitialization(@MyAnnotation *) : "@type ok";
+ declare warning : execution(@MyAnnotation *.new(..)) : "@constructor ok";
+ declare warning : execution(@MyAnnotation * *.*(..)) : "@method ok";
+ declare warning : set(@MyAnnotation * *) : "@field ok";
+
+} \ No newline at end of file