Skip to content

Commit d9f09e4

Browse files
committed
Cherry-pick 398d06e
Fixed initially in #3725 The target attribute is effectively checked for null beforehand so this additional defensive check can be removed. Closes gh-4567
1 parent c605675 commit d9f09e4

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,7 @@ private void postProcessBeforeInitialization(Object bean, String beanName,
297297
factory.bindPropertiesToTarget();
298298
}
299299
catch (Exception ex) {
300-
String targetClass = "[unknown]";
301-
if (target != null) {
302-
ClassUtils.getShortName(target.getClass());
303-
}
300+
String targetClass = ClassUtils.getShortName(target.getClass());
304301
throw new BeanCreationException(beanName, "Could not bind properties to "
305302
+ targetClass + " (" + getAnnotationDetails(annotation) + ")", ex);
306303
}

0 commit comments

Comments
 (0)