File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
spring-beans/src/main/java/org/springframework/beans/factory/support
spring-core/src/main/java/org/springframework/util Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -370,8 +370,8 @@ public Object getObject() throws BeansException {
370370 }
371371 catch (TypeMismatchException ex ) {
372372 if (logger .isDebugEnabled ()) {
373- logger .debug ("Failed to convert bean '" + name + "' to required type [ " +
374- ClassUtils .getQualifiedName (requiredType ) + "] " , ex );
373+ logger .debug ("Failed to convert bean '" + name + "' to required type ' " +
374+ ClassUtils .getQualifiedName (requiredType ) + "' " , ex );
375375 }
376376 throw new BeanNotOfRequiredTypeException (name , requiredType , bean .getClass ());
377377 }
@@ -803,12 +803,15 @@ public boolean hasEmbeddedValueResolver() {
803803
804804 @ Override
805805 public String resolveEmbeddedValue (String value ) {
806+ if (value == null ) {
807+ return null ;
808+ }
806809 String result = value ;
807810 for (StringValueResolver resolver : this .embeddedValueResolvers ) {
811+ result = resolver .resolveStringValue (result );
808812 if (result == null ) {
809813 return null ;
810814 }
811- result = resolver .resolveStringValue (result );
812815 }
813816 return result ;
814817 }
Original file line number Diff line number Diff line change @@ -31,8 +31,11 @@ public interface StringValueResolver {
3131
3232 /**
3333 * Resolve the given String value, for example parsing placeholders.
34- * @param strVal the original String value
35- * @return the resolved String value
34+ * @param strVal the original String value (never {@code null})
35+ * @return the resolved String value (may be {@code null} when resolved to a null
36+ * value), possibly the original String value itself (in case of no placeholders
37+ * to resolve or when ignoring unresolvable placeholders)
38+ * @throws IllegalArgumentException in case of an unresolvable String value
3639 */
3740 String resolveStringValue (String strVal );
3841
You can’t perform that action at this time.
0 commit comments