From 737a1ed7110a091fbcc09defb4bebe5814faf212 Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Mon, 19 Aug 2024 10:25:07 +0800 Subject: [PATCH] Remove unnecessary null check See gh-41917 --- .../properties/source/SpringConfigurationPropertySource.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/SpringConfigurationPropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java index d7ae9d81e16..965b2ed14ab 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java @@ -180,7 +180,7 @@ class SpringConfigurationPropertySource implements ConfigurationPropertySource { } private static PropertySource getRootSource(PropertySource source) { - while (source.getSource() != null && source.getSource() instanceof PropertySource propertySource) { + while (source.getSource() instanceof PropertySource propertySource) { source = propertySource; } return source;