1
2
3
4
5
6
7
8
9 package com.puppycrawl.tools.checkstyle.checks.coding.declarationorder;
10
11 public class InputDeclarationOrderOnlyModifiers
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 public InputDeclarationOrderOnlyModifiers()
69 {
70 String foo = ERROR;
71 foo += ERROR1;
72 foo += WARNING;
73 int fooInt = mMaxInitVars;
74 fooInt += MAX_ITER_VARS;
75 fooInt += mFoo;
76 }
77
78 public static int getFoo2()
79 {
80 return 13;
81 }
82
83 public int getFoo()
84 {
85 return mFoo;
86 }
87
88 private static int getFoo21()
89 {
90 return 14;
91 }
92
93
94 private int mFoo = 0;
95 }
96
97 enum InputDeclarationOrderEnum3
98 {
99 ENUM_VALUE_1,
100 ENUM_VALUE_2,
101 ENUM_VALUE_3
102 {
103 private static final int INNER_FOO = 2;
104
105
106 public static final int INNER_FOO2 = 2;
107
108 public void doIt()
109 {
110 }
111
112
113
114 public static final int INNER_FOO3 = 2;
115 };
116
117 static final int FOO2 = 3;
118
119
120 public static final int FOO = 3;
121
122 private static final int FOO3 = 3;
123
124
125 public static final int FOO4 = 3;
126
127 private static final String ERROR = "error";
128
129
130 protected static final String ERROR1 = "error";
131
132
133 public static final String WARNING = "warning";
134
135 private int mMaxInitVars = 3;
136
137
138
139 public static final int MAX_ITER_VARS = 3;
140
141 private class InnerClass
142 {
143 private static final int INNER_FOO = 2;
144
145
146 public static final int INNER_FOO2 = 2;
147
148 public InnerClass()
149 {
150 int foo = INNER_FOO;
151 foo += INNER_FOO2;
152 foo += INNER_FOO3;
153 }
154
155
156
157 public static final int INNER_FOO3 = 2;
158 }
159
160 public int getFoo1()
161 {
162 return mFoo;
163 }
164
165 InputDeclarationOrderEnum3()
166 {
167 String foo = ERROR;
168 foo += ERROR1;
169 foo += WARNING;
170 int fooInt = mMaxInitVars;
171 fooInt += MAX_ITER_VARS;
172 fooInt += mFoo;
173 }
174
175 public static int getFoo2()
176 {
177 return 2;
178 }
179
180 public int getFoo()
181 {
182 return mFoo;
183 }
184
185 private static int getFoo21()
186 {
187 return 1;
188 }
189
190
191 private int mFoo = 0;
192
193 class AsyncProcess {
194 private final int startLogErrorsCnt = 0;
195
196 protected final int maxTotalConcurrentTasks = 0;
197 }
198 }