Skip to content

Support repeatable annotations for condition evaluation [SPR-17207] #21740

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

Closed
spring-projects-issues opened this issue Aug 23, 2018 · 2 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

Stéphane Nicoll opened SPR-17207 and commented

Condition evaluation currently doesn't support @Repeatable. The first thing I found is ConditionEvaluator#shouldSkip calls !metadata.isAnnotated(Conditional.class.getName()) which returns true for some reason when it is invoked with a modified version of @Profile that is @Repeatable

I am not entirely sold on the idea as, for instance, adding @Profile would probably be over the top considering the profile expression we've introduced in Spring Framework 5.1. It might be useful for others, though (support for repeatable @ConfigurationProperty is quite popular on the Spring Boot issue tracker).


Affects: 5.0.8

0 votes, 5 watchers

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

As for the existing behavior, a repeatable annotation is technically a container annotation with nested conditions inside... and unless we specifically check for that through the corresponding AnnotatedElementUtis variant, our common meta-annotation check is only going to search the container annotation, not the nested ones.

@spring-projects-issues spring-projects-issues added status: waiting-for-triage An issue we've not yet triaged or decided on type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) and removed type: enhancement A general enhancement labels Jan 11, 2019
@jhoeller jhoeller added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 9, 2024
@jhoeller jhoeller added this to the 6.x Backlog milestone Jan 9, 2024
@jhoeller jhoeller modified the milestones: 6.x Backlog, General Backlog Oct 1, 2024
@snicoll
Copy link
Member

snicoll commented Jan 29, 2025

The related issue has been fixed differently so there's no demand for this anymore. I'd rather not add the extra complexity.

@snicoll snicoll closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2025
@snicoll snicoll added the status: declined A suggestion or change that we don't feel we should currently apply label Jan 29, 2025
@jhoeller jhoeller removed this from the General Backlog milestone Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants