|
14 | 14 | ~ limitations under the License. |
15 | 15 | --> |
16 | 16 |
|
| 17 | +<!-- See https://spotbugs.readthedocs.io/en/latest/filter.html#rank |
| 18 | + for the mapping from SpotBugs rank to verbal labels. |
| 19 | +--> |
17 | 20 | <FindBugsFilter> |
18 | | - <!-- specific excludes which should be fixed --> |
19 | 21 | <Match> |
20 | | - <Class name="org.bson.JSONWriterSettings"/> |
21 | | - </Match> |
22 | | - <Match> |
23 | | - <Bug code="EI,EI2"/> |
| 22 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 18 --> |
| 23 | + <Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2"/> |
24 | 24 | </Match> |
25 | 25 |
|
26 | 26 | <Match> |
| 27 | + <!-- MongoDB status: "False Positive", SpotBugs rank: 14 --> |
27 | 28 | <Class name="org.bson.types.ObjectId"/> |
28 | 29 | <Bug pattern="DMI_RANDOM_USED_ONLY_ONCE"/> |
29 | 30 | </Match> |
30 | 31 |
|
| 32 | + <!-- Once we stop supporting Java SE 8, |
| 33 | + we can start relying on `SecureRandom` being thread-safe, |
| 34 | + as per https://docs.oracle.com/javase/9/docs/api/java/security/SecureRandom.html, |
| 35 | + and reuse its instances. --> |
31 | 36 | <Match> |
| 37 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 14 --> |
32 | 38 | <Class name="com.mongodb.internal.connection.AwsAuthenticator$AwsSaslClient"/> |
33 | 39 | <Bug pattern="DMI_RANDOM_USED_ONLY_ONCE"/> |
34 | 40 | </Match> |
35 | | - |
36 | 41 | <Match> |
| 42 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 14 --> |
37 | 43 | <Class name="com.mongodb.internal.connection.ScramShaAuthenticator$DefaultRandomStringGenerator"/> |
38 | 44 | <Bug pattern="DMI_RANDOM_USED_ONLY_ONCE"/> |
39 | 45 | </Match> |
40 | 46 |
|
41 | 47 | <Match> |
| 48 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 18 --> |
42 | 49 | <Class name="org.bson.codecs.BsonValueCodecProvider"/> |
43 | 50 | <Method name="getBsonTypeClassMap"/> |
44 | 51 | <Bug pattern="MS_EXPOSE_REP"/> |
45 | 52 | </Match> |
46 | 53 |
|
47 | | - <!-- these specific issues are deliberate design decisions --> |
48 | | - |
49 | | - <!-- Deliberately ignoring this, as the check for a null SSLParameters is actually necessary. |
50 | | - See https://jira.mongodb.org/browse/JAVA-2876 for details. --> |
51 | 54 | <Match> |
| 55 | + <!-- MongoDB status: "False Positive", SpotBugs rank: 18 --> |
| 56 | + <!-- Deliberately ignoring this, as the check for a null SSLParameters is actually necessary. |
| 57 | + See https://jira.mongodb.org/browse/JAVA-2876 for details. --> |
52 | 58 | <Class name="com.mongodb.client.internal.KeyManagementService"/> |
53 | 59 | <Method name="enableHostNameVerification" params="javax.net.ssl.SSLSocket"/> |
54 | 60 | <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/> |
55 | 61 | </Match> |
56 | 62 |
|
57 | | - <!-- Deliberately ignoring this, as many BSONObject subclasses don't do it --> |
58 | 63 | <Match> |
| 64 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 17 --> |
| 65 | + <!-- Deliberately ignoring this, as many BSONObject subclasses don't do it --> |
59 | 66 | <Package name="com.mongodb"/> |
60 | 67 | <Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS"/> |
61 | 68 | </Match> |
62 | 69 |
|
63 | | - <!-- Deliberately ignoring return value of CountDownLatch.await --> |
64 | 70 | <Match> |
| 71 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 5 --> |
| 72 | + <!-- Deliberately ignoring return value of CountDownLatch.await --> |
65 | 73 | <Class name="com.mongodb.internal.connection.BaseCluster"/> |
66 | 74 | <Bug pattern="RV_RETURN_VALUE_IGNORED"/> |
67 | 75 | </Match> |
68 | 76 |
|
69 | | - <!-- The underlying call to GridFSInputFile closes the file --> |
70 | 77 | <Match> |
| 78 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 20 --> |
| 79 | + <!-- The underlying call to GridFSInputFile closes the file --> |
71 | 80 | <Class name="com.mongodb.gridfs.GridFS"/> |
72 | 81 | <Method name="createFile" params="java.io.File"/> |
73 | 82 | <Bug pattern="OBL_UNSATISFIED_OBLIGATION"/> |
74 | 83 | </Match> |
75 | 84 |
|
76 | | - <Match> |
77 | | - <Class name="com.mongodb.DocumentCodec"/> |
78 | | - <Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS"/> |
79 | | - </Match> |
80 | | - |
81 | | - <Match> |
82 | | - <Class name="org.mongodb.DatabaseTestCase" /> |
83 | | - <Bug pattern="MS_PKGPROTECT"/> |
84 | | - </Match> |
85 | | - |
86 | | - <Match> |
87 | | - <Class name="org.mongodb.FunctionalSpecification"/> |
88 | | - <Bug pattern="MS_PKGPROTECT"/> |
89 | | - </Match> |
90 | | - |
91 | | - <Match> |
92 | | - <Class name="com.mongodb.DatabaseTestCase"/> |
93 | | - <Bug pattern="MS_PKGPROTECT"/> |
94 | | - </Match> |
95 | | - |
96 | | - <Match> |
97 | | - <Class name="org.bson.types.StringRangeSet$NumberStringComparator"/> |
98 | | - <Bug pattern="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE"/> |
99 | | - </Match> |
100 | | - |
101 | 85 | <!-- Special handling of clone method for cloneable BsonValue subclasses. By design, they don't call super.clone() --> |
102 | 86 | <Match> |
| 87 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 14 --> |
103 | 88 | <Class name="org.bson.BsonArray"/> |
104 | 89 | <Method name="clone"/> |
105 | 90 | <Bug pattern="CN_IDIOM_NO_SUPER_CALL"/> |
106 | 91 | </Match> |
107 | | - |
108 | 92 | <Match> |
| 93 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 14 --> |
109 | 94 | <Class name="org.bson.BsonDocument"/> |
110 | 95 | <Method name="clone"/> |
111 | 96 | <Bug pattern="CN_IDIOM_NO_SUPER_CALL"/> |
112 | 97 | </Match> |
113 | | - |
114 | | - <Match> |
115 | | - <Class name="org.bson.BsonDocumentWrapper"/> |
116 | | - <Method name="clone"/> |
117 | | - <Bug pattern="CN_IDIOM_NO_SUPER_CALL"/> |
118 | | - </Match> |
119 | | - |
120 | 98 | <Match> |
| 99 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 16 --> |
121 | 100 | <Class name="org.bson.RawBsonArray"/> |
122 | 101 | <Method name="clone"/> |
123 | 102 | <Bug pattern="CN_IDIOM_NO_SUPER_CALL"/> |
124 | 103 | </Match> |
125 | 104 |
|
126 | 105 | <Match> |
127 | | - <Class name="org.bson.codecs.jsr310.Jsr310CodecProvider"/> |
128 | | - <Bug pattern="DE_MIGHT_IGNORE"/> |
129 | | - </Match> |
130 | | - |
131 | | - <!-- Test exclusions --> |
132 | | - <!-- All bugs in test classes, except for JUnit-specific bugs --> |
133 | | - <Match> |
134 | | - <Class name="~.*\.*Test"/> |
135 | | - <Not> |
136 | | - <Bug code="IJU"/> |
137 | | - </Not> |
138 | | - </Match> |
139 | | - |
140 | | - <!-- Deliberate use of an unused field in the Person POJO class --> |
141 | | - <Match> |
142 | | - <Class name="com.mongodb.acceptancetest.crud.pojo.Person"/> |
143 | | - <Bug pattern="SS_SHOULD_BE_STATIC"/> |
144 | | - </Match> |
145 | | - |
146 | | - <!-- Spock tests seem to fail the serial version ID test when stubbing. Annoying. --> |
147 | | - <Match> |
148 | | - <Source name="~.*\.groovy"/> |
149 | | - <Bug pattern="SE_NO_SERIALVERSIONID,LI_LAZY_INIT_STATIC,EQ_UNUSUAL,IT_NO_SUCH_ELEMENT,RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"/> |
150 | | - </Match> |
151 | | - |
152 | | - <!-- Strange findbugs issues --> |
153 | | - <Match> |
154 | | - <Source name="~.*ClusterSettingsSpecification\.groovy"/> |
155 | | - <Bug pattern="RANGE_ARRAY_INDEX"/> |
156 | | - </Match> |
157 | | - |
158 | | - <Match> |
159 | | - <Class name="~com.mongodb.internal.connection.AbstractByteBufBsonDocument.*"/> |
160 | | - <Bug pattern="NP_BOOLEAN_RETURN_NULL"/> |
161 | | - </Match> |
162 | | - |
163 | | - <Match> |
| 106 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 16 --> |
164 | 107 | <Class name="~com.mongodb.client.ClientSession.*"/> |
165 | 108 | <Bug pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE"/> |
166 | 109 | </Match> |
167 | 110 |
|
168 | 111 | <Match> |
| 112 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 16 --> |
169 | 113 | <Class name="~com.mongodb.reactivestreams.client.ClientSession.*"/> |
170 | 114 | <Bug pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE"/> |
171 | 115 | </Match> |
172 | 116 |
|
173 | 117 | <Match> |
174 | | - <Class name="~com.mongodb.kotlin.client.ClientSession.*"/> |
175 | | - <Bug pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE"/> |
176 | | - </Match> |
177 | | - |
178 | | - <Match> |
| 118 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 16 --> |
179 | 119 | <Class name="~com.mongodb.kotlin.client.coroutine.ClientSession.*"/> |
180 | 120 | <Bug pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE"/> |
181 | 121 | </Match> |
182 | 122 |
|
183 | 123 | <Match> |
184 | | - <Class name="~com.mongodb.internal.async.client.ClientSession.*"/> |
185 | | - <Bug pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE"/> |
186 | | - </Match> |
187 | | - |
188 | | - <Match> |
189 | | - <Class name="~com.mongodb.async.client.internal.AsyncCryptConnection.*"/> |
190 | | - <Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"/> |
191 | | - </Match> |
192 | | - |
193 | | - <!-- Spotbugs assumes that SSLSocket#getSSLParameters never returns null, when that is not the case for all JDKs --> |
194 | | - <Match> |
| 124 | + <!-- MongoDB status: "False Positive", SpotBugs rank: 18 --> |
| 125 | + <!-- Spotbugs assumes that SSLSocket#getSSLParameters never returns null, when that is not the case for all JDKs --> |
195 | 126 | <Class name="com.mongodb.internal.connection.SslHelper"/> |
196 | 127 | <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/> |
197 | 128 | </Match> |
198 | 129 |
|
199 | 130 | <Match> |
| 131 | + <!-- MongoDB status: "False Positive", SpotBugs rank: 17 --> |
200 | 132 | <Class name="com.mongodb.client.internal.CryptConnection"/> |
201 | 133 | <Method name="retain"/> |
202 | 134 | <Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"/> |
203 | 135 | </Match> |
204 | 136 |
|
205 | 137 | <Match> |
206 | | - <Class name="~com.mongodb.reactivestreams.client.internal.crypt.*"/> |
| 138 | + <!-- MongoDB status: "False Positive", SpotBugs rank: 17 --> |
| 139 | + <Class name="com.mongodb.reactivestreams.client.internal.crypt.CryptConnection"/> |
207 | 140 | <Method name="retain"/> |
208 | 141 | <Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"/> |
209 | 142 | </Match> |
210 | 143 |
|
211 | | - <!-- Caused by Java 11 generating a null check on try with resources. |
212 | | - See https://github.com/spotbugs/spotbugs/issues/756 for details. --> |
213 | 144 | <Match> |
| 145 | + <!-- MongoDB status: "False Positive", SpotBugs rank: 11 --> |
| 146 | + <Class name="org.bson.codecs.kotlin.DataClassCodec$Companion"/> |
| 147 | + <Method name="getCodec"/> |
214 | 148 | <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/> |
215 | 149 | </Match> |
216 | 150 |
|
217 | | - <!-- AWS use UNIX-style line endings --> |
218 | 151 | <Match> |
| 152 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 20 --> |
| 153 | + <!-- AWS use UNIX-style line endings --> |
219 | 154 | <Class name="com.mongodb.internal.connection.AuthorizationHeader"/> |
220 | 155 | <Bug pattern="VA_FORMAT_STRING_USES_NEWLINE"/> |
221 | 156 | </Match> |
222 | 157 |
|
223 | | - <!-- The method is a wrapper for `Condition.await`, naturally it does not call it in a loop. --> |
224 | 158 | <Match> |
| 159 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 14 --> |
| 160 | + <!-- The method is a wrapper for `Condition.await`, naturally it does not call it in a loop. --> |
225 | 161 | <Class name="com.mongodb.internal.connection.DefaultConnectionPool$OpenConcurrencyLimiter"/> |
226 | 162 | <Method name="awaitNanos"/> |
227 | 163 | <Bug pattern="WA_AWAIT_NOT_IN_LOOP"/> |
228 | 164 | </Match> |
229 | 165 |
|
230 | 166 | <!-- The checker fails to see that the code prevents concurrent incrementation by using exclusive locking. --> |
231 | 167 | <Match> |
| 168 | + <!-- MongoDB status: "False Positive", SpotBugs rank: 14 --> |
232 | 169 | <Class name="com.mongodb.internal.connection.DefaultConnectionPool$StateAndGeneration"/> |
233 | 170 | <Field name="generation"/> |
234 | 171 | <Bug pattern="VO_VOLATILE_INCREMENT"/> |
235 | 172 | </Match> |
236 | 173 | <Match> |
| 174 | + <!-- MongoDB status: "False Positive", SpotBugs rank: 14 --> |
237 | 175 | <Class name="com.mongodb.internal.connection.ConcurrentPool$StateAndPermits"/> |
238 | 176 | <Field name="permits"/> |
239 | 177 | <Bug pattern="VO_VOLATILE_INCREMENT"/> |
240 | 178 | </Match> |
241 | 179 |
|
242 | | - <!-- Non-short-circuit operators are used intentionally. --> |
243 | 180 | <Match> |
| 181 | + <!-- MongoDB status: "No Fix Needed", SpotBugs rank: 15 --> |
| 182 | + <!-- Non-short-circuit operators are used intentionally. --> |
244 | 183 | <Class name="com.mongodb.internal.connection.ConcurrentPool$StateAndPermits"/> |
245 | 184 | <Method name="acquirePermit"/> |
246 | 185 | <Bug pattern="NS_DANGEROUS_NON_SHORT_CIRCUIT"/> |
247 | 186 | </Match> |
248 | | - <Match> |
249 | | - <Class name="com.mongodb.internal.connection.DefaultConnectionPool$OpenConcurrencyLimiter"/> |
250 | | - <Method name="acquirePermitOrGetAvailableOpenedConnection"/> |
251 | | - <Bug pattern="NS_NON_SHORT_CIRCUIT"/> |
252 | | - </Match> |
253 | 187 |
|
254 | 188 | <!-- Kotlin false positive for validating annotations --> |
255 | 189 | <Match> |
| 190 | + <!-- MongoDB status: "False Positive", SpotBugs rank: 17 --> |
256 | 191 | <Class name="org.bson.codecs.kotlin.DataClassCodec$Companion"/> |
257 | 192 | <Method name="~.*validateAnnotations.*"/> |
258 | 193 | <Bug pattern="UC_USELESS_OBJECT"/> |
259 | 194 | </Match> |
260 | | - |
261 | 195 | <Match> |
| 196 | + <!-- MongoDB status: "False Positive", SpotBugs rank: 17 --> |
262 | 197 | <Class name="org.bson.codecs.kotlinx.KotlinSerializerCodec$Companion"/> |
263 | 198 | <Method name="~.*validateAnnotations.*"/> |
264 | 199 | <Bug pattern="UC_USELESS_OBJECT"/> |
|
268 | 203 | see: https://github.com/Kotlin/kotlinx.coroutines/issues/3099 |
269 | 204 | --> |
270 | 205 | <Match> |
| 206 | + <!-- MongoDB status: "False Positive", SpotBugs rank: 13 --> |
271 | 207 | <Class name="com.mongodb.kotlin.client.coroutine.MongoClient"/> |
272 | 208 | <Method name="startSession"/> |
273 | 209 | <Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/> |
274 | 210 | </Match> |
275 | 211 | <Match> |
| 212 | + <!-- MongoDB status: "False Positive", SpotBugs rank: 16 --> |
276 | 213 | <Class name="~com.mongodb.kotlin.client.coroutine.*"/> |
277 | 214 | <Bug pattern="NP_NONNULL_PARAM_VIOLATION"/> |
278 | 215 | </Match> |
|
0 commit comments