Propagate EvaluationContext from LiteralExpression

Update getValue(EvaluationContext context, Object rootObject,
Class<T> desiredResultType) to propagate the EvaluationContext to
ExpressionUtils.

Issue: SPR-10953
master
Phillip Webb 11 years ago
parent c9aace4da2
commit 686cd79bdd
  1. 4
      spring-expression/src/main/java/org/springframework/expression/common/LiteralExpression.java

@ -27,7 +27,7 @@ import org.springframework.expression.TypedValue;
* string literal. It is used with CompositeStringExpression when representing a template
* expression which is made up of pieces - some being real expressions to be handled by an
* EL implementation like Spel, and some being just textual elements.
*
*
* @author Andy Clement
* @since 3.0
*/
@ -118,7 +118,7 @@ public class LiteralExpression implements Expression {
@Override
public <T> T getValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType) throws EvaluationException {
Object value = getValue(context, rootObject);
return ExpressionUtils.convertTypedValue(null, new TypedValue(value), desiredResultType);
return ExpressionUtils.convertTypedValue(context, new TypedValue(value), desiredResultType);
}
@Override

Loading…
Cancel
Save