Browse Source

Adjust to updates in boot.

pull/837/head
Olga Maciaszek-Sharma 4 years ago committed by Spencer Gibb
parent
commit
034768bc8f
  1. 12
      spring-cloud-context/src/main/java/org/springframework/cloud/context/refresh/ConfigDataContextRefresher.java

12
spring-cloud-context/src/main/java/org/springframework/cloud/context/refresh/ConfigDataContextRefresher.java

@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
package org.springframework.cloud.context.refresh;
import org.springframework.boot.DefaultBootstrapContext;
import org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor;
import org.springframework.boot.env.DefaultBootstrapRegisty;
import org.springframework.cloud.context.scope.refresh.RefreshScope;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.MutablePropertySources;
@ -31,8 +31,7 @@ import org.springframework.core.io.DefaultResourceLoader; @@ -31,8 +31,7 @@ import org.springframework.core.io.DefaultResourceLoader;
*/
public class ConfigDataContextRefresher extends ContextRefresher {
public ConfigDataContextRefresher(ConfigurableApplicationContext context,
RefreshScope scope) {
public ConfigDataContextRefresher(ConfigurableApplicationContext context, RefreshScope scope) {
super(context, scope);
}
@ -44,14 +43,13 @@ public class ConfigDataContextRefresher extends ContextRefresher { @@ -44,14 +43,13 @@ public class ConfigDataContextRefresher extends ContextRefresher {
StandardEnvironment environment = copyEnvironment(getContext().getEnvironment());
String[] activeProfiles = getContext().getEnvironment().getActiveProfiles();
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
ConfigDataEnvironmentPostProcessor.applyTo(environment, resourceLoader,
new DefaultBootstrapRegisty(), activeProfiles);
ConfigDataEnvironmentPostProcessor.applyTo(environment, resourceLoader, new DefaultBootstrapContext(),
activeProfiles);
if (environment.getPropertySources().contains(REFRESH_ARGS_PROPERTY_SOURCE)) {
environment.getPropertySources().remove(REFRESH_ARGS_PROPERTY_SOURCE);
}
MutablePropertySources target = getContext().getEnvironment()
.getPropertySources();
MutablePropertySources target = getContext().getEnvironment().getPropertySources();
String targetName = null;
for (PropertySource<?> source : environment.getPropertySources()) {
String name = source.getName();

Loading…
Cancel
Save