Disable SE_PREVENT_EXT_OBJ_OVERWRITE
[odlparent.git] / spotbugs / src / main / resources / spotbugs-exclude.xml
1 <FindBugsFilter>
2   <Match>
3     <Or>
4       <Package name="~org\.opendaylight\.yang\.gen\..*" />
5       <Package name="~.*protobuff\.messages.*" />
6     </Or>
7   </Match>
8
9   <Match>
10     <Or>
11       <!-- Anonymous inner classes are very common in ODL. -->
12       <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON" />
13
14       <!-- We use static slf4j Logger (this rule is from KengoTODA/findbugs-slf4j jp.skypencil.findbugs.slf4:bug-pattern) -->
15       <Bug pattern="SLF4J_LOGGER_SHOULD_BE_NON_STATIC" />
16
17       <!-- Guava 25.1+ uses the Checker Framework's @Nullable which SpotBugs doesn't handle correctly, even though it's
18            supposed to; see https://github.com/spotbugs/spotbugs/issues/743 -->
19       <Bug pattern="NP_NONNULL_PARAM_VIOLATION" />
20       <Bug pattern="NP_NULL_PARAM_DEREF" />
21       <Bug pattern="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE" />
22       <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
23
24       <!--
25            Triggers a lot of false-positives:
26            https://github.com/spotbugs/spotbugs/issues?q=is%3Aissue+is%3Aopen+NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE
27            It is getting worse with Guava annotations and failure to account for TYPE_USE @NonNull annotations, as
28            noted in https://github.com/spotbugs/spotbugs/issues/470 -->
29       <Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
30
31       <!-- https://github.com/spotbugs/spotbugs/issues/511. Strict reading of Object.equals() contract means that
32            evenever equals() behaviour is defined, all implementations need to adhere to it. The only reason
33            to override the method (assuming correct API design, of course) is to provide a more efficient
34            implementation. This rule would be forcing a @SuppressFBWarnings on perfectly compliant classes. -->
35       <Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS"/>
36
37       <!-- https://github.com/spotbugs/spotbugs/issues/756. spotbugs does not grok Java 11's try-with-resources -->
38       <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
39
40       <!-- https://github.com/spotbugs/spotbugs/issues/1601. The new heuristics for determining mutability are
41            borderline insane. As an example: it flags org.osgi.framework.BundleContext as a mutable object (presumably
42            because of addListener()) and you just cannot store a reference in the field without a corresponding
43            @SuppressFBWarnings. -->
44       <Bug pattern="EI_EXPOSE_REP"/>
45       <Bug pattern="EI_EXPOSE_REP2"/>
46       <Bug pattern="MS_EXPOSE_REP"/>
47
48       <!--
49            https://github.com/spotbugs/spotbugs/issues/2750. The heuristic in this check does not work quite a few
50            cases, such as null guards (which we would use in serialization proxies) and plain if() without an else,
51            such as if(foo != null) { throw new ISE() }.
52       -->
53       <Bug pattern="SE_PREVENT_EXT_OBJ_OVERWRITE"/>
54     </Or>
55   </Match>
56 </FindBugsFilter>