1
2
3
4
5
6
7
8
9
10
11
12
13 package com.puppycrawl.tools.checkstyle.checks.coding.hiddenfield;
14
15
16
17
18
19
20
21
22
23
24 class InputHiddenFieldReorder
25 {
26
27
28 public InputHiddenFieldReorder()
29 {
30 int hidden = 0;
31 }
32
33 public InputHiddenFieldReorder(int hidden)
34 {
35 }
36
37 public void shadow()
38 {
39 int hidden = 0;
40 }
41
42 public void shadowFor()
43 {
44 for (int hidden = 0; hidden < 1; hidden++) {
45 }
46 }
47
48 public void shadowParam(int hidden)
49 {
50 }
51
52 public class Inner
53 {
54
55
56 public Inner()
57 {
58 int innerHidden = 0;
59 }
60
61 public Inner(int innerHidden)
62 {
63 }
64
65 private void innerShadow()
66 {
67 int innerHidden = 0;
68 int hidden = 0;
69 }
70
71 private void innerShadowFor()
72 {
73 for (int innerHidden = 0; innerHidden < 1; innerHidden++) {
74 }
75
76 for (int hidden = 0; hidden < 1; hidden++) {
77 }
78 }
79
80 private void shadowParam(
81 int innerHidden,
82 int hidden
83 )
84 {
85 }
86
87 {
88 int innerHidden = 0;
89 int hidden = 0;
90 }
91 private int innerHidden = 0;
92 }
93
94 {
95 int hidden = 0;
96 }
97 private int hidden = 0;
98 }
99
100 interface NothingHiddenReorder
101 {
102 public static int notHidden = 0;
103
104
105 public void noShadow(int notHidden);
106 }
107
108 enum HiddenEnum1
109 {
110 A(129),
111 B(283),
112 C(1212)
113 {
114 public void doSomething()
115 {
116
117 int hidden = 0;
118 }
119
120
121
122
123
124 int hidden;
125 };
126
127
128
129
130 HiddenEnum1(int hidden)
131 {
132 }
133
134 public void doSomething()
135 {
136
137 int hidden = 0;
138 }
139
140 public static void doSomethingStatic()
141 {
142
143 int hiddenStatic = 0;
144 }
145
146 int hidden;
147 static int hiddenStatic;
148 }