Skip to content
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

Provide a hook point that a Configuration class was skipped [SPR-17066] #21604

Open
spring-projects-issues opened this issue Jul 19, 2018 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Stéphane Nicoll opened SPR-17066 and commented

Spring Boot has a ConditionEvaluationReport that keeps track of conditions evaluations but can lead to wrong information as an important bit of information is not available.

Consider the following example

@Configuration
@MyRegisterBeanCondition
@Import(Child.class)
public class Config { ... }

As the condition is in the REGISTER_BEAN phase, the configuration class will be parsed and its import directive will be applied, parsing Child in the process.

If the condition doesn't match TrackedConditionEvaluator will figure out that Config was excluded after all. As a result Child will not instantiated either. This process of figuring out that a REGISTER_BEAN condition didn't match and therefore the class shouldn't be imported is internal to the framework and there is no way for Spring Boot to know.

It would be nice to have a way to access this information. Ideally in a push model-like so that the report can update itself when the context realizes that a given class shouldn't be processed after all.


Affects: 4.3.18

@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
@snicoll snicoll self-assigned this Jan 14, 2019
@snicoll snicoll removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 14, 2019
@snicoll snicoll added this to the 5.x Backlog milestone Jan 14, 2019
@snicoll snicoll closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2024
@snicoll snicoll reopened this Jan 3, 2024
@jhoeller jhoeller added the type: enhancement A general enhancement label Jan 11, 2024
@jhoeller jhoeller modified the milestones: 6.x Backlog, 6.2.x Mar 11, 2024
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) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants