aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs150/pr98901/Case02.aj
diff options
context:
space:
mode:
authoraclement <aclement>2005-07-18 08:34:11 +0000
committeraclement <aclement>2005-07-18 08:34:11 +0000
commite15794a2aa3c981571d54ff370c6e4f1d9ee97b1 (patch)
treee5fa3872d447ad70566746b0a0e697a40eac59f5 /tests/bugs150/pr98901/Case02.aj
parentbba9c50768a1db72fc8606a80762333d4b12d140 (diff)
downloadaspectj-e15794a2aa3c981571d54ff370c6e4f1d9ee97b1.tar.gz
aspectj-e15794a2aa3c981571d54ff370c6e4f1d9ee97b1.zip
testcases for pr98901 (annotations copied to targets of decannotation). Not yet wired into the full 150 suite.
Diffstat (limited to 'tests/bugs150/pr98901/Case02.aj')
-rw-r--r--tests/bugs150/pr98901/Case02.aj25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/bugs150/pr98901/Case02.aj b/tests/bugs150/pr98901/Case02.aj
new file mode 100644
index 000000000..2ad28a606
--- /dev/null
+++ b/tests/bugs150/pr98901/Case02.aj
@@ -0,0 +1,25 @@
+//"public method on the aspect that declares @method on it"
+
+import java.lang.annotation.*;
+import java.lang.reflect.Method;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface anInterface{}
+
+aspect B02 {
+ public void a(){}
+ declare @method : void B02.a(..) : @anInterface;
+
+ public static void main(String [] args){
+ Class c = B02.class;
+ try {
+ Method m = c.getDeclaredMethod("a", new Class [0]);
+ Annotation [] anns = m.getDeclaredAnnotations();
+ for (int i = 0;i < anns.length;i++){
+ System.out.println(anns[i]);
+ }
+ } catch (Exception e){
+ System.out.println("exceptional!");
+ }
+ }
+}