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


##########
grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/ConfigurationBuilder.groovy:
##########
@@ -425,6 +432,396 @@ abstract class ConfigurationBuilder<B, C> {
 
     }
 
+    private Map resolveMapProperty(String propertyPath, Map fallBackValue) {

Review Comment:
   Done in 569ed33f47.
   
   A raw Environment walks flattened names only, highest source first. The 
first source to define a key wins. `name[n]` still builds a list, and each 
stored name still goes through `readEnvironmentValue`. A map at the exact path 
is used only when no flattened name exists, and that rule is commented on the 
return.
   
   `DatastoreEnvironment` takes the early return and does not walk. The 
JVM-source skip is gone because that resolver never reaches the walk. Lower 
configuration maps are not merged. That restores the base-branch result, and 
the test that pinned the new lower-key merge is removed.
   
   Removed: `withoutSourceAliases`, `exactPathPresent`, 
`indexedLiteralClaimed`, `nonMapLiteralPresent`, `convertSourceMap`, 
`firstRawValueIsMap`, `withoutResolvedDescendants`, `leafAlreadySet`, and 
`mergeMissing`. The features that only pinned those helpers are gone. A literal 
dotted key inside a winning map stays literal. It is not treated as an alias of 
a nested path.



##########
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:
   Agreed. `DatastoreEnvironment` now takes the early return and returns the 
highest `getProperty(..., Map)` unchanged. It does not walk, so it does not 
pick up `-DdataSource.properties.minimumIdle` and it does not keep keys from a 
lower configuration map. The test that pinned that new merge is removed. The 
JVM-source skip is gone with the walk.



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