blob: d8731ac818e4e754d5ea843dedbf00d8013c3184 [file] [log] [blame]
Bruno Sakotof549c7c2021-05-18 16:02:30 -04001<!--
2 ============LICENSE_START=======================================================
3 Copyright (c) 2021 Pantheon.tech.
4 Modifications Copyright (C) 2021 Bell Canada.
5 ================================================================================
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 ============LICENSE_END=========================================================
18-->
19
Claudio David Gasparini9f93f792020-12-18 14:37:27 +010020<FindBugsFilter>
21 <Match>
Bruno Sakotof549c7c2021-05-18 16:02:30 -040022 <!-- Ignore generated code -->
23 <Source name="~.*generated-sources.*.java"/>
ToineSiebelinkc37678a2021-05-20 16:44:21 +010024 </Match>
25 <Match>
Claudio David Gasparini9f93f792020-12-18 14:37:27 +010026 <Or>
27 <!-- Anonymous inner classes are very common. -->
28 <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON" />
29
30 <!-- We use static slf4j Logger (this rule is from KengoTODA/findbugs-slf4j jp.skypencil.findbugs.slf4:bug-pattern) -->
31 <Bug pattern="SLF4J_LOGGER_SHOULD_BE_NON_STATIC" />
32
33 <!-- Guava 25.1+ uses the Checker Framework's @Nullable which SpotBugs doesn't handle correctly, even though it's
34 supposed to; see https://github.com/spotbugs/spotbugs/issues/743 -->
35 <Bug pattern="NP_NONNULL_PARAM_VIOLATION" />
36 <Bug pattern="NP_NULL_PARAM_DEREF" />
37 <Bug pattern="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE" />
38 <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
39
DylanB95EST4f4178c2021-07-02 13:30:42 +010040 <!-- https://stackoverflow.com/a/34674776. Doesn't detect Lombok All Args Constructor variables being used with map get key and value, which can lead to spotbugs being detected
41 on used fields -->
42 <Bug pattern="URF_UNREAD_FIELD"/>
43
Claudio David Gasparini9f93f792020-12-18 14:37:27 +010044 <!-- https://github.com/spotbugs/spotbugs/issues/511. Strict reading of Object.equals() contract means that
45 evenever equals() behaviour is defined, all implementations need to adhere to it. The only reason
46 to override the method (assuming correct API design, of course) is to provide a more efficient
47 implementation. This rule would be forcing a @SuppressFBWarnings on perfectly compliant classes. -->
48 <Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS"/>
49
50 <!-- https://github.com/spotbugs/spotbugs/issues/756. spotbugs does not grok Java 11's try-with-resources -->
51 <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
52 </Or>
53 </Match>
Bruno Sakotof549c7c2021-05-18 16:02:30 -040054
Claudio David Gasparini9f93f792020-12-18 14:37:27 +010055</FindBugsFilter>