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

Rename generateApplicationContext() in ApplicationContextAotGenerator #28927

Closed
sbrannen opened this issue Aug 4, 2022 · 1 comment
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Aug 4, 2022

ApplicationContextAotGenerator.generateApplicationContext does not actually generate an ApplicationContext. Rather it processes an ApplicationContext for AOT and generates an ApplicationContextInitializer. Thus, the current name of the method is confusing and a bit misleading.

As suggested by @philwebb:

It could be renamed to processAheadOfTime(...) much like the BeanRegistrationAotProcessor.

Another option might be to return something other than a ClassName, perhaps an AotProcessedApplicationContext (or similar) which has a getter for the initializer.

The latter would allow the method to return additional information over time if necessary.

@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Aug 4, 2022
@sbrannen sbrannen added this to the 6.0.0-M6 milestone Aug 4, 2022
@sbrannen sbrannen changed the title Rename ApplicationContextAotGenerator.generateApplicationContext() Rename generateApplicationContext() in ApplicationContextAotGenerator Aug 4, 2022
@snicoll
Copy link
Member

snicoll commented Aug 4, 2022

and generates an ApplicationContextInitializer.

FTR, it doesn't do only that. Participants can write code that optimize other things. I like processAheadOfTime.

@snicoll snicoll self-assigned this Aug 5, 2022
@snicoll snicoll closed this as completed in 2cc4486 Aug 5, 2022
snicoll added a commit to spring-projects/spring-boot that referenced this issue Aug 5, 2022
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Aug 5, 2022
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) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants