From 943833fe1ac494becf1b5fb6b3b5cda3eef6ec4d Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 9 Sep 2009 19:10:33 +0000 Subject: 288635: fix --- tests/bugs166/pr288635/AddAnnotation.java | 3 +++ tests/bugs166/pr288635/Anno.java | 9 +++++++++ tests/bugs166/pr288635/InterceptTraceds.java | 11 +++++++++++ tests/bugs166/pr288635/MakeItd.java | 5 +++++ tests/bugs166/pr288635/TestClass.java | 8 ++++++++ tests/bugs166/pr288635/aop1.xml | 11 +++++++++++ 6 files changed, 47 insertions(+) create mode 100644 tests/bugs166/pr288635/AddAnnotation.java create mode 100644 tests/bugs166/pr288635/Anno.java create mode 100644 tests/bugs166/pr288635/InterceptTraceds.java create mode 100644 tests/bugs166/pr288635/MakeItd.java create mode 100644 tests/bugs166/pr288635/TestClass.java create mode 100644 tests/bugs166/pr288635/aop1.xml (limited to 'tests/bugs166') diff --git a/tests/bugs166/pr288635/AddAnnotation.java b/tests/bugs166/pr288635/AddAnnotation.java new file mode 100644 index 000000000..49e5a58db --- /dev/null +++ b/tests/bugs166/pr288635/AddAnnotation.java @@ -0,0 +1,3 @@ +public aspect AddAnnotation { + declare @method : public int *do*(..) : @Anno; +} diff --git a/tests/bugs166/pr288635/Anno.java b/tests/bugs166/pr288635/Anno.java new file mode 100644 index 000000000..5bf02247c --- /dev/null +++ b/tests/bugs166/pr288635/Anno.java @@ -0,0 +1,9 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Anno { + String level() default "debug"; +} diff --git a/tests/bugs166/pr288635/InterceptTraceds.java b/tests/bugs166/pr288635/InterceptTraceds.java new file mode 100644 index 000000000..a33f4ad8b --- /dev/null +++ b/tests/bugs166/pr288635/InterceptTraceds.java @@ -0,0 +1,11 @@ +public aspect InterceptTraceds { + + before(Anno t) : execution(@Anno * *.*(..)) && @annotation(t) { + if (t != null) { + System.out.println("Executing " + thisJoinPoint + " on level " + t.level()); + } else { + System.out.println("Annotation was null on " + thisJoinPoint); + } + } + +} diff --git a/tests/bugs166/pr288635/MakeItd.java b/tests/bugs166/pr288635/MakeItd.java new file mode 100644 index 000000000..50a8cfef3 --- /dev/null +++ b/tests/bugs166/pr288635/MakeItd.java @@ -0,0 +1,5 @@ +public aspect MakeItd { + public int TestClass.doAnother() { + return 2; + } +} diff --git a/tests/bugs166/pr288635/TestClass.java b/tests/bugs166/pr288635/TestClass.java new file mode 100644 index 000000000..e4623c23a --- /dev/null +++ b/tests/bugs166/pr288635/TestClass.java @@ -0,0 +1,8 @@ +public class TestClass { + + public static void main(String[] args) { + TestClass tc = new TestClass(); + tc.doAnother(); + } + +} diff --git a/tests/bugs166/pr288635/aop1.xml b/tests/bugs166/pr288635/aop1.xml new file mode 100644 index 000000000..d15cde668 --- /dev/null +++ b/tests/bugs166/pr288635/aop1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + -- cgit v1.2.3