@@ -29,6 +29,8 @@ import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
//import org.springframework.boot.context.properties.bind.convert.BinderConversionService;
|
||||
|
||||
/**
|
||||
* A {@link Map} implementation that initializes its entries by binding values from the
|
||||
* supplied environment. Any call to 'get()' will result in either returning the existing
|
||||
@@ -84,7 +86,7 @@ public class EnvironmentEntryInitializingTreeMap<T> extends AbstractMap<String,
|
||||
public T get(Object key) {
|
||||
if (!this.delegate.containsKey(key) && key instanceof String) {
|
||||
T entry = BeanUtils.instantiateClass(entryClass);
|
||||
Binder binder = new Binder(ConfigurationPropertySources.get(environment),new PropertySourcesPlaceholdersResolver(environment),this.conversionService);
|
||||
Binder binder = new Binder(ConfigurationPropertySources.get(environment),new PropertySourcesPlaceholdersResolver(environment), this.conversionService, null);
|
||||
binder.bind(defaultsPrefix, Bindable.ofInstance(entry));
|
||||
this.delegate.put((String) key, entry);
|
||||
}
|
||||
@@ -94,7 +96,7 @@ public class EnvironmentEntryInitializingTreeMap<T> extends AbstractMap<String,
|
||||
@Override
|
||||
public T put(String key, T value) {
|
||||
// boot 2 call this first
|
||||
Binder binder = new Binder(ConfigurationPropertySources.get(environment),new PropertySourcesPlaceholdersResolver(environment),this.conversionService);
|
||||
Binder binder = new Binder(ConfigurationPropertySources.get(environment),new PropertySourcesPlaceholdersResolver(environment),this.conversionService, null);
|
||||
binder.bind(defaultsPrefix, Bindable.ofInstance(value));
|
||||
return this.delegate.put(key, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user