blob: 364ce303404b3a8ab2cdb3cbdbd6be8bc5214807 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
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");
}
|