codeconsole commented on code in PR #15700:
URL: https://github.com/apache/grails-core/pull/15700#discussion_r3323182904
##########
grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/groovy/DefaultMappingConfigurationBuilder.groovy:
##########
@@ -47,7 +47,11 @@ class DefaultMappingConfigurationBuilder implements
MappingConfigurationBuilder
Map<String, Property> getProperties() {
if (!target.propertyConfigs.isEmpty()) {
- properties.putAll(target.propertyConfigs)
+ for (Map.Entry entry : target.propertyConfigs.entrySet()) {
+ if (!properties.containsKey(entry.key)) {
+ properties.put(entry.key, entry.value)
+ }
Review Comment:
Good call — added a DEBUG-level log statement when a key collision is
detected. Kept it at debug because in a real Grails-app boot this fires for
every property that appears in both a `static mapping` and `static constraints`
block (which is most domains with any field validation alongside any explicit
mapping), so info-level would be too noisy for a steady-state condition. Anyone
investigating an unexpected precedence outcome can flip the logger for
`org.grails.datastore.mapping.config.groovy.DefaultMappingConfigurationBuilder`
to DEBUG and see exactly which keys collided.
--
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]