aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/annotations/declare/DecaDecpInteractions2.aj
diff options
context:
space:
mode:
Diffstat (limited to 'tests/java5/annotations/declare/DecaDecpInteractions2.aj')
-rw-r--r--tests/java5/annotations/declare/DecaDecpInteractions2.aj23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/java5/annotations/declare/DecaDecpInteractions2.aj b/tests/java5/annotations/declare/DecaDecpInteractions2.aj
new file mode 100644
index 000000000..200945972
--- /dev/null
+++ b/tests/java5/annotations/declare/DecaDecpInteractions2.aj
@@ -0,0 +1,23 @@
+import java.lang.annotation.*;
+
+interface Marker {}
+
+@Retention(RetentionPolicy.RUNTIME) @interface Color { String value();}
+
+// Color put on a particular type, marker interface added to any types with Color annotation
+// Decp specified first
+public aspect DecaDecpInteractions2 {
+
+ declare parents: @Color * implements Marker;
+
+ declare @type: A : @Color("red");
+}
+
+aspect X {
+ before(): execution(* *(..)) && this(Marker) {
+ System.err.println("Marker interface identified on "+thisJoinPoint);
+ }
+ before(): execution(* *(..)) && @this(Color) {
+ System.err.println("Color annotation identified on "+thisJoinPoint);
+ }
+}