From 5cfd079c55e754c8febba8015adbbfaf8b301831 Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Fri, 31 May 2024 15:50:36 +0800 Subject: [PATCH] Remove unnecessary null check See gh-40963 --- .../context/properties/source/ConfigurationPropertySources.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySources.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySources.java index dac0b105139..e7e0fddf993 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySources.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySources.java @@ -87,7 +87,7 @@ public final class ConfigurationPropertySources { Assert.isInstanceOf(ConfigurableEnvironment.class, environment); MutablePropertySources sources = ((ConfigurableEnvironment) environment).getPropertySources(); PropertySource attached = getAttached(sources); - if (attached == null || !isUsingSources(attached, sources)) { + if (!isUsingSources(attached, sources)) { attached = new ConfigurationPropertySourcesPropertySource(ATTACHED_PROPERTY_SOURCE_NAME, new SpringConfigurationPropertySources(sources)); }