1
2
3
4
5
6
7
8
9
10
11
12 package com.puppycrawl.tools.checkstyle.checks.annotation.annotationlocation;
13
14
15 @MyAnn_21 @com.puppycrawl.tools.checkstyle.checks.annotation.annotationlocation.MyAnn
16 (value = "")
17 class InputAnnotationLocationIncorrectOne
18 {
19
20 @MyAnn_21 @MyAnnotation1(value = "")
21 public int a;
22
23 @MyAnnotation1(value = "") public int b;
24
25 @MyAnn_21
26 @MyAnnotation1
27 (value = "")
28 public int c;
29
30 @MyAnnotation1(value = "")
31 public int d;
32
33 @MyAnn_21
34 @MyAnnotation1
35 (value = "")
36 public InputAnnotationLocationIncorrectOne() {}
37
38 @MyAnnotation1("foo") @MyAnn_21 void foo1() {}
39
40 @MyAnnotation1(value = "")
41 @MyAnn_21
42 void foo2() {}
43
44 @MyAnnotation1(value = "")
45 @MyAnn_21
46 @MyAnnotation3
47 @MyAnnotation4
48 class InnerClass
49 {
50 @MyAnn_21 @MyAnnotation1
51 (value = "")
52 public int a;
53
54 @MyAnnotation1(value = "") public int b;
55
56 @MyAnn_21
57 @MyAnnotation1
58 (value = "")
59 public int c;
60
61 @MyAnnotation1(value = "")
62 public int d;
63
64 @MyAnn_21
65 @MyAnnotation1(value = "") public InnerClass()
66 {
67
68 }
69 @MyAnnotation1(value = "")
70 @MyAnn_21
71 void foo1() {}
72
73 @MyAnnotation1(value = "")
74 @MyAnn_21
75 void foo2() {}
76 }
77
78 @MyAnnotation1(value = "")
79 @MyAnn_21
80 InnerClass anon = new InnerClass()
81 {
82 @MyAnn_21 @MyAnnotation1(value = "") public int a;
83
84 @MyAnnotation1(value = "") public int b;
85
86 @MyAnn_21
87 @MyAnnotation1(value = "")
88 public int c;
89
90 @MyAnnotation1(value = "")
91 public int d;
92
93 @MyAnnotation1(value = "")
94 @MyAnn_21 void foo1() {}
95
96 @MyAnnotation1(value = "")
97 @MyAnn_21
98 void foo2() {}
99 @MyAnnotation1(value = "") void foo42() {}
100 };
101
102 }
103
104
105 @interface MyAnnotation1 {
106
107 String value();}
108
109 @interface MyAnn_21 {}
110
111 @interface MyAnnotation3 {}
112
113 @interface MyAnnotation4 {}
114
115 @interface MyAnn {
116
117 String value();}