aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/annotations
diff options
context:
space:
mode:
authoraclement <aclement>2005-01-24 09:38:48 +0000
committeraclement <aclement>2005-01-24 09:38:48 +0000
commit9367b36e48a91755c82acee5693aae2980de3ded (patch)
treebfe67e802fcfe7cc7e885b4b4b8a808bded08959 /tests/java5/annotations
parent1076c8361630be6441f26d561b20f3116529db96 (diff)
downloadaspectj-9367b36e48a91755c82acee5693aae2980de3ded.tar.gz
aspectj-9367b36e48a91755c82acee5693aae2980de3ded.zip
Fix to ensure woven methods don't lose their annotations.
Diffstat (limited to 'tests/java5/annotations')
-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 {}
+