1515 */
1616package org .grails .config ;
1717
18- import grails .config .Config ;
19- import grails .util .*;
18+ import grails .util .GrailsStringUtils ;
2019import org .codehaus .groovy .runtime .DefaultGroovyMethods ;
2120import org .springframework .core .convert .ConversionException ;
2221import org .springframework .core .convert .support .ConfigurableConversionService ;
23- import org .springframework .core .convert .support .DefaultConversionService ;
2422import org .springframework .core .env .*;
25- import org .springframework .util .ClassUtils ;
2623
27- import java .util .*;
24+ import java .util .Collections ;
25+ import java .util .LinkedHashMap ;
26+ import java .util .List ;
27+ import java .util .Map ;
2828
2929/**
3030 * @author Graeme Rocher
@@ -89,11 +89,15 @@ protected void initializeFromPropertySources(PropertySources propertySources) {
8989 private void mergeEnumerablePropertySource (EnumerablePropertySource enumerablePropertySource ) {
9090 Map <String , Object > map = new LinkedHashMap <String , Object >();
9191 for (String propertyName : enumerablePropertySource .getPropertyNames ()) {
92+ Object value = enumerablePropertySource .getProperty (propertyName );
93+ if (value instanceof CharSequence ) {
94+ value = resolvePlaceholders (value .toString ());
95+ }
9296 if (prefix != null ) {
93- map .put (prefix + '.' + propertyName , enumerablePropertySource . getProperty ( propertyName ) );
97+ map .put (prefix + '.' + propertyName , value );
9498 }
9599 else {
96- map .put (propertyName , enumerablePropertySource . getProperty ( propertyName ) );
100+ map .put (propertyName , value );
97101 }
98102 }
99103
@@ -111,7 +115,10 @@ public void setConversionService(ConfigurableConversionService conversionService
111115
112116 @ Override
113117 public String resolvePlaceholders (String text ) {
114- return propertySourcesPropertyResolver .resolvePlaceholders (text );
118+ if (!GrailsStringUtils .isBlank (text )) {
119+ return propertySourcesPropertyResolver .resolvePlaceholders (text );
120+ }
121+ return text ;
115122 }
116123
117124 @ Override
0 commit comments