-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Nested annotations no longer supported in ASM-based annotation processing #24375
Comments
Thanks for raising the issue! I have confirmed that the supplied test case executes without errors on |
I came to a similar conclusion about what might need to be done to provide a fix. I also looked at your code and tried it out against But let's wait on feedback from @philwebb before taking the next step. Cheers |
I think the change looks right. I probably need to see the actual commit to be sure. The only thing that concerns me is how similar two |
…amework into read_yuyang * 'master' of https://github.com/spring-projects/spring-framework: Update copyright date Hoist concatenation of two constant Strings out of loops Avoid setting special Content-* response headers for Tomcat Consistent use of AnnotationUtils.rethrowAnnotationConfigurationException() Fix Checkstyle violation Introduce @disabled regression test for spring-projectsgh-24375 Polishing contribution Expose proxyPing Reactor Netty WebSocket Updates to Validation section in reference HttpWebHandlerAdapter#formatRequest is protected Fix issue with new line handling in StompDecoder Simplify getCache() implementation in CaffeineCacheManager Publish a build scan only if authenticated Update Artifactory plugin to 4.12.0
Indeed, I implemented the fix slightly differently by adding logic to the existing
See this commit for details: sbrannen@b55a564 @philwebb, as soon as you give a 👍 for that, I'll merge it into Cheers |
Spring Framework 5.0 introduced a regression in ASM-based annotation processing. Specifically, nested annotations were no longer supported, and component scanning resulted in an exception if a candidate component was annotated with an annotation that contained nested annotations. This commit fixes this regression by introducing a standard "value extractor" in TypeMappedAnnotation that supports extracting values from objects of type Annotation, Map, or TypeMappedAnnotation. Closes spring-projectsgh-24375
This has been fixed in 974caca and revised in 5d4f1d9. @AndreasKl, feel free to try it out in the next 5.2.4 snapshot build and let us know if it works for you. |
tl;dr
Build https://github.com/AndreasKl/spring-issue-in-TypeMappedAnnotation the test fails with the following exception:
This is caused by the
@AliasFor("value")
and@AliasFor("hallo")
onpublic @interface Bad
.We do not see this behaviour with Spring Boot 2.1.11 (Spring Core 5.1.12.RELEASE) but can reproduce the issue on (Spring Core 5.2.2.RELEASE and 5.2.4.BUILD-SNAPSHOT).
Failing test case:
The root cause could be in:
and could be mitigated by adding:
As this is core framework code I'm not really feeling confident to provide a PR without breaking something else.
The text was updated successfully, but these errors were encountered: