This commit is contained in:
Phillip Webb
2024-09-11 21:00:58 -07:00
parent 06e3f37afd
commit 2e28d2642d

View File

@@ -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) {