codeconsole commented on code in PR #15666:
URL: https://github.com/apache/grails-core/pull/15666#discussion_r3611352349


##########
grails-web-mvc/src/main/groovy/org/grails/web/errors/GrailsExceptionResolver.java:
##########
@@ -131,6 +132,7 @@ public void setServletContext(ServletContext 
servletContext) {
     public void setGrailsApplication(GrailsApplication grailsApplication) {
         this.grailsApplication = grailsApplication;
         createStackFilterer();
+        GrailsUtil.initializeStackFilterer(grailsApplication);

Review Comment:
   Moved init into GrailsBootstrapRegistryInitializer, following the 
PluginDiscovery pattern: it resolves the configured filterer from the 
Environment in a close listener firing after prepareContext() but before 
refresh(), installs it into GrailsUtil there (covering every app type, not only 
web apps with an exception resolver bean), and promotes the same instance as a 
singleton bean under StackTraceFilterer.BEAN_NAME. createStackFilterer in the 
resolver now looks up that bean first, falling back to its prior config-based 
construction only when the bean is absent -- no more duplicate instantiation. 
The direct call from setGrailsApplication is removed.



-- 
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