File tree 2 files changed +12
-6
lines changed
spring-beans/src/main/java/org/springframework/beans/factory/support
spring-core/src/main/java/org/springframework/util
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -372,8 +372,8 @@ public Object getObject() throws BeansException {
372
372
}
373
373
catch (TypeMismatchException ex ) {
374
374
if (logger .isDebugEnabled ()) {
375
- logger .debug ("Failed to convert bean '" + name + "' to required type [ " +
376
- ClassUtils .getQualifiedName (requiredType ) + "] " , ex );
375
+ logger .debug ("Failed to convert bean '" + name + "' to required type ' " +
376
+ ClassUtils .getQualifiedName (requiredType ) + "' " , ex );
377
377
}
378
378
throw new BeanNotOfRequiredTypeException (name , requiredType , bean .getClass ());
379
379
}
@@ -805,12 +805,15 @@ public boolean hasEmbeddedValueResolver() {
805
805
806
806
@ Override
807
807
public String resolveEmbeddedValue (String value ) {
808
+ if (value == null ) {
809
+ return null ;
810
+ }
808
811
String result = value ;
809
812
for (StringValueResolver resolver : this .embeddedValueResolvers ) {
813
+ result = resolver .resolveStringValue (result );
810
814
if (result == null ) {
811
815
return null ;
812
816
}
813
- result = resolver .resolveStringValue (result );
814
817
}
815
818
return result ;
816
819
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2007 the original author or authors.
2
+ * Copyright 2002-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -30,8 +30,11 @@ public interface StringValueResolver {
30
30
31
31
/**
32
32
* Resolve the given String value, for example parsing placeholders.
33
- * @param strVal the original String value
34
- * @return the resolved String value
33
+ * @param strVal the original String value (never {@code null})
34
+ * @return the resolved String value (may be {@code null} when resolved to a null
35
+ * value), possibly the original String value itself (in case of no placeholders
36
+ * to resolve or when ignoring unresolvable placeholders)
37
+ * @throws IllegalArgumentException in case of an unresolvable String value
35
38
*/
36
39
String resolveStringValue (String strVal );
37
40
You can’t perform that action at this time.
0 commit comments