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