From 2e28d2642da1f81b7fcef597ff304a6294ea2895 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 11 Sep 2024 21:00:58 -0700 Subject: [PATCH] Polish --- .../context/properties/BoundConfigurationProperties.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/BoundConfigurationProperties.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/BoundConfigurationProperties.java index a41f8e43d8..9e88322cfe 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/BoundConfigurationProperties.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/BoundConfigurationProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,10 +72,8 @@ public class BoundConfigurationProperties { * @return a {@link BoundConfigurationProperties} or {@code null} */ public static BoundConfigurationProperties get(ApplicationContext context) { - if (!context.containsBeanDefinition(BEAN_NAME)) { - return null; - } - return context.getBean(BEAN_NAME, BoundConfigurationProperties.class); + return (!context.containsBeanDefinition(BEAN_NAME)) ? null + : context.getBean(BEAN_NAME, BoundConfigurationProperties.class); } static void register(BeanDefinitionRegistry registry) {