matrei commented on code in PR #16772:
URL: https://github.com/apache/grails-core/pull/16772#discussion_r4423442229
##########
grails-core/src/main/groovy/org/grails/config/CompositeConfig.java:
##########
@@ -41,6 +41,11 @@
* A {@link Config} composed of other Configs. A lookup answers from the first
config, in order of precedence,
* that has the key, and the {@link Map} views, {@link #flatten()} and {@link
#toProperties()} resolve a key
* shared by several configs the same way, so each key appears once with its
highest-precedence value.
+ * <p>
+ * One case differs: {@link #flatten()} and {@link #toProperties()} combine
the names each config exports, and a
Review Comment:
Nit: the reason holds for `toProperties()`, but `flatten()` gives each
config's map as it is stored (`NavigableMapConfig.flatten()` returns
`configMap`), which never holds the dotted copy, so `flatten()` already kept
the lower value on 7.0.x. Maybe:
```java
* One case differs: {@link #toProperties()} combines the names each config
exports, and a config leaves out the
* dotted name that only repeats one of its own bracketed names; {@link
#flatten()} combines the maps the configs
* store, which never hold that dotted name. So when a higher config spells
a property in brackets,
* {@code app.routes[k]}, and a lower one dotted, {@code app.routes.k}, the
dotted name keeps the lower value there,
* while {@link #getProperty(String)} answers the higher one.
```
--
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]