1 package com.google.checkstyle.test.chapter4formatting.rule487modifiers;
2
3 abstract strictfp class InputFormattedModifierOrder {
4 private transient String dontSaveMe;
5
6 public volatile int whatImReading;
7
8 public volatile boolean ssModifierOrderVar = false;
9
10
11
12
13
14 private strictfp void doStuff() {}
15
16
17 @MyAnnotationFormatted
18 void someMethod() {}
19
20
21 private @MyAnnotationFormatted void someMethod2() {}
22
23
24
25
26 private @MyAnnotationFormatted strictfp void someMethod3() {}
27
28
29
30
31 @MyAnnotationFormatted
32 private strictfp void someMethod4() {}
33
34
35 @MyAnnotationFormatted
36 public static @MyAnnotationFormatted2 strictfp void someMethod5() {}
37
38
39
40 @MyAnnotationFormatted
41 public static final synchronized strictfp void fooMethod() {}
42
43 protected final strictfp @MyAnnotationFormatted static synchronized void fooMethod1() {}
44
45
46
47 synchronized @MyAnnotationFormatted private static final strictfp void fooMethod2() {}
48
49
50
51 @MyAnnotationFormatted
52 protected static final synchronized strictfp void fooMethod3() {}
53
54 @MyAnnotationFormatted
55 private static final synchronized strictfp void fooMethod4() {}
56
57 final synchronized strictfp @MyAnnotationFormatted public static void fooMethod5() {}
58
59
60
61 @MyAnnotationFormatted
62 private static final synchronized strictfp void fooMethod6() {}
63
64 protected static final synchronized strictfp @MyAnnotationFormatted void fooMethod7() {}
65
66
67
68 @MyAnnotationFormatted
69 protected abstract void fooMet();
70
71 abstract @MyAnnotationFormatted public void fooMet1();
72
73
74
75
76 public static interface InputRedundantPublicModifier {
77 public void abc1();
78
79 void abc2();
80
81 abstract void abc3();
82
83 public float PI_PUBLIC = (float) 3.14;
84
85 final float PI_FINAL = (float) 3.14;
86
87
88 float PI_OK = (float) 3.14;
89 }
90
91 private final void method() {}
92 }
93
94
95 final class RedundantFinalClass2 {
96 public final void finalMethod() {}
97
98 public void method() {}
99
100 protected @MyAnnotationFormatted static synchronized native void fooMethod();
101
102
103
104 protected static @MyAnnotationFormatted synchronized native void fooMethod1();
105
106
107
108 @MyAnnotationFormatted
109 protected synchronized native void fooMethod2();
110
111 protected static synchronized native @MyAnnotationFormatted void fooMethod3();
112
113
114
115 native @MyAnnotationFormatted protected static synchronized void fooMethod4();
116
117
118
119 public static @MyAnnotationFormatted synchronized native void fooMethod5();
120
121
122
123 static synchronized native @MyAnnotationFormatted public void fooMethod6();
124
125
126
127 private static synchronized native @MyAnnotationFormatted void fooMethod7();
128
129 }
130
131
132
133 interface InnerImplementation2 {
134 InnerImplementation2 inner =
135 new InnerImplementation2() {
136
137 public void method() {}
138 };
139
140 void method();
141 }
142
143
144 class WithInner2 {
145
146
147
148
149
150 class Inner {
151 private transient String dontSaveMe;
152
153 public volatile int whatImReading;
154
155 @MyAnnotationFormatted
156 protected synchronized native void fooMethod();
157
158 protected @MyAnnotationFormatted synchronized native void fooMethod1();
159
160
161
162 protected synchronized @MyAnnotationFormatted native void fooMethod2();
163
164
165
166 protected synchronized native @MyAnnotationFormatted void fooMethod3();
167
168
169
170 native @MyAnnotationFormatted protected synchronized void fooMethod4();
171
172
173
174 public @MyAnnotationFormatted synchronized native void fooMethod5();
175
176
177
178 synchronized native @MyAnnotationFormatted public void fooMethod6();
179
180
181
182 private synchronized native @MyAnnotationFormatted void fooMethod7();
183
184
185
186
187 InnerImplementation2 foo =
188 new InnerImplementation2() {
189
190 public void method() {
191
192
193 }
194
195 private transient String dontSaveMe;
196
197 public volatile int whatImReading;
198
199 protected @MyAnnotationFormatted synchronized native void fooMethod();
200
201
202
203 protected @MyAnnotationFormatted synchronized native void fooMethod1();
204
205
206
207 protected synchronized @MyAnnotationFormatted native void fooMethod2();
208
209
210
211 protected synchronized native @MyAnnotationFormatted void fooMethod3();
212
213
214
215 @MyAnnotationFormatted
216 protected synchronized native void fooMethod4();
217
218 public @MyAnnotationFormatted synchronized native void fooMethod5();
219
220
221
222 synchronized native @MyAnnotationFormatted public void fooMethod6();
223
224
225
226 private synchronized native @MyAnnotationFormatted void fooMethod7();
227
228 };
229 }
230
231
232
233
234
235
236 abstract class AbsInner {
237 private transient String dontSaveMe;
238
239 public volatile int whatImReading;
240
241 @MyAnnotationFormatted
242 public final synchronized strictfp void fooMethod() {}
243
244 protected final strictfp @MyAnnotationFormatted synchronized void fooMethod1() {}
245
246
247
248 synchronized @MyAnnotationFormatted private final strictfp void fooMethod2() {}
249
250
251
252 @MyAnnotationFormatted
253 protected final synchronized strictfp void fooMethod3() {}
254
255 @MyAnnotationFormatted
256 private final synchronized strictfp void fooMethod4() {}
257
258 final synchronized strictfp @MyAnnotationFormatted public void fooMethod5() {}
259
260
261
262 @MyAnnotationFormatted
263 private final synchronized strictfp void fooMethod6() {}
264
265 protected final synchronized strictfp @MyAnnotationFormatted void fooMethod7() {}
266
267
268
269 @MyAnnotationFormatted
270 protected abstract void fooMet();
271
272 abstract @MyAnnotationFormatted public void fooMet1();
273
274 }
275 }
276
277
278
279 @interface Annotation2 {
280 public String s1 = "";
281 final String s2 = "";
282 static String s3 = "";
283 String s4 = "";
284
285 public String blah();
286
287 abstract String blah2();
288 }
289
290
291 @interface MyAnnotationFormatted {}
292
293
294 @interface MyAnnotationFormatted2 {}
295
296
297
298 interface InputModifierOrderInterface2 {
299 default strictfp void abc1() {}
300
301 default strictfp void abc2() {}
302 }