-
Notifications
You must be signed in to change notification settings - Fork 578
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
Conversation
spotbugs/src/main/java/edu/umd/cs/findbugs/detect/UnreadFields.java
Outdated
Show resolved
Hide resolved
Thanks for reviewing @JuditKnoll, I have made the changes |
for (AnnotationEntry a : getMethod().getAnnotationEntries()) { | ||
String typeName = a.getAnnotationType(); | ||
|
||
if ("Ljakarta/annotation/PostConstruct;".equals(typeName) |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
See #453 and #2870