Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Suppress spotbugs PA_PUBLIC_PRIMITIVE_ATTRIBUTE warnings
Browse files Browse the repository at this point in the history
https://www.jenkins.io/doc/developer/tutorial-improve/add-more-spotbugs-checks/
describes the technique used here with an exclusions file.  The specific
exclusion for PA_PUBLIC_PRIMITIVE_ATTRIBUTE has been confirmed by Jenkins
developers that it is not helpful in a Jenkins plugin.

jenkinsci/jenkins#8803 describes the changes
that were made in Jenkins core and in many Jenkins plugins to suppress
the PA_PUBLIC_PRIMITIVE_ATTRIBUTE spotbugs warning.
  • Loading branch information
MarkEWaite committed Oct 9, 2024
1 parent 1a9c05f commit bffa2ba
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions src/spotbugs/excludesFilter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<!--
Exclusions in this section have been triaged and determined to be
false positives.
-->
<Match>
<!-- These primitive attributes need to be public to preserve the API -->
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE" />
<Class name="hudson.plugins.jacoco.JacocoPublisher" />
<Or>
<Field name="DESCRIPTOR" />
<Field name="deltaHealthReport" />
<Field name="healthReports" />
</Or>
</Match>
<Match>
<!-- These primitive attributes need to be public to preserve the API -->
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE" />
<Class name="hudson.plugins.jacoco.model.CoverageObject" />
<Or>
<Field name="maxBranch" />
<Field name="maxClazz" />
<Field name="maxComplexity" />
<Field name="maxInstruction" />
<Field name="maxLine" />
<Field name="maxMethod" />
</Or>
</Match>
<Match>
<!-- This primitive attribute needs to be public to preserve the API -->
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE" />
<Class name="hudson.plugins.jacoco.report.CoverageReport" />
<Field name="healthReports" />
</Match>

<!--
Here lies technical debt. Exclusions in this section have not yet
been triaged. When working on this section, pick an exclusion to
triage, then:
- Add a @SuppressFBWarnings(value = "[...]", justification = "[...]")
annotation if it is a false positive. Indicate the reason why
it is a false positive, then remove the exclusion from this
section.
- If it is not a false positive, fix the bug, then remove the
exclusion from this section.
-->
</FindBugsFilter>

0 comments on commit bffa2ba

Please sign in to comment.