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
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 {
370
370
}
371
371
catch (TypeMismatchException ex ) {
372
372
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 );
375
375
}
376
376
throw new BeanNotOfRequiredTypeException (name , requiredType , bean .getClass ());
377
377
}
@@ -803,12 +803,15 @@ public boolean hasEmbeddedValueResolver() {
803
803
804
804
@ Override
805
805
public String resolveEmbeddedValue (String value ) {
806
+ if (value == null ) {
807
+ return null ;
808
+ }
806
809
String result = value ;
807
810
for (StringValueResolver resolver : this .embeddedValueResolvers ) {
811
+ result = resolver .resolveStringValue (result );
808
812
if (result == null ) {
809
813
return null ;
810
814
}
811
- result = resolver .resolveStringValue (result );
812
815
}
813
816
return result ;
814
817
}
Original file line number Diff line number Diff line change @@ -31,8 +31,11 @@ public interface StringValueResolver {
31
31
32
32
/**
33
33
* 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
36
39
*/
37
40
String resolveStringValue (String strVal );
38
41
You can’t perform that action at this time.
0 commit comments