GH-1233 adjusted code to recent changes in boot

Resolves #1233
This commit is contained in:
Oleg Zhurakousky
2018-02-20 10:30:28 -05:00
parent 402543a5cc
commit faf88b201f

View File

@@ -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);
}