From 2bbad949103e4c69d6bb2af073d343910db82ca0 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 17 May 2021 15:34:45 -0700 Subject: [PATCH] Restore hasProgrammaticallySetProfiles code Restore code lost on merge. See gh-26580 --- .../java/org/springframework/boot/context/config/Profiles.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/Profiles.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/Profiles.java index c0795ee879a..e8cf6eba347 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/Profiles.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/Profiles.java @@ -114,6 +114,9 @@ public class Profiles implements Iterable { if (!StringUtils.hasLength(environmentPropertyValue)) { return !type.getDefaultValue().equals(environmentProfiles); } + if (type.getDefaultValue().equals(environmentProfiles)) { + return false; + } return !environmentPropertyProfiles.equals(environmentProfiles); }