Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not report URF_UNREAD_FIELD for fields with certain annotations #2873

Merged
merged 12 commits into from
Feb 28, 2024

Conversation

gtoison
Copy link
Contributor

@gtoison gtoison commented Feb 23, 2024

Since there was no answer in #1861 I've merged the proposed changes and made my own changes on top:

  • Upgraded the test to JUnit 5
  • Replaced the annotation classe references by class names so there's no runtime dependency
  • Added jakarta annotations

I think the comment to move UnreadFieldsAnnotationChecker into UnreadFields has merits (since the class is only used there) but I haven't made the change to preserve the Git history. Let me know if you think the change should be made.

This should fix #574 and supersede #1861

ramraval and others added 8 commits December 7, 2021 14:33
-Implements test case for @SerializedName
-Adjusts UnreadFields file to skip fields with @SerializedName annotation
-Confirms URF_UNREAD_FIELD bugs in Issue574Test.java
-Refactors code initially placed in "UnreadFields.java" to new util class ("UnreadFieldsAnnotationChecker.java")
-Adds support for checking for XmlAttribute and XmlValue tags
-Separates test classes for different annotation groups
…xtension

-Added support for suppressing warnings related to @RegisterExtension annotation
Copy link
Collaborator

@JuditKnoll JuditKnoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for picking up that dangling PR.

@hazendaz hazendaz self-assigned this Feb 28, 2024
@hazendaz hazendaz merged commit 5695eac into spotbugs:master Feb 28, 2024
15 checks passed
@JuditKnoll JuditKnoll mentioned this pull request Feb 29, 2024
1 task
@hazendaz hazendaz added this to the SpotBugs 4.8.4 milestone Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

URF_UNREAD_FIELD: should be ignored on test class fields annotated with JUnit5's @RegisterExtension
5 participants