1
2
3
4
5
6
7
8
9 package com.puppycrawl.tools.checkstyle.checks.coding.declarationorder;
10
11 public class InputDeclarationOrder
12 {
13 static final int FOO2 = 3;
14
15
16 public static final int FOO = 3;
17
18 private static final int FOO3 = 3;
19
20
21 public static final int FOO4 = 3;
22
23 private static final String ERROR = "error";
24
25
26 protected static final String ERROR1 = "error";
27
28
29 public static final String WARNING = "warning";
30
31 private int mMaxInitVars = 3;
32
33
34
35 public static final int MAX_ITER_VARS = 3;
36
37 private class InnerClass
38 {
39 private static final int INNER_FOO = 2;
40
41
42 public static final int INNER_FOO2 = 2;
43
44 public InnerClass()
45 {
46 int foo = INNER_FOO;
47 foo += INNER_FOO2;
48 foo += INNER_FOO3;
49 }
50
51 public InnerClass(int start)
52 {
53 int foo = start;
54 foo += INNER_FOO2;
55 foo += INNER_FOO3;
56 }
57
58
59
60 public static final int INNER_FOO3 = 2;
61 }
62
63 public int getFoo1()
64 {
65 return mFoo;
66 }
67
68
69 public InputDeclarationOrder()
70 {
71 String foo = ERROR;
72 foo += ERROR1;
73 foo += WARNING;
74 int fooInt = mMaxInitVars;
75 fooInt += MAX_ITER_VARS;
76 fooInt += mFoo;
77 }
78
79 public static int getFoo2()
80 {
81 return 13;
82 }
83
84 public int getFoo()
85 {
86 return mFoo;
87 }
88
89 private static int getFoo21()
90 {
91 return 14;
92 }
93
94
95 private int mFoo = 0;
96 }
97
98 enum InputDeclarationOrderEnum
99 {
100 ENUM_VALUE_1,
101 ENUM_VALUE_2,
102 ENUM_VALUE_3
103 {
104 private static final int INNER_FOO = 2;
105
106
107 public static final int INNER_FOO2 = 2;
108
109 public void doIt()
110 {
111 }
112
113
114
115 public static final int INNER_FOO3 = 2;
116 };
117
118 static final int FOO2 = 3;
119
120
121 public static final int FOO = 3;
122
123 private static final int FOO3 = 3;
124
125
126 public static final int FOO4 = 3;
127
128 private static final String ERROR = "error";
129
130
131 protected static final String ERROR1 = "error";
132
133
134 public static final String WARNING = "warning";
135
136 private int mMaxInitVars = 3;
137
138
139
140 public static final int MAX_ITER_VARS = 3;
141
142 private class InnerClass
143 {
144 private static final int INNER_FOO = 2;
145
146
147 public static final int INNER_FOO2 = 2;
148
149 public InnerClass()
150 {
151 int foo = INNER_FOO;
152 foo += INNER_FOO2;
153 foo += INNER_FOO3;
154 }
155
156
157
158 public static final int INNER_FOO3 = 2;
159 }
160
161 public int getFoo1()
162 {
163 return mFoo;
164 }
165
166
167 InputDeclarationOrderEnum()
168 {
169 String foo = ERROR;
170 foo += ERROR1;
171 foo += WARNING;
172 int fooInt = mMaxInitVars;
173 fooInt += MAX_ITER_VARS;
174 fooInt += mFoo;
175 }
176
177 public static int getFoo2()
178 {
179 return 2;
180 }
181
182 public int getFoo()
183 {
184 return mFoo;
185 }
186
187 private static int getFoo21()
188 {
189 return 1;
190 }
191
192
193 private int mFoo = 0;
194
195 class AsyncProcess {
196 private final int startLogErrorsCnt = 0;
197
198 protected final int maxTotalConcurrentTasks=0;
199 }
200 }