-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Use AnnotatedElementUtils instead of AnnotationUtils wherever feasible [SPR-13440] #18020
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
Comments
Sam Brannen commented Note that piecemeal work in this direction has already been performed in conjunction with #18047, #18054, and #18021. |
Juergen Hoeller commented After a full pass through the codebase for use of Juergen |
Sam Brannen commented Thanks for doing the grunt work here, Juergen. Much appreciated! Now I just have to see if I can merge with your changes. ;) |
Gareth Chapman commented Hi there. I notice the calls in |
Sam Brannen commented Hi Gareth Chapman, This is the Spring Framework issue tracker. Thus, this issue was only related to code in Core Spring. So, yes, please open an issue against the "Spring Integration" project to address your concerns regarding the Thanks! |
Gareth Chapman commented Hi Sam, many thanks for your quick response. I'll go ahead and open that issue. |
Sam Brannen opened SPR-13440 and commented
Status Quo
Spring Framework 4.2 introduced support for explicit annotation attribute overrides via
@AliasFor
; however, due to historical reasons, the Spring code base typically uses the lookup methods inAnnotationUtils
which do not support attribute overrides.For example, although Spring MVC supports
@RequestMapping
as a merged annotation, the same is not true for@ResponseStatus
.@ResponseStatus
is in fact supported as a meta-annotation, just not as a merged annotation. This means that theresponseStatus
attribute override in the following custom composed@Post
annotation is currently unsupported even though it is declared syntactically correct. Furthermore, use of theresponseStatus
will fail silently: it will simply be ignored (see #18021).Deliverables
AnnotationUtils
to methods such asfindAllMergedAnnotations()
,findMergedAnnotation()
, orgetMergedAnnotation
inAnnotatedElementUtils
wherever feasible.Affects: 4.2 GA
Issue Links:
@Qualifier
to be used in composed annotations with attribute overrides@ResponseStatus
as a merged composed annotation@CrossOrigin
as a merged composed annotation@Cache
* as merged composed annotations@AliasFor
for@JmsListener
attributesReferenced from: commits 63115ed, c5b318a, 5025c61
0 votes, 5 watchers
The text was updated successfully, but these errors were encountered: