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

Fail more explicitly when AOT attempts to handle a bean definition that uses an instance supplier #29556

Closed
snicoll opened this issue Nov 23, 2022 · 3 comments
Assignees
Labels
theme: aot An issue related to Ahead-of-time processing type: bug A general bug
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Nov 23, 2022

As revealed by #29555, we should throw a more tailored exception when a bean definition uses an instance supplier. If one is set, the container must honor it and there's no way for us to inspect it to generate the appropriate code.

@sdeleuze
Copy link
Contributor

While working on this, I found that the current behavior is that instance suppliers on bean definition where the bean class has a default constructor are just ignored. Boot is implicitly leveraging this behavior, see spring-projects/spring-boot#33763 for more details.

Boot and other Spring portfolio projects should probably stop using instance supplier as a first step, and then we should throw an error during AOT processing (potentially in BeanDefinitionMethodGenerator constructor).

@sdeleuze
Copy link
Contributor

sdeleuze commented Jan 11, 2023

Draft commit available at https://github.com/sdeleuze/spring-framework/tree/gh-29556.

@jhoeller
Copy link
Contributor

Reopening for the Boot test failures reported by @wilkinsona

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot An issue related to Ahead-of-time processing type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants