Skip to content

Conversation

gtoison
Copy link
Contributor

@gtoison gtoison commented Jul 13, 2025

For records the header is compiled into fields, accessor methods and a canonical constructor.
A SuppressWarnings annotation in the header is applied to the corresponding field, accessor method and parameter of the canonical constructor.
In the end we want to report unnecessary suppressions, however when only one of the three suppressor is matched we do not want to report the two others as unnecessary.
We link the suppressors together so we can detect whether at least one of the was matched in SuppressionMatcher.match

This should fix #3471

@gtoison gtoison merged commit 5411825 into spotbugs:master Jul 15, 2025
15 checks passed
@hazendaz hazendaz added this to the Spotbugs 4.9.4 milestone Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SuppressFBWarnings for EI_EXPOSE_REP/REP2 on record fields flagged as useless starting in 4.9.2
4 participants