Skip to content

Commit

Permalink
Ignore specific spotbugs errors not the number
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbASF committed Dec 17, 2023
1 parent faba736 commit bb9c610
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 5 deletions.
2 changes: 0 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,6 @@
<threshold>Normal</threshold>
<effort>Default</effort>
<excludeFilterFile>src/conf/spotbugs-exclude-filter.xml</excludeFilterFile>
<!-- Hacky: Don't allow new SpotBugs errors -->
<maxAllowedViolations>9</maxAllowedViolations>
</configuration>
</plugin>
<plugin>
Expand Down
69 changes: 66 additions & 3 deletions src/conf/spotbugs-exclude-filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,29 @@

<!-- Binary compatibility -->
<Match>
<Bug pattern="EI_EXPOSE_STATIC_REP2"/>
<Method name="clone"/>
<Class name="org\.apache\.bcel\.Repository"/>
<Class name="org.apache.bcel.Repository"/>
<Method name="setRepository"/>
<Bug pattern="EI_EXPOSE_STATIC_REP2"/>
</Match>

<Match>
<Class name="org.apache.bcel.Repository"/>
<Method name="getRepository"/>
<Bug pattern="MS_EXPOSE_REP"/>
</Match>


<!--
TODO: this should probably be sinplified
Medium: Complicated, subtle or wrong increment in for-loop
org.apache.bcel.util.BCELifier.printFlags(int, BCELifier$FLAGS)
[org.apache.bcel.util.BCELifier] At BCELifier.java:[line 118]
QF_QUESTIONABLE_FOR_LOOP
-->
<Match>
<Class name="org.apache.bcel.util.BCELifier"/>
<Method name="printFlags" params="int, org.apache.bcel.util.BCELifier$FLAGS" returns="java.lang.String"/>
<Bug pattern="QF_QUESTIONABLE_FOR_LOOP"/>
</Match>

<!-- Reason: TODO, perhaps? -->
Expand All @@ -91,4 +110,48 @@
</Or>
</Match>

<!--
This is intentional
Error: Switch statement found in org.apache.bcel.util.BCELFactory.visitAllocationInstruction(AllocationInstruction)
where one case falls through to the next case
[org.apache.bcel.util.BCELFactory, org.apache.bcel.util.BCELFactory]
At BCELFactory.java:[lines 188-191]
Another occurrence at BCELFactory.java:[lines 192-196] SF_SWITCH_FALLTHROUGH
-->
<Match>
<Class name="org.apache.bcel.util.BCELFactory"/>
<Method name="visitAllocationInstruction"/>
<Bug pattern="SF_SWITCH_FALLTHROUGH"/>
</Match>

<!--
Class is deprecated
Error: The class name org.apache.bcel.util.ClassLoader
shadows the simple name of the superclass java.lang.ClassLoader
[org.apache.bcel.util.ClassLoader] At ClassLoader.java:[lines 59-178]
NM_SAME_SIMPLE_NAME_AS_SUPERCLASS
Error: org.apache.bcel.util.ClassLoader.DEFAULT_IGNORED_PACKAGES should be package protected
[org.apache.bcel.util.ClassLoader] At ClassLoader.java:[line 59]
MS_PKGPROTECT
-->
<Match>
<Class name="org.apache.bcel.util.ClassLoader"/>
<Or>
<Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS"/>
<Bug pattern="MS_PKGPROTECT"/>
</Or>
</Match>

<!--
TODO: field is deprecated in preparation for making it private later
Error: org.apache.bcel.verifier.structurals.Frame._this should be package protected
[org.apache.bcel.verifier.structurals.Frame] In Frame.java
MS_PKGPROTECT
-->
<Match>
<Class name="org.apache.bcel.verifier.structurals.Frame"/>
<Field name="_this"/>
<Bug pattern="MS_PKGPROTECT"/>
</Match>

</FindBugsFilter>

0 comments on commit bb9c610

Please sign in to comment.