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


##########
grails-doc/src/en/guide/conf/applicationClass/applicationLifeCycle.adoc:
##########
@@ -34,3 +34,5 @@ class Application extends GrailsAutoConfiguration {
     ...
 }
 ----
+
+The `Application` class can also define its beans at compile time instead, by 
annotating it with `@GrailsBeans` — see 
link:spring.html#springdslAdditional[Configuring Additional Beans].

Review Comment:
   Correct, it isn't — and this line contradicted the plugin and Spring 
chapters, which both already documented the annotation as implicit here. 
Reworded, and added a test for the Application path, which had none.



##########
grails-domain-class/src/main/groovy/org/grails/plugins/domain/DomainClassGrailsPlugin.groovy:
##########
@@ -45,15 +55,26 @@ class DomainClassGrailsPlugin extends Plugin {
     def dependsOn = [i18n: version]
     def loadAfter = ['controllers', 'dataSource']
 
-    @Override
-    BeanRegistrar beanRegistrar() {
-        return { BeanRegistry registry, Environment environment ->
-            // Set default for auto-timestamp annotation caching based on 
environment if not explicitly configured
-            Config config = grailsApplication.config
-            if 
(!config.containsProperty(DatastoreSettings.SETTING_AUTO_TIMESTAMP_CACHE_ANNOTATIONS))
 {
-                // Not configured - disable caching in development mode to 
support class reloading
-                
config.put(DatastoreSettings.SETTING_AUTO_TIMESTAMP_CACHE_ANNOTATIONS,
-                        !grails.util.Environment.isDevelopmentMode())
+    // The deleted class held grailsApplication and messageSources as fields 
populated by an
+    // @Autowired constructor. The generated sibling always has a no-arg 
constructor, so both are
+    // taken as bean method parameters instead - resolved identically by 
Spring, and only when the
+    // bean that needs them is created rather than when the configuration 
class is instantiated.

Review Comment:
   Removed — it described the constructor of the class this PR deletes.



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