jamesfredley opened a new issue, #16715:
URL: https://github.com/apache/grails-core/issues/16715

   ## Summary
   
   #16552 hides every non-empty YAML or Groovy list from 
`Environment.getProperty`. Grails' own i18n post-processor still reads 
`spring.messages.basename` that way, so a list of configured message bundles is 
dropped when an i18n descriptor is present.
   
   ## What goes wrong
   
   `I18nEnvironmentPostProcessor.declaredBasenames()` calls 
`environment.getProperty("spring.messages.basename")`. After this merge that 
returns null for a non-empty list. `compose()` then builds the basename list 
from discovered bundles only and installs it as the highest-priority property 
source.
   
   The method's own comment says a value the application set is never dropped, 
because Spring would otherwise replace the whole list. That is exactly what 
happens now:
   
   ```yaml
   spring:
     messages:
       basename:
         - config/i18n/custom
         - messages
   ```
   
   With an i18n descriptor present, the configured `config/i18n/custom` bundle 
is no longer first, and its overrides disappear. `I18nRuntimeHintsProcessor` 
was moved to `Binder`. This reader was not.
   
   This is separate from the documented `Environment` contract change. The 
upgrade note says Grails' own list settings are bound and accept either form. 
This consumer was left on `getProperty`.
   
   ## Introduced by
   
   - https://github.com/apache/grails-core/pull/16552
   - Merge commit `b8e54bbe50a960eeb59aab3ae2c468f483d82cd1` on `8.0.x`
   - `NavigableMapPropertySource.groovy` lines 57-59 and 87-89
   - `I18nEnvironmentPostProcessor.java` line 150
   
   ## Fix
   
   Read `spring.messages.basename` with `Binder`, the same way 
`I18nRuntimeHintsProcessor` does, so a YAML list and a comma-separated string 
both survive. Add a regression with a list-valued basename and a discovered 
bundle, and assert the configured names stay first.
   


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