Move field ContextRefresher.REFRESH_ARGS_PROPERTY_SOURCE down to LegacyContextRefresher (#1450)

It's specific to LegacyContextRefresher.

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
This commit is contained in:
Yanming Zhou
2025-01-24 05:46:20 +08:00
committed by Ryan Baxter
parent 94f22fdd18
commit ee490fe7c8
3 changed files with 2 additions and 5 deletions

View File

@@ -92,9 +92,6 @@ public class ConfigDataContextRefresher extends ContextRefresher
postProcessor.postProcessEnvironment(environment, application);
}
if (environment.getPropertySources().contains(REFRESH_ARGS_PROPERTY_SOURCE)) {
environment.getPropertySources().remove(REFRESH_ARGS_PROPERTY_SOURCE);
}
MutablePropertySources target = getContext().getEnvironment().getPropertySources();
String targetName = null;
for (PropertySource<?> source : environment.getPropertySources()) {

View File

@@ -51,8 +51,6 @@ public abstract class ContextRefresher {
protected final Log logger = LogFactory.getLog(getClass());
protected static final String REFRESH_ARGS_PROPERTY_SOURCE = "refreshArgs";
protected static final String[] DEFAULT_PROPERTY_SOURCES = new String[] {
// order matters, if cli args aren't first, things get messy
CommandLinePropertySource.COMMAND_LINE_PROPERTY_SOURCE_NAME, "defaultProperties" };

View File

@@ -41,6 +41,8 @@ import static org.springframework.cloud.util.PropertyUtils.BOOTSTRAP_ENABLED_PRO
*/
public class LegacyContextRefresher extends ContextRefresher {
private static final String REFRESH_ARGS_PROPERTY_SOURCE = "refreshArgs";
@Deprecated
public LegacyContextRefresher(ConfigurableApplicationContext context, RefreshScope scope) {
super(context, scope);