Skip to content

Conversation

@c-dilks
Copy link
Member

@c-dilks c-dilks commented Oct 9, 2025

This PR increases the spotbugs rank, where higher rank means less "important" bug. Our current rank is 3, and I was able to get us up to rank 7. Ultimately this PR will serve to tighten our static analysis testing for future code, steering us away from bug-prone patterns.

For ranks 7 and below, I fixed the ones I could, and suppressed the ones that did not seem worth the effort. Some unused methods have been deleted.

At rank 8, the number of bug-prone detections skyrockets. I started trying to fix them, but ended up doing much more suppressing (i.e., telling spotbugs to ignore certain bugs) than actual fixes; eventually I gave up, since many of them did not seem too important. I left my rank 8 suppressions commented out in the spotbugs configuration file, in case anyone wants to continue this effort.

@c-dilks c-dilks changed the title test: increase spotbugs rank fix: several bug-prone behaviors identified by higher spotbugs ranks Oct 16, 2025
@c-dilks c-dilks force-pushed the entomology branch 3 times, most recently from 384bbe9 to 3b458ee Compare October 23, 2025 20:32
@c-dilks c-dilks marked this pull request as ready for review October 30, 2025 16:45
baltzell
baltzell previously approved these changes Nov 13, 2025
@baltzell
Copy link
Collaborator

needs #950

@baltzell baltzell added the java label Nov 25, 2025
baltzell
baltzell previously approved these changes Dec 4, 2025
@c-dilks
Copy link
Member Author

c-dilks commented Dec 4, 2025

@baltzell: merge conflict in build-coatjava.sh resolved, re-review needed.

@baltzell baltzell self-requested a review December 4, 2025 22:45
@baltzell baltzell merged commit ed0fd8e into development Dec 4, 2025
40 checks passed
@c-dilks c-dilks deleted the entomology branch December 4, 2025 23:41
tongtongcao pushed a commit that referenced this pull request Dec 12, 2025
#871)

* test: increase spotbugs rank

let's see how high we can increase the rank without too much pain and
suffering...

* fix: 5

* fix: 6

* fix: thread-safe date formatter

* fix: repeated conditional

* fix: disable bug-prone `ClasUtilsFile.getFileList(String,String,String)`, since unused

* fix: Non-virtual method call in constructor passes null for...

...non-null parameter of another constructor
(`NP_NULL_PARAM_DEREF_NONVIRTUAL`)

* fix: `setMass` `mass` parameter is dead upon entry but overwritten...

spotbugs rank-7 bug `IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN`

* fix: undeclared dependency

* fix: fix or suppress some rank-8 bugs

* fix: synchronized singleton getters

* fix: suppress searlizable singletons

* fix: remove public ctors from `SwapManager` singleton

* fix: suppress static method hiding of `DetectorRepsonse.readHipoEvent`

better than breaking the API...

* fix: go back to rank 7

* fix: remove commented out code

* fix: actuallly back to rank 7
tongtongcao pushed a commit that referenced this pull request Dec 12, 2025
#871)

* test: increase spotbugs rank

let's see how high we can increase the rank without too much pain and
suffering...

* fix: 5

* fix: 6

* fix: thread-safe date formatter

* fix: repeated conditional

* fix: disable bug-prone `ClasUtilsFile.getFileList(String,String,String)`, since unused

* fix: Non-virtual method call in constructor passes null for...

...non-null parameter of another constructor
(`NP_NULL_PARAM_DEREF_NONVIRTUAL`)

* fix: `setMass` `mass` parameter is dead upon entry but overwritten...

spotbugs rank-7 bug `IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN`

* fix: undeclared dependency

* fix: fix or suppress some rank-8 bugs

* fix: synchronized singleton getters

* fix: suppress searlizable singletons

* fix: remove public ctors from `SwapManager` singleton

* fix: suppress static method hiding of `DetectorRepsonse.readHipoEvent`

better than breaking the API...

* fix: go back to rank 7

* fix: remove commented out code

* fix: actuallly back to rank 7
tongtongcao pushed a commit that referenced this pull request Dec 31, 2025
#871)

* test: increase spotbugs rank

let's see how high we can increase the rank without too much pain and
suffering...

* fix: 5

* fix: 6

* fix: thread-safe date formatter

* fix: repeated conditional

* fix: disable bug-prone `ClasUtilsFile.getFileList(String,String,String)`, since unused

* fix: Non-virtual method call in constructor passes null for...

...non-null parameter of another constructor
(`NP_NULL_PARAM_DEREF_NONVIRTUAL`)

* fix: `setMass` `mass` parameter is dead upon entry but overwritten...

spotbugs rank-7 bug `IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN`

* fix: undeclared dependency

* fix: fix or suppress some rank-8 bugs

* fix: synchronized singleton getters

* fix: suppress searlizable singletons

* fix: remove public ctors from `SwapManager` singleton

* fix: suppress static method hiding of `DetectorRepsonse.readHipoEvent`

better than breaking the API...

* fix: go back to rank 7

* fix: remove commented out code

* fix: actuallly back to rank 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClasUtilsFile.getFileList(String,String,String) passes null for non-null parameter of getFileList(String)

3 participants