Skip to content

Commit f22073c

Browse files
committed
Omit spotbugs CT_CONSTRUCTOR_THROWS visitor
From jenkinsci/plugin-pom#869 (comment) > Discussion in spotbugs/spotbugs#2695 > https://wiki.sei.cmu.edu/confluence/display/java/OBJ11-J.+Be+wary+of+letting+constructors+throw+exceptions > seems to relate to libraries used with SecurityManager which is dead > and certainly does not apply to Jenkins; we do not expect untrusted code > to be running inside the controller JVM, and it does not seem plausible > that finalizer abuse would happen by accident.
1 parent fb09532 commit f22073c

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

pom.xml

+3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
<jgit.version>6.8.0.202311291450-r</jgit.version>
6969
<spotbugs.effort>Max</spotbugs.effort>
7070
<spotbugs-maven-plugin.version>4.8.2.0</spotbugs-maven-plugin.version>
71+
<!-- TODO: Remove when plugin pom includes this omitVisitors -->
72+
<!-- https://github.com/jenkinsci/plugin-pom/pull/869 -->
73+
<spotbugs.omitVisitors>ConstructorThrow,FindReturnRef</spotbugs.omitVisitors>
7174
<spotbugs.threshold>Low</spotbugs.threshold>
7275
<spotless.check.skip>false</spotless.check.skip>
7376
</properties>

src/spotbugs/excludesFilter.xml

-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@
44
Exclusions in this section have been triaged and determined to be
55
false positives.
66
-->
7-
<Match>
8-
<!-- Jenkins plugins generally not vulnerable to Finalizer attacks -->
9-
<Bug pattern="CT_CONSTRUCTOR_THROW" />
10-
<Or>
11-
<Class name="hudson.plugins.git.GitAPI" />
12-
<Class name="org.jenkinsci.plugins.gitclient.JGitAPIImpl$FileRepositoryImpl" />
13-
<Class name="org.jenkinsci.plugins.gitclient.trilead.TrileadSession$ProcessImpl" />
14-
</Or>
15-
</Match>
167
<Match>
178
<!-- These primitive attributes need to be public to preserve the API -->
189
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE" />

0 commit comments

Comments
 (0)