summaryrefslogtreecommitdiffstats
path: root/tests/java5/annotations/ajdkExamples/AnnotationPatternMatching.aj
diff options
context:
space:
mode:
Diffstat (limited to 'tests/java5/annotations/ajdkExamples/AnnotationPatternMatching.aj')
-rw-r--r--tests/java5/annotations/ajdkExamples/AnnotationPatternMatching.aj35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/java5/annotations/ajdkExamples/AnnotationPatternMatching.aj b/tests/java5/annotations/ajdkExamples/AnnotationPatternMatching.aj
new file mode 100644
index 000000000..23be9d785
--- /dev/null
+++ b/tests/java5/annotations/ajdkExamples/AnnotationPatternMatching.aj
@@ -0,0 +1,35 @@
+import org.xyz.*;
+
+public aspect AnnotationPatternMatching {
+
+ declare warning : execution(@Immutable * *(..)) : "@Immutable";
+
+ declare warning : execution(!@Persistent * *(..)) : "!@Persistent";
+
+ declare warning : execution(@Foo @Goo * *(..)) : "@Foo @Goo";
+
+ declare warning : execution(@(Foo || Goo) * *(..)) : "@(Foo || Goo)";
+
+ declare warning : execution(@(org.xyz..*) * *(..)) : "@(org.xyz..*)";
+
+}
+
+@interface Immutable {}
+@interface Persistent {}
+@interface Foo{}
+@interface Goo{}
+
+
+class Annotated {
+
+ @Immutable void m1() {}
+
+ @Persistent void m2() {}
+
+ @Foo @Goo void m3() {}
+
+ @Foo void m4() {}
+
+ @OrgXYZAnnotation void m5() {}
+
+} \ No newline at end of file