forked from checkstyle/checkstyle
/
InputAnnotationLocation.java
105 lines (75 loc) · 2.01 KB
/
InputAnnotationLocation.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package com.google.checkstyle.test.chapter4formatting.rule485annotations;
@MyAnnotation2 @MyAnnotation1 //warn
class InputAnnotationLocation
{
@MyAnnotation2 @MyAnnotation1
public int a;
@MyAnnotation1 public int b;
@MyAnnotation2
@MyAnnotation1
public int c;
@MyAnnotation1
public int d;
@MyAnnotation2
@MyAnnotation1 //warn
public InputAnnotationLocation() {}
@MyAnnotationWithParam("foo")
@MyAnnotation2 void foo1() {}
@MyAnnotation1
@MyAnnotation2 //warn
void foo2() {}
@MyAnnotation1
@MyAnnotation2 //warn
@MyAnnotation3 //warn
@MyAnnotation4 //warn
class InnerClass
{
@MyAnnotation2 @MyAnnotation1
public int a;
@MyAnnotation1 public int b;
@MyAnnotation2
@MyAnnotation1
public int c;
@MyAnnotation1
public int d;
@MyAnnotation2
@MyAnnotation1 public InnerClass()
{
// OOOO Auto-generated constructor stub
}
@MyAnnotation1
@MyAnnotation2 //warn
void foo1() {}
@MyAnnotation1
@MyAnnotation2 //warn
void foo2() {}
}
@MyAnnotation1
@MyAnnotation2
InnerClass anon = new InnerClass()
{
@MyAnnotation2 @MyAnnotation1 public int a;
@MyAnnotation1 public int b;
@MyAnnotation2
@MyAnnotation1
public int c;
@MyAnnotation1
public int d;
@MyAnnotation1
@MyAnnotation2 void foo1() {} //warn
@MyAnnotation1
@MyAnnotation2 //warn
void foo2() {}
@MyAnnotation1 void foo42() {}
};
}
@MyAnnotation1
@MyAnnotation2 //warn
class Foo {}
@MyAnnotationWithParam(value = "bar") class Bar {} //warn
@interface MyAnnotation1 {}
@interface MyAnnotation2 {}
@interface MyAnnotation3 {}
@interface MyAnnotation4 {}
@interface MyAnnotationWithParam {
String value();}