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.
ApplicationContextAotGenerator.generateApplicationContextdoes not actually generate anApplicationContext. Rather it processes anApplicationContextfor AOT and generates anApplicationContextInitializer. Thus, the current name of the method is confusing and a bit misleading.As suggested by @philwebb:
The latter would allow the method to return additional information over time if necessary.