Favor convertValue(Object, TypeDescriptor) where possible and TypedValue(Object); check with Andy on Selection and Projection TypedValue usage

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3881 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Keith Donald
2011-01-07 06:32:21 +00:00
parent 97033d66fb
commit 61d54ae436
12 changed files with 32 additions and 47 deletions
@@ -121,8 +121,7 @@ public class ExpressionTestsUsingCoreConversionService extends ExpressionTestCas
assertTrue(evaluationContext.getTypeConverter()
.canConvert(TypeDescriptor.valueOf(String.class), collectionType));
// ... and it can be done successfully
assertEquals("[1, 2, 3, 4]", evaluationContext.getTypeConverter().convertValue("1,2,3,4",
TypeDescriptor.valueOf(String.class), collectionType).toString());
assertEquals("[1, 2, 3, 4]", evaluationContext.getTypeConverter().convertValue("1,2,3,4", collectionType).toString());
evaluationContext.setVariable("target", new TestTarget());
@@ -153,6 +152,7 @@ public class ExpressionTestsUsingCoreConversionService extends ExpressionTestCas
public Object convertValue(Object value, TypeDescriptor sourceType, TypeDescriptor targetType) throws EvaluationException {
return this.service.convert(value, sourceType, targetType);
}
}
}