-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improve default annotation values #9838
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
Conversation
SonarCloud Quality Gate failed.
|
* @return The annotation default values | ||
*/ | ||
@NonNull | ||
Map<CharSequence, Object> provide(String annotationName); |
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.
Why CharSequence instead of String?
CS doesn't have a well-defined eq/hc
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.
Not really sure, we have it everywere
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.
CharSequence
is parent of both Java's String
and Groovy's GString
.
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.
that means we need it for the processor i guess, but maybe we can move to String on the runtime side
@graemerocher Pls also check |
Added Core annotations default values to prevent repeating them in bean definitions.
Fixed a bug with missing defaults for nested annotations.
Changed for
AnnotationValues
to have default values fetched lazily, preventing additional calls to the concurrent map during the class init.We might want to remove additional calls to fill
Map<String, Class<? extends Annotation>> ANNOTATION_TYPES
and make that resolution at the runtime. In don't thinkAnnotationMetadata
Optional<Class<? extends Annotation>> getAnnotationType(@NonNull String name)
is very much used.