From 99c8f7056b0afa1e37781f718e5d006736bd69c8 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 --- .../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 d7ae9d81e16a..965b2ed14ab9 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 @@ private static boolean isFullEnumerable(PropertySource source) { } 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;