1
2
3
4
5
6
7
8
9 package com.puppycrawl.tools.checkstyle.checks.design.designforextension;
10
11 public class InputDesignForExtensionOverridableMethods {
12
13 public class A {
14 public int foo1(int a, int b) {return a + b;}
15
16 public void foo2() { }
17
18 public void foo3(int a, int b) { }
19
20 private int foo4(int a, int b) {return a + b;}
21
22 public void foo5() {
23
24 }
25
26 public void foo6() {
27
28
29
30 }
31
32 public void foo7() {
33
34
35
36 }
37
38 public int foo8(int a, int b) {
39
40 return a + b;
41 }
42
43 public int foo9(int a, int b) {
44
45
46
47 return a + b;
48 }
49
50 public int foo10(int a, int b) {
51
52
53
54 return a + b;
55 }
56
57 public int foo11(int a, int b) {
58 return a + b;
59
60 }
61
62 public int foo12(int a, int b) {
63 return a + b;
64
65
66
67 }
68
69 public int foo13(int a, int b) {
70 return a + b;
71
72
73
74 }
75
76 protected int foo14(int a) {return a -1;}
77
78 public final int foo15(int a) {return a - 2;}
79
80 protected final int foo16(int a) {return a - 2;}
81
82
83 protected int foo17(int a) {return a -1;}
84
85
86 public void foo18() { }
87
88
89 public int foo19() {return 1;}
90
91
92 public final int foo20(int a) {return a - 2;}
93
94
95 protected final int foo21(int a) {return a - 2;}
96
97
98 public void foo22() {
99 return;
100 }
101
102
103
104 public void foo23() {
105 return;
106 }
107
108
109
110 public void foo24() {}
111
112
113 public void foo25() {
114 return;
115 }
116
117
118 @Deprecated
119 public void foo26() {
120 return;
121 }
122
123
124
125 @Deprecated
126 public void foo27() {
127 return;
128 }
129
130
131 @Deprecated
132 public void foo28() {
133 return;
134 }
135
136
137 @Deprecated
138 public void foo29() {
139 return;
140 }
141
142
143
144
145
146
147
148 public int max(int a, int b) {
149 return Math.max(a, b);
150 }
151
152
153 public int foo30() {
154
155 return 1;
156 }
157
158
159 public int foo31() {
160
161 return 1;
162 }
163
164
165 public int foo32() {
166
167 return 1;
168 }
169
170 @Deprecated
171
172 public int foo33() {
173 return 1;
174 }
175
176 @Deprecated
177
178 public int foo34() {
179 return 1;
180 }
181
182 @Deprecated
183
184 public void foo35() { }
185
186 @Deprecated
187
188 public void foo36() { }
189
190 @Deprecated
191
192 public void foo37() { }
193
194 @Deprecated
195
196 public void foo38() { }
197
198 @Deprecated
199 public void foo39() {return; }
200
201 void foo40() {
202
203 }
204
205 void foo41() {
206 return;
207 }
208
209
210 void foo42() {
211 }
212
213
214 void foo43() {
215 return;
216 }
217
218
219
220 void foo44() {
221 return;
222 }
223
224
225
226 void foo45() {
227 return;
228 }
229
230
231
232
233
234
235 public boolean isGreaterThan(int indent) {
236 return indent == 2;
237 }
238
239
240
241
242
243
244 public void setProcessJavadoc(boolean value) {
245 value = true;
246 }
247 }
248
249 public final class B {
250 public int foo1(int a, int b) {return a + b;}
251
252 protected int foo2(int a, int b) {return a + b;}
253
254 public final int foo3(int a, int b) {return a + b;}
255
256 protected final int foo4(int a, int b) {return a + b;}
257 }
258
259 public abstract class C {
260 public abstract void foo1(int a);
261 }
262 }