1
2
3
4
5
6 package com.puppycrawl.tools.checkstyle.checks.modifier.redundantmodifier;
7
8
9
10
11
12
13
14 strictfp final class InputRedundantModifierIt
15 {
16
17
18 static private boolean sModifierOrderVar = false;
19
20
21
22
23
24 strictfp private void doStuff()
25 {
26 }
27
28
29 @MyAnnotation2 void someMethod()
30 {
31 }
32
33
34 private @MyAnnotation2 void someMethod2()
35 {
36 }
37
38
39 private @MyAnnotation2 strictfp void someMethod3()
40 {
41 }
42
43
44 @MyAnnotation2 private strictfp void someMethod4()
45 {
46 }
47
48
49 @MyAnnotation2 private static @MyAnnotation4 strictfp void someMethod5()
50 {
51 }
52
53
54 public static interface InputRedundantPublicModifier
55 {
56
57 public void a();
58
59
60 void b();
61
62
63 abstract void c();
64
65
66 public float PI_PUBLIC = (float) 3.14;
67
68
69
70
71
72 final float PI_FINAL = (float) 3.14;
73
74
75 float PI_OK = (float) 3.14;
76 }
77
78
79 private final void method()
80 {
81 }
82 }
83
84
85 final class RedundantFinalClass
86 {
87
88 public final void finalMethod()
89 {
90 }
91
92
93 public void method()
94 {
95 }
96 }
97
98
99 abstract interface InnerImplementation
100 {
101 InnerImplementation inner =
102 new InnerImplementation()
103 {
104
105 public void method()
106 {
107 }
108 };
109
110 void method();
111 }
112
113
114 @interface Annotation
115 {
116 public String s1 = "";
117 final String s2 = "";
118 static String s3 = "";
119 String s4 = "";
120 public String blah();
121 abstract String blah2();
122 }
123
124 @interface MyAnnotation2 {
125 }
126
127 @interface MyAnnotation4 {
128 }
129
130 class SafeVarargsUsage {
131 @Deprecated
132 @SafeVarargs
133 private final void foo(int... k) {}
134
135 @Deprecated
136 @SafeVarargs
137 @SuppressWarnings("")
138 private final void foo1(Object... obj) {}
139 }
140
141 enum TestEnum {
142 ;
143
144 public void method() {
145 }
146 }
147
148
149 interface InputDefaultPublicModifier
150 {
151
152 default strictfp void a()
153 {
154 }
155
156
157 strictfp default void b()
158 {
159 }
160 }