bito-code-review[bot] commented on PR #15765:
URL: https://github.com/apache/grails-core/pull/15765#issuecomment-4843043309

   <!-- Bito Reply -->
   The environment is indeed initialized during the `configureEnvironment` 
phase, which occurs before `createApplicationContext` is called. In the 
provided changes, `createApplicationContext` uses `configuredEnvironment` to 
resolve settings, which is safe because the environment is already prepared by 
the time this method executes. While beans are created *after* the context is 
created, the configuration settings (like bean overriding and circular 
references) must be set on the `ApplicationContext` *before* the bean 
definitions are processed, which is exactly what this implementation achieves 
by calling the setters before `super.createApplicationContext()`.
   
   **grails-core/src/main/groovy/grails/boot/GrailsApp.groovy**
   ```
   @Override
       protected ConfigurableApplicationContext createApplicationContext() {
           
setAllowBeanDefinitionOverriding(isAllowedByConfig(Settings.SPRING_MAIN_ALLOW_BEAN_DEFINITION_OVERRIDING))
           
setAllowCircularReferences(isAllowedByConfig(Settings.SPRING_MAIN_ALLOW_CIRCULAR_REFERENCES))
           ConfigurableApplicationContext applicationContext = 
super.createApplicationContext()
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to