Skip to content

Conversation

MarkEWaite
Copy link
Contributor

Increase spotbugs checks

Increases spotbugs checks by reducing the threshold to "Low". Also resolves a few spotbugs warnings by code corrections.

  • Remove uncalled static method
  • Remove redundant null checks in AbstractGitSCMSource
  • Fix spotbugs warning on repo cache size updates
  • Increase spotbugs checks

Inspired by a NonNull annotation in #1468 that should have reported a spotbugs warning and did not.

Checklist

  • I have read the CONTRIBUTING doc
  • I have referenced the Jira issue related to my changes in one or more commit messages
  • I have added tests that verify my changes
  • Unit tests pass locally with my changes
  • I have added documentation as necessary
  • No Javadoc warnings were introduced with my changes
  • No spotbugs warnings were introduced with my changes
  • Documentation in README has been updated as necessary
  • Online help has been added and reviewed for any new or modified fields
  • I have interactively tested my changes
  • Any dependent changes have been merged and published in upstream modules (like git-client-plugin)

Types of changes

  • Dependency or infrastructure update

Spotbugs correctly reported a race condition where the check for
insertion of a value might report the value is missing then another
thread inserted the value before the current thread performed the
`put`.  Simpler to `put` the value every time the method is called and
then check for the rare case when the value that was put is smaller
than the value that was there perviously.

Repository size cache is used as a hint.  Errors in the size cache may
lead to suboptimal choices temporarily, but they should not lead to
incorrect behavior.
Add spotbugs exclusions reported as part of the increased checks.
@MarkEWaite MarkEWaite added the chore Reduces maintenance effort by changes not directly visible to users label Jul 1, 2023
@github-actions github-actions bot added the dependencies Dependency related change label Jul 1, 2023
@MarkEWaite MarkEWaite removed the dependencies Dependency related change label Jul 1, 2023
@MarkEWaite MarkEWaite enabled auto-merge (rebase) July 1, 2023 20:01
@MarkEWaite MarkEWaite merged commit bfeca7f into jenkinsci:master Jul 1, 2023
@MarkEWaite MarkEWaite deleted the increase-spotbugs-checks branch July 1, 2023 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Reduces maintenance effort by changes not directly visible to users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant