-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Annotations on superclasses are detected by StandardAnnotationMetadata [SPR-11595] #16219
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
Phil Webb commented Sam, Take a look at https://github.com/philwebb/spring-framework/tree/SPR-11595 for a test case and potential fix. Unfortunately the fix breaks The failing test in Spring Boot that triggered all this is |
Sam Brannen commented This has been resolved as described in the comments for GitHub commit a2f1169:
|
Sam Brannen commented Phil Webb, please verify the correctness of the changes against the next 4.0.3 snapshot running against Spring Boot. Thanks! Sam |
Phil Webb commented Sam Brannen, The tests all pass now, so it looks good. |
Sam Brannen commented Great! :) Thanks for letting me know so quickly. |
Sam Brannen commented Note: #16221 is now a follow up for this issue. |
Phil Webb opened SPR-11595 and commented
Background
The
StandardAnnotationMetadata
class in Spring Framework 4.0.2 returnsfalse
forisAnnotated
when a class is not directly annotated with an annotation (even if the annotation is present on a superclass). Furthermore,getAnnotationAttributes
andgetAllAnnotationAttributes
returnnull
when querying for the same annotation.Analysis
The fix for #16100 changed this logic and is causing problems with Spring Boot conditions. Specifically,
@Conditional
annotations were never previously considered on super classes (see #15466).Affects: 4.0.3
Issue Links:
@Conditional
on superclass is ignoredReferenced from: commits a2f1169
The text was updated successfully, but these errors were encountered: