blob: 23e62cdbc72b529c0720098e598412282360953e [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" />
ToineSiebelinka05ca3d2024-08-27 14:56:44 +010039 <Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" />
Claudio David Gasparini9f93f792020-12-18 14:37:27 +010040
DylanB95EST4f4178c2021-07-02 13:30:42 +010041 <!-- 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
42 on used fields -->
43 <Bug pattern="URF_UNREAD_FIELD"/>
44
Claudio David Gasparini9f93f792020-12-18 14:37:27 +010045 <!-- https://github.com/spotbugs/spotbugs/issues/511. Strict reading of Object.equals() contract means that
46 evenever equals() behaviour is defined, all implementations need to adhere to it. The only reason
47 to override the method (assuming correct API design, of course) is to provide a more efficient
48 implementation. This rule would be forcing a @SuppressFBWarnings on perfectly compliant classes. -->
49 <Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS"/>
50
51 <!-- https://github.com/spotbugs/spotbugs/issues/756. spotbugs does not grok Java 11's try-with-resources -->
52 <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
egernug477bd462023-09-21 17:51:21 +010053 <Bug pattern="UPM_UNCALLED_PRIVATE_METHOD"/>
egernug2b8268f2023-07-03 10:09:09 +010054 <Bug pattern="EI_EXPOSE_REP"/>
55 <Bug pattern="EI_EXPOSE_REP2"/>
Claudio David Gasparini9f93f792020-12-18 14:37:27 +010056 </Or>
57 </Match>
Bruno Sakotof549c7c2021-05-18 16:02:30 -040058
Claudio David Gasparini9f93f792020-12-18 14:37:27 +010059</FindBugsFilter>