Upgrade to Java 17
[cps.git] / spotbugs / src / main / resources / spotbugs-exclude.xml
index c46270c..ab37f41 100644 (file)
@@ -1,4 +1,27 @@
+<!--
+  ============LICENSE_START=======================================================
+  Copyright (c) 2021 Pantheon.tech.
+  Modifications Copyright (C) 2021 Bell Canada.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+-->
+
 <FindBugsFilter>
+  <Match>
+    <!-- Ignore generated code -->
+    <Source name="~.*generated-sources.*.java"/>
+  </Match>
   <Match>
     <Or>
       <!-- Anonymous inner classes are very common. -->
       <Bug pattern="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE" />
       <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
 
+      <!-- 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
+      on used fields -->
+      <Bug pattern="URF_UNREAD_FIELD"/>
+
       <!-- https://github.com/spotbugs/spotbugs/issues/511. Strict reading of Object.equals() contract means that
            evenever equals() behaviour is defined, all implementations need to adhere to it. The only reason
            to override the method (assuming correct API design, of course) is to provide a more efficient
@@ -22,6 +49,9 @@
 
       <!-- https://github.com/spotbugs/spotbugs/issues/756. spotbugs does not grok Java 11's try-with-resources -->
       <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
+      <Bug pattern="EI_EXPOSE_REP"/>
+      <Bug pattern="EI_EXPOSE_REP2"/>
     </Or>
   </Match>
+
 </FindBugsFilter>