aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5
diff options
context:
space:
mode:
Diffstat (limited to 'tests/java5')
-rw-r--r--tests/java5/annotations/attarget/AtTargetAspect.java7
-rw-r--r--tests/java5/annotations/attarget/Program.java25
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/java5/annotations/attarget/AtTargetAspect.java b/tests/java5/annotations/attarget/AtTargetAspect.java
new file mode 100644
index 000000000..8e9238262
--- /dev/null
+++ b/tests/java5/annotations/attarget/AtTargetAspect.java
@@ -0,0 +1,7 @@
+public aspect AtTargetAspect {
+
+ before(): call(* *(..)) && @target(@MyAnnotation) {
+ System.err.println("advice running");
+ }
+
+}
diff --git a/tests/java5/annotations/attarget/Program.java b/tests/java5/annotations/attarget/Program.java
new file mode 100644
index 000000000..a56d5fb5e
--- /dev/null
+++ b/tests/java5/annotations/attarget/Program.java
@@ -0,0 +1,25 @@
+import java.lang.annotation.*;
+
+@MyAnnotation
+public class Program {
+
+ public static void main(String []argv) {
+ Program p = new Program();
+ p.m1();
+ p.m2();
+ }
+
+
+ @MyAnnotation
+ public void m1() {
+ System.err.println("m1 method");
+ }
+
+ public void m2() {
+ System.err.println("m2 method");
+ }
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface MyAnnotation {}
+