From 034768bc8fe2bf17d0853ceb9a7502acd5344c6c Mon Sep 17 00:00:00 2001 From: Olga Maciaszek-Sharma Date: Thu, 17 Sep 2020 13:25:18 +0200 Subject: [PATCH] Adjust to updates in boot. --- .../context/refresh/ConfigDataContextRefresher.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/context/refresh/ConfigDataContextRefresher.java b/spring-cloud-context/src/main/java/org/springframework/cloud/context/refresh/ConfigDataContextRefresher.java index f9fc9d27..f95d9f28 100644 --- a/spring-cloud-context/src/main/java/org/springframework/cloud/context/refresh/ConfigDataContextRefresher.java +++ b/spring-cloud-context/src/main/java/org/springframework/cloud/context/refresh/ConfigDataContextRefresher.java @@ -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; */ 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 { 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();