@@ -47,23 +47,21 @@ class GrailsMicronautGrailsPlugin extends Plugin {
4747 }
4848
4949 if (! applicationContext. containsBean(' micronautApplicationContext' )) {
50- throw new IllegalStateException (" A Micronaut Application Context should exist prior to the loading of the Grails Micronaut plugin." )
50+ throw new IllegalStateException (' A Micronaut Application Context should exist prior to the loading of the Grails Micronaut plugin.' )
5151 }
5252
5353 ConfigurableApplicationContext micronautContext = applicationContext. getBean(' micronautApplicationContext' , ConfigurableApplicationContext )
54- Environment micronautEnv = micronautContext. getEnvironment()
54+ Environment micronautEnv = micronautContext. environment
5555
56- log. debug(" Loading configurations from the plugins to the parent Micronaut context" )
57- final GrailsPlugin [] plugins = pluginManager. allPlugins
58- final GrailsPlugin [] pluginsFromContext = pluginManagerFromContext ? pluginManagerFromContext. allPlugins : new GrailsPlugin []{}
59- Integer priority = AbstractPropertySourceLoader . DEFAULT_POSITION
56+ log. debug(' Loading configurations from the plugins to the parent Micronaut context' )
57+ GrailsPlugin [] plugins = pluginManager. allPlugins
58+ GrailsPlugin [] pluginsFromContext = pluginManagerFromContext ? pluginManagerFromContext. allPlugins : new GrailsPlugin []{}
59+ int priority = AbstractPropertySourceLoader . DEFAULT_POSITION
6060 [plugins, pluginsFromContext]. each { GrailsPlugin [] pluginsToProcess ->
6161 Arrays . stream(pluginsToProcess)
6262 .filter({ GrailsPlugin plugin -> plugin. propertySource != null })
6363 .forEach({ GrailsPlugin plugin ->
64- if (log. isDebugEnabled()) {
65- log. debug(" Loading configurations from {} plugin to the parent Micronaut context" , plugin. name)
66- }
64+ log. debug(' Loading configurations from {} plugin to the parent Micronaut context' , plugin. name)
6765 // If invoking the source as `.source`, the NavigableMapPropertySource will return null, while invoking the getter, it will return the correct value
6866 micronautEnv. addPropertySource(PropertySource . of(" grails.plugins.$plugin . name " , (Map ) plugin. propertySource. getSource(), -- priority))
6967 })
0 commit comments