aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/annotations
diff options
context:
space:
mode:
authoraclement <aclement>2005-02-07 13:29:29 +0000
committeraclement <aclement>2005-02-07 13:29:29 +0000
commitec8a423b7232747f9979dc48a69d05b2c399a6ec (patch)
tree5c13143a49c9119f2de11928da3a69dbc95e64fa /tests/java5/annotations
parent953fd4340f6eb6c578d591be9a0d601daf35ca6d (diff)
downloadaspectj-ec8a423b7232747f9979dc48a69d05b2c399a6ec.tar.gz
aspectj-ec8a423b7232747f9979dc48a69d05b2c399a6ec.zip
Testcases and fix for using @target() when the annotation is in a package.
Diffstat (limited to 'tests/java5/annotations')
-rw-r--r--tests/java5/annotations/binding/usingPackageNames/MyAnnotation.java6
-rw-r--r--tests/java5/annotations/binding/usingPackageNames/MyAspect.aj8
-rw-r--r--tests/java5/annotations/binding/usingPackageNames/MyClass.java13
3 files changed, 27 insertions, 0 deletions
diff --git a/tests/java5/annotations/binding/usingPackageNames/MyAnnotation.java b/tests/java5/annotations/binding/usingPackageNames/MyAnnotation.java
new file mode 100644
index 000000000..1e6dcbd31
--- /dev/null
+++ b/tests/java5/annotations/binding/usingPackageNames/MyAnnotation.java
@@ -0,0 +1,6 @@
+package test;
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface MyAnnotation {}
+
diff --git a/tests/java5/annotations/binding/usingPackageNames/MyAspect.aj b/tests/java5/annotations/binding/usingPackageNames/MyAspect.aj
new file mode 100644
index 000000000..41fda5537
--- /dev/null
+++ b/tests/java5/annotations/binding/usingPackageNames/MyAspect.aj
@@ -0,0 +1,8 @@
+package test;
+
+public aspect MyAspect {
+ after(test.MyAnnotation ma) : set (public String test.MyClass._myField) && @target(ma){
+ System.err.println("pointcut matching : " + ma);
+ }
+}
+
diff --git a/tests/java5/annotations/binding/usingPackageNames/MyClass.java b/tests/java5/annotations/binding/usingPackageNames/MyClass.java
new file mode 100644
index 000000000..6a373d091
--- /dev/null
+++ b/tests/java5/annotations/binding/usingPackageNames/MyClass.java
@@ -0,0 +1,13 @@
+package test;
+@MyAnnotation public class MyClass {
+
+ public String _myField;
+
+ public static void main(String[] args) {
+ new MyClass().setMyField("test");
+ }
+
+ public void setMyField(String nv) {
+ this._myField = nv;
+ }
+}