diff options
Diffstat (limited to 'tests/java5/annotations/declare/atmethodctor/WrongTarget.aj')
-rw-r--r-- | tests/java5/annotations/declare/atmethodctor/WrongTarget.aj | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/java5/annotations/declare/atmethodctor/WrongTarget.aj b/tests/java5/annotations/declare/atmethodctor/WrongTarget.aj new file mode 100644 index 000000000..364ce3034 --- /dev/null +++ b/tests/java5/annotations/declare/atmethodctor/WrongTarget.aj @@ -0,0 +1,13 @@ +// trying to put wrong annotations onto a field +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) @interface MethodColoring { String value(); } +@Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @interface TypeColoring { String value(); } + +public aspect WrongTarget { + declare @method: void m1(..) : @MethodColoring("red"); + declare @method: void m1(..) : @TypeColoring("blue"); + declare @constructor: new(..) : @MethodColoring("red"); + declare @constructor: new(..) : @TypeColoring("blue"); +} + |