spring-boot
spring-boot copied to clipboard
ImportsContextCustomizer supports AliasFor
Fixes https://github.com/spring-projects/spring-boot/issues/34854
Use MergedAnnotations
in order to support @AliasFor
.
I used plain Predicate
instead of AnnotationFilter
because it is much simpler and generic.
Would you like to rework your proposal so that it only makes the changes that are required to fix the problem and nothing more?
Sure, I'll do that.
Would you like to rework your proposal so that it only makes the changes that are required to fix the problem and nothing more?
Sure, I'll do that.
@wilkinsona But note that we still have to remove ImportsContextCustomizer.AnnotationFilter
and use the one from org.springframework.core.annotation.AnnotationFilter
instead since that's what org.springframework.core.annotation.MergedAnnotations.Search#withAnnotationFilter()
wants.
@wilkinsona is the new version OK ?
This still looks quite a large change to me and I am not sure the use of stream
and reduce
is something we want. The MergedAnnotations
API you've used doesn't exist in 2.7.x
and we need to be able to rebase the change there. Can you please limit your change to support aliases and only that? We can refine the code further as a separate step.
@lmartelli do you want to review your contribution based on the suggestion above? If no, no problem and we can close this and reopen the related issue.
@lmartelli do you want to review your contribution based on the suggestion above? If no, no problem and we can close this and reopen the related issue.
Yes, I will do that. I just need to find a little time.
Thanks very much @lmartelli, I've taken the tests from this commit and merged them into 2.7 along with a minimal fix. I've also taken the changes you made to ImportsContextCustomizer
and applied them with a little polish to main
(see #36211).
Thanks again!