forked from undertow-io/undertow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
findbugs-exclude.xml
261 lines (222 loc) · 8.88 KB
/
findbugs-exclude.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<!-- This file specifies a findbugs filter for excluding reports that
should not be considered errors.
The format of this file is documented at:
http://findbugs.sourceforge.net/manual/filter.html
When possible, please specify the full names of the bug codes,
using the pattern attribute, to make it clearer what reports are
being suppressed. You can find a listing of codes at:
http://findbugs.sourceforge.net/bugDescriptions.html
-->
<FindBugsFilter>
<!-- Ignore checking for generated parser classes -->
<Match>
<Or>
<Class name="io.undertow.client.http.HttpResponseParser$$generated"/>
<Class name="io.undertow.server.protocol.http.HttpRequestParser$$generated"/>
</Or>
</Match>
<!-- Ignore findbugs reports from incomplete detectors -->
<Match>
<Bug pattern="TESTING"/>
</Match>
<!-- We don't mind having redundant checks for null, it is more error prone to later changes -->
<Match>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>
<!-- Ignore negating result of compareTo -->
<Match>
<Bug pattern="RV_NEGATING_RESULT_OF_COMPARETO"/>
</Match>
<!-- Ignore class naming convention issues -->
<Match>
<Bug pattern="NM_CLASS_NAMING_CONVENTION"/>
</Match>
<!-- Ignore unread public and protected fields as someone may depend on Undertow and use them in their app -->
<Match>
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
</Match>
<!-- False positives => ignoring, the field is read in tests -->
<Match>
<Bug pattern="URF_UNREAD_FIELD"/>
<Or>
<And>
<Class name="io.undertow.server.protocol.ajp.AjpRequestParseState"/>
<Field name="dataSize"/>
</And>
</Or>
</Match>
<!-- field is always incremented/decremented inside synchronized blocks using the same lock -->
<Match>
<Bug pattern="VO_VOLATILE_INCREMENT"/>
<Or>
<And>
<Class name="io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel"/>
<Field name="waiterCount"/>
</And>
<And>
<Class name="io.undertow.server.handlers.proxy.mod_cluster.NodeLbStatus"/>
<Field name="elected"/>
</And>
<And>
<Class name="io.undertow.websockets.jsr.SessionContainer"/>
<Field name="waiterCount"/>
</And>
</Or>
</Match>
<!--Stream id in HTTP/2 is always unsigned int per spec -->
<Match>
<Bug pattern="IM_BAD_CHECK_FOR_ODD"/>
<Class name="io.undertow.protocols.http2.Http2Channel"/>
<Method name="isClient"/>
</Match>
<!-- Even per javadoc of Object.wait(), this should be always used in loop. It is on purpose -->
<Match>
<Bug pattern="WA_NOT_IN_LOOP"/>
<Or>
<And>
<Class name="io.undertow.protocols.ssl.SslConduit"/>
<Method name="~await.*"/>
</And>
<And>
<Class name="io.undertow.server.protocol.framed.AbstractFramedStreamSourceChannel"/>
<Method name="awaitReadable"/>
</And>
<And>
<Class name="io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel"/>
<Method name="awaitWritable"/>
</And>
</Or>
</Match>
<!-- Ignore returning references to internal representations of objects -->
<Match>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<!-- Ignoring when internal representation stores reference to external representation -->
<Match>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<!-- Intentional switch case follow through -->
<Match>
<Bug pattern="SF_SWITCH_FALLTHROUGH"/>
<Or>
<And>
<Class name="io.undertow.protocols.ajp.AjpResponseParser"/>
<Method name="parse" params="java.nio.ByteBuffer" returns="void"/>
</And>
<And>
<Class name="io.undertow.server.protocol.ajp.AjpRequestParser"/>
<Method name="parse"/>
</And>
<And>
<Class name="io.undertow.util.Cookies"/>
<Method name="parseCookie"/>
</And>
<And>
<Class name="io.undertow.util.PathTemplate"/>
<Method name="create"/>
</And>
</Or>
</Match>
<!-- Path has always some elements in our cases => ignoring -->
<Match>
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
<Class name="io.undertow.server.handlers.resource.PathResource"/>
</Match>
<!-- The PathTemplate equivalent always exist, checked already by the contains method -->
<Match>
<Bug pattern="NP_NULL_ON_SOME_PATH"/>
<Class name="io.undertow.util.PathTemplateMatcher"/>
</Match>
<!-- Ignoring switch cases with no default, all cases which can occur are covered -->
<!-- TODO: Discuss with developer, whether not to add there some exception being thrown in such cases -->
<Match>
<Bug pattern="SF_SWITCH_NO_DEFAULT"/>
</Match>
<!-- Intentional throwing RuntimeException instead of checked exception -->
<Match>
<Bug pattern="REC_CATCH_EXCEPTION"/>
<Or>
<!-- Intentional throwing RuntimeException instead of checked exception -->
<And>
<Class name="io.undertow.Undertow"/>
<Method name="start"/>
</And>
<!-- Intentional throwing RuntimeException instead of checked exception -->
<And>
<Class name="io.undertow.server.handlers.proxy.mod_cluster.MCMPHandler"/>
<Method name="processConfig"/>
</And>
<!-- Intentional not throwing exception -->
<And>
<Class name="io.undertow.util.FlexBase64$Encoder"/>
<Method name="encodeString"/>
</And>
</Or>
</Match>
<!-- The SQL is created based on configuration of the Handler => when proper configuration is created,
then the risk of SQL injection is evaded -->
<Match>
<Bug pattern="SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING"/>
<Class name="io.undertow.server.handlers.JDBCLogHandler"/>
<Method name="prepareStatement"/>
</Match>
<!--Some inner subclasses of the AjpClientChannel class require to be non static, we want all of the same type inner -->
<!--classes to be the same -->
<Match>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC"/>
<Class name="~io\.undertow\.protocols\.ajp\.AjpClientChannel\$.*"/>
</Match>
<!-- Is done actually only once, no harm in it -->
<Match>
<Bug pattern="DMI_RANDOM_USED_ONLY_ONCE"/>
<Class name="io.undertow.util.HttpString"/>
</Match>
<Match>
<Bug pattern="EQ_COMPARETO_USE_OBJECT_EQUALS"/>
<Or>
<Class name="io.undertow.server.handlers.encoding.EncodingMapping"/>
<Class name="~.*AlpnOpenListener\$ListenerEntry"/>
</Or>
</Match>
<!-- MCMPAdvertiseTask is used only as single background thread for doing advertising -->
<Match>
<Bug pattern="STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE"/>
<Class name="io.undertow.server.handlers.proxy.mod_cluster.MCMPAdvertiseTask"/>
</Match>
<!--We don't care whether it is Runtime or checked exception-->
<Match>
<Bug pattern="REC_CATCH_EXCEPTION"/>
<Class name="io.undertow.servlet.handlers.security.SSLInformationAssociationHandler"/>
<Method name="getCerts"/>
</Match>
<!--Ignoring checking for examples-->
<Match>
<Package name="~io\.undertow\.examples.*"/>
</Match>
<!-- The proper class type returned is handled by createInstance() method being overridden for each subclass => ignoring -->
<Match>
<Bug pattern="CN_IDIOM_NO_SUPER_CALL"/>
<Or>
<Class name="io.undertow.servlet.api.SecurityInfo"/>
<Class name="io.undertow.servlet.api.AuthMethodConfig"/>
<Class name="io.undertow.servlet.api.DeploymentInfo"/>
<Class name="io.undertow.servlet.api.LoginConfig"/>
<Class name="io.undertow.servlet.api.FilterInfo"/>
<Class name="io.undertow.servlet.api.ServletInfo"/>
</Or>
</Match>
<!-- intentional -->
<Match>
<Bug pattern="DM_DEFAULT_ENCODING"/>
<Or>
<Class name="io.undertow.servlet.spec.ServletPrintWriterDelegate"/>
</Or>
</Match>
<Match>
<Bug pattern="UG_SYNC_SET_UNSYNC_GET"/>
<Class name="io.undertow.servlet.spec.AsyncContextImpl"/>
</Match>
<Match>
<Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"/>
</Match>
</FindBugsFilter>