From 9c481952d8081827ef04511154b27afbc454b0c4 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 14 Jan 2022 17:38:23 -0800 Subject: [PATCH] Remove deprecated convertEnvironment method --- .../springframework/boot/SpringApplication.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java index 1c82413a11..556d8465ac 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java @@ -341,26 +341,13 @@ public class SpringApplication { "Environment prefix cannot be set via properties."); bindToSpringApplication(environment); if (!this.isCustomEnvironment) { - environment = convertEnvironment(environment); + EnvironmentConverter environmentConverter = new EnvironmentConverter(getClassLoader()); + environment = environmentConverter.convertEnvironmentIfNecessary(environment, deduceEnvironmentClass()); } ConfigurationPropertySources.attach(environment); return environment; } - /** - * Convert the given {@link ConfigurableEnvironment environment} to an application - * environment that doesn't attempt to resolve profile properties directly. - * @param environment the environment to convert - * @return the converted environment - * @since 2.5.7 - * @deprecated since 2.5.8 for removal in 2.7.0 - */ - @Deprecated - public StandardEnvironment convertEnvironment(ConfigurableEnvironment environment) { - return new EnvironmentConverter(getClassLoader()).convertEnvironmentIfNecessary(environment, - deduceEnvironmentClass()); - } - private Class deduceEnvironmentClass() { switch (this.webApplicationType) { case SERVLET: