1
2
3
4
5
6
7
8
9
10
11
12 package com.puppycrawl.tools.checkstyle.checks.coding.hiddenfield;
13
14
15
16
17
18
19
20
21
22
23 class InputHiddenField6
24 {
25 private int hidden = 0;
26
27 public InputHiddenField6()
28 {
29 int hidden = 0;
30 }
31
32 public InputHiddenField6(int hidden)
33 {
34 }
35
36 public void shadow()
37 {
38 int hidden = 0;
39 }
40
41 public void shadowFor()
42 {
43 for (int hidden = 0; hidden < 1; hidden++) {
44 }
45 }
46
47 public void shadowParam(int hidden)
48 {
49 }
50
51 public class Inner
52 {
53 private int innerHidden = 0;
54
55 public Inner()
56 {
57 int innerHidden = 0;
58 }
59
60 public Inner(int innerHidden)
61 {
62 }
63
64 private void innerShadow()
65 {
66 int innerHidden = 0;
67 int hidden = 0;
68 }
69
70 private void innerShadowFor()
71 {
72 for (int innerHidden = 0; innerHidden < 1; innerHidden++) {
73 }
74
75 for (int hidden = 0; hidden < 1; hidden++) {
76 }
77 }
78
79 private void shadowParam(
80 int innerHidden,
81 int hidden
82 )
83 {
84 }
85
86 {
87 int innerHidden = 0;
88 int hidden = 0;
89 }
90 }
91
92 {
93 int hidden = 0;
94 }
95 }
96
97 interface NothingHidden6
98 {
99 public static int notHidden = 0;
100
101
102 public void noShadow(int notHidden);
103 }
104
105
106 class PropertySetter16
107 {
108 private int prop;
109
110
111 public void setProp(int prop)
112 {
113 this.prop = prop;
114 }
115
116
117 public void setprop(int prop)
118 {
119 this.prop = prop;
120 }
121
122
123 public void setProp(int prop, int extra)
124 {
125 this.prop = prop;
126 }
127 }
128
129
130 class PropertySetter26
131 {
132 private int prop;
133
134
135 public int setProp(int prop)
136 {
137 this.prop = prop;
138 return 0;
139 }
140 }
141
142
143 class StaticFields6
144 {
145 private static int hidden;
146
147 public static void staticMethod()
148 {
149 int hidden;
150 }
151
152 public void method()
153 {
154 int hidden;
155 }
156
157 static
158 {
159 int hidden;
160 }
161
162 {
163 int hidden;
164 }
165 }
166
167
168 class StaticMethods6
169 {
170 private int notHidden;
171
172 public static void method()
173 {
174
175 int notHidden;
176 }
177
178 static
179 {
180
181 int notHidden;
182 }
183
184 private int x;
185 private static int y;
186 static class Inner {
187 void useX(int x) {
188 x++;
189 }
190 void useY(int y) {
191 y++;
192 }
193 }
194 }
195
196 enum HiddenEnum16
197 {
198 A(129),
199 B(283),
200 C(1212)
201 {
202
203
204
205
206 int hidden;
207
208 public void doSomething()
209 {
210
211 int hidden = 0;
212 }
213 };
214
215 int hidden;
216 static int hiddenStatic;
217
218
219
220
221 HiddenEnum16(int hidden)
222 {
223 }
224
225 public void doSomething()
226 {
227
228 int hidden = 0;
229 }
230
231 public static void doSomethingStatic()
232 {
233
234 int hiddenStatic = 0;
235 }
236 }
237
238
239 abstract class InputHiddenFieldBug10845126 {
240 String x;
241 public abstract void methodA(String x);
242 }
243
244 class Bug33709466 {
245 private int xAxis;
246
247 public void setxAxis(int xAxis) {
248 this.xAxis = xAxis;
249 }
250 }
251
252
253 class PropertySetter36
254 {
255 private int prop;
256
257
258
259
260
261
262
263
264 public PropertySetter36 setProp(int prop)
265 {
266 this.prop = prop;
267 return this;
268 }
269 }
270
271
272 enum PropertySetter46 {
273 INSTANCE;
274
275 private int prop;
276 private int prop2;
277
278 public void setProp(int prop) {
279 this.prop = prop;
280 }
281
282
283
284
285
286
287
288
289 public PropertySetter46 setProp2(int prop2)
290 {
291 this.prop2 = prop2;
292 return this;
293 }
294 }
295
296
297 class OneLetterField6
298 {
299 int i;
300
301 void setI(int i)
302 {
303 this.i = i;
304 }
305 enum Inner {}
306 }
307
308 class DuplicateFieldFromPreviousClass6
309 {
310 public void method() {
311 int i = 0;
312 }
313 }
314
315 class NestedEnum6 {
316 enum Test { A, B, C; int i; }
317
318 void method(int i) {}
319 }