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

Consider initializer annotations when looking for UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR #2872

Merged
merged 4 commits into from
Feb 24, 2024

Conversation

gtoison
Copy link
Contributor

@gtoison gtoison commented Feb 22, 2024

See #453 and #2870

@gtoison gtoison marked this pull request as ready for review February 22, 2024 13:53
CHANGELOG.md Outdated Show resolved Hide resolved
@gtoison
Copy link
Contributor Author

gtoison commented Feb 22, 2024

Thanks for reviewing @JuditKnoll, I have made the changes

for (AnnotationEntry a : getMethod().getAnnotationEntries()) {
String typeName = a.getAnnotationType();

if ("Ljakarta/annotation/PostConstruct;".equals(typeName)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could put these in an ordered array and use Arrays.binarySearch, or an ArrayList and use contains.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have moved the annotations in a list. Considering the small size I used contains() for simplicity

@hazendaz hazendaz self-assigned this Feb 24, 2024
@hazendaz hazendaz merged commit 5ec24da into spotbugs:master Feb 24, 2024
15 checks passed
@hazendaz hazendaz added this to the SpotBugs 4.8.4 milestone Feb 25, 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
4 participants