jamesfredley commented on code in PR #16736:
URL: https://github.com/apache/grails-core/pull/16736#discussion_r4417856742


##########
grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/ConfigurationBuilder.groovy:
##########
@@ -425,6 +431,387 @@ abstract class ConfigurationBuilder<B, C> {
 
     }
 
+    private Map resolveMapProperty(String propertyPath, Map fallBackValue) {
+        Map directValue
+        RuntimeException conversionFailure = null
+        try {
+            directValue = propertyResolver.getProperty(propertyPath, Map)
+        } catch (ConversionFailedException | ConverterNotFoundException e) {
+            conversionFailure = e
+            directValue = null
+        }
+        if (!(propertyResolver instanceof ConfigurableEnvironment) && 
directValue != null && !directValue.isEmpty()) {

Review Comment:
   Fixed in 0b35b1cc55. A `DatastoreEnvironment` still walks its prepared 
configuration sources, so a key that exists only on a lower map is kept. The 
walk skips the `systemProperties` and `systemEnvironment` sources that 
`StandardEnvironment` adds, so `-Dgrails.gorm.hibernate.minimumIdle=3` is not a 
setting.
   
   Returning the highest `getProperty(..., Map)` alone drops those lower keys. 
`createPropertyResolvers` stores each map as its own source, and the later map 
only wins keys it actually sets. `Test DatastoreUtils resolver keeps keys from 
a lower configuration map` covers `shared=high`, `override=new`, 
`base=retained`, and `minimumIdle=null`. The existing single-map feature still 
asserts the system property is absent.
   
   The generic walk stays for a raw `ConfigurableEnvironment`. Callers that 
pass a raw environment still need it, so this does not replace that walk with 
the registrar one-liner. `dataSources.dataSource` remains a follow-up.
   



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