diff options
author | aclement <aclement> | 2006-03-27 21:16:39 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-03-27 21:16:39 +0000 |
commit | 638db357bdf26a8afb6699c84002762fa7d4e518 (patch) | |
tree | c5d0b3916c49dc856dd0a5e1d50b1840575e0364 /tests/bugs151 | |
parent | 6c4770cba1ff07c1d5a406b34f0cfc44a3e05ebe (diff) | |
download | aspectj-638db357bdf26a8afb6699c84002762fa7d4e518.tar.gz aspectj-638db357bdf26a8afb6699c84002762fa7d4e518.zip |
test and fixes for 98901, comment 29
Diffstat (limited to 'tests/bugs151')
-rw-r--r-- | tests/bugs151/pr98901/Failing.java | 28 | ||||
-rw-r--r-- | tests/bugs151/pr98901/Failing2.java | 28 |
2 files changed, 56 insertions, 0 deletions
diff --git a/tests/bugs151/pr98901/Failing.java b/tests/bugs151/pr98901/Failing.java new file mode 100644 index 000000000..b4103f9e1 --- /dev/null +++ b/tests/bugs151/pr98901/Failing.java @@ -0,0 +1,28 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +@interface TestAnnotation { + public boolean value() default true; +} + +aspect TestAspect { + declare parents: Failing implements TestInterface; +// this also does not work (even when removing annotation in the following ITD) +// declare @method: public void TestInterface.foo(): @TestAnnotation; + @TestAnnotation + public void TestInterface.foo() { + System.err.println("foo"); + } +} + +interface TestInterface { + public void foo(); +} + +public class Failing { + public static void main(String[] args) throws Exception { + System.err.println("On TestInterface:"+TestInterface.class.getDeclaredMethod("foo").getAnnotation(TestAnnotation.class)); + System.err.println("On Failing:"+Failing.class.getDeclaredMethod("foo").getAnnotation(TestAnnotation.class)); + } +}
\ No newline at end of file diff --git a/tests/bugs151/pr98901/Failing2.java b/tests/bugs151/pr98901/Failing2.java new file mode 100644 index 000000000..1daeb4498 --- /dev/null +++ b/tests/bugs151/pr98901/Failing2.java @@ -0,0 +1,28 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +@interface TestAnnotation { + public boolean value() default true; +} + +aspect TestAspect { + declare parents: Failing2 implements TestInterface; + + declare @method: public void TestInterface.foo(): @TestAnnotation; + + public void TestInterface.foo() { + System.err.println("foo"); + } +} + +interface TestInterface { + public void foo(); +} + +public class Failing2 { + public static void main(String[] args) throws Exception { + System.err.println("On TestInterface:"+TestInterface.class.getDeclaredMethod("foo").getAnnotation(TestAnnotation.class)); + System.err.println("On Failing2:"+Failing2.class.getDeclaredMethod("foo").getAnnotation(TestAnnotation.class)); + } +}
\ No newline at end of file |