From f86cfff77f1490e5bb68093d39e26d33248cccde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=85=B6=E8=8B=97?= Date: Thu, 20 Jun 2019 10:56:41 +0800 Subject: [PATCH] Remove redundant invocation of getActiveProfiles See gh-17271 --- .../main/java/org/springframework/boot/SpringApplication.java | 2 -- 1 file changed, 2 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 e8faa8a45a4..0614230991a 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 @@ -519,8 +519,6 @@ public class SpringApplication { * @see org.springframework.boot.context.config.ConfigFileApplicationListener */ protected void configureProfiles(ConfigurableEnvironment environment, String[] args) { - environment.getActiveProfiles(); // ensure they are initialized - // But these ones should go first (last wins in a property key clash) Set profiles = new LinkedHashSet<>(this.additionalProfiles); profiles.addAll(Arrays.asList(environment.getActiveProfiles())); environment.setActiveProfiles(StringUtils.toStringArray(profiles));