Commit d9f09e46 authored by Stephane Nicoll's avatar Stephane Nicoll

Cherry-pick 398d06e3

Fixed initially in #3725

The target attribute is effectively checked for null beforehand so this
additional defensive check can be removed.

Closes gh-4567
parent c605675b
...@@ -297,10 +297,7 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc ...@@ -297,10 +297,7 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
factory.bindPropertiesToTarget(); factory.bindPropertiesToTarget();
} }
catch (Exception ex) { catch (Exception ex) {
String targetClass = "[unknown]"; String targetClass = ClassUtils.getShortName(target.getClass());
if (target != null) {
ClassUtils.getShortName(target.getClass());
}
throw new BeanCreationException(beanName, "Could not bind properties to " throw new BeanCreationException(beanName, "Could not bind properties to "
+ targetClass + " (" + getAnnotationDetails(annotation) + ")", ex); + targetClass + " (" + getAnnotationDetails(annotation) + ")", ex);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment