diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/ConversionService.java b/org.springframework.core/src/main/java/org/springframework/core/convert/ConversionService.java index 372e41fb2df..782f78d8bd0 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/ConversionService.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/ConversionService.java @@ -16,10 +16,10 @@ package org.springframework.core.convert; /** - * A service interface for type conversion. This is the entry point into the convert system. Call one of the - * executeConversion operations to perform a thread-safe type conversion using - * this system. Call one of the getConversionExecutor operations to obtain - * a thread-safe {@link ConversionExecutor} command for later use. + * A service interface for type conversion. This is the entry point into the convert system. + *

+ * Call {@link #executeConversion(Object, TypeDescriptor)} to perform a thread-safe type conversion using + * this system. * * @author Keith Donald */ @@ -28,47 +28,21 @@ public interface ConversionService { /** * Returns true if objects of sourceType can be converted to targetType. * @param source the source to convert from (may be null) - * @param targetType the target type to convert to + * @param targetType context about the target type to convert to * @return true if a conversion can be performed, false if not */ public boolean canConvert(Class sourceType, TypeDescriptor targetType); - /** - * Returns true if the source can be converted to targetType. - * @param source the source to convert from (may be null) - * @param targetType the target type to convert to - * @return true if a conversion can be performed, false if not - */ - public boolean canConvert(Object source, TypeDescriptor targetType); - /** * Convert the source to targetType. * @param source the source to convert from (may be null) - * @param targetType the target type to convert to - * @return the converted object, an instance of the targetType, or null if a null source + * @param targetType context about the target type to convert to + * @return the converted object, an instance of {@link TypeDescriptor#getType()}, or null if a null source * was provided - * @throws ConversionExecutorNotFoundException if no suitable conversion executor could be found to convert the + * @throws ConverterNotFoundException if no suitable conversion executor could be found to convert the * source to an instance of targetType * @throws ConversionException if an exception occurred during the conversion process */ - public Object executeConversion(Object source, TypeDescriptor targetType) throws ConversionExecutorNotFoundException, - ConversionException; - - /** - * Get a ConversionExecutor that converts objects from sourceType to targetType. - * The returned ConversionExecutor is thread-safe and may safely be cached for later use by client code. - * @param sourceType the source type to convert from (required) - * @param targetType the target type to convert to (required) - * @return the executor that can execute instance type conversion, never null - * @throws ConversionExecutorNotFoundException when no suitable conversion executor could be found - */ - public ConversionExecutor getConversionExecutor(Class sourceType, TypeDescriptor targetType) - throws ConversionExecutorNotFoundException; - - /** - * Get a type by its name; may be the fully-qualified class name or a registered type alias such as 'int'. - * @return the class, or null if no such name exists - */ - public Class getType(String name); + public Object executeConversion(Object source, TypeDescriptor targetType); } \ No newline at end of file diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/ConverterNotFoundException.java b/org.springframework.core/src/main/java/org/springframework/core/convert/ConverterNotFoundException.java new file mode 100644 index 00000000000..8856a84101c --- /dev/null +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/ConverterNotFoundException.java @@ -0,0 +1,54 @@ +/* + * Copyright 2004-2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.core.convert; + +/** + * Thrown when a conversion executor could not be found in a conversion service. + * + * @author Keith Donald + */ +public class ConverterNotFoundException extends ConversionException { + + private Class sourceType; + + private TypeDescriptor targetType; + + /** + * Creates a new conversion executor not found exception. + * @param sourceType the source type requested to convert from + * @param targetType the target type requested to convert to + * @param message a descriptive message + */ + public ConverterNotFoundException(Class sourceType, TypeDescriptor targetType, String message) { + super(message); + this.sourceType = sourceType; + this.targetType = targetType; + } + + /** + * Returns the source type that was requested to convert from. + */ + public Class getSourceType() { + return sourceType; + } + + /** + * Returns the target type that was requested to convert to. + */ + public TypeDescriptor getTargetType() { + return targetType; + } +} diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/service/AbstractCollectionConverter.java b/org.springframework.core/src/main/java/org/springframework/core/convert/service/AbstractCollectionConverter.java index a43fa91155a..a5ef6262e97 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/service/AbstractCollectionConverter.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/service/AbstractCollectionConverter.java @@ -16,7 +16,6 @@ package org.springframework.core.convert.service; import org.springframework.core.convert.ConversionExecutionException; -import org.springframework.core.convert.ConversionExecutor; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.TypeDescriptor; @@ -26,7 +25,7 @@ import org.springframework.core.convert.TypeDescriptor; */ abstract class AbstractCollectionConverter implements ConversionExecutor { - private ConversionService conversionService; + private GenericConversionService conversionService; private ConversionExecutor elementConverter; @@ -34,7 +33,7 @@ abstract class AbstractCollectionConverter implements ConversionExecutor { private TypeDescriptor targetCollectionType; - public AbstractCollectionConverter(TypeDescriptor sourceCollectionType, TypeDescriptor targetCollectionType, ConversionService conversionService) { + public AbstractCollectionConverter(TypeDescriptor sourceCollectionType, TypeDescriptor targetCollectionType, GenericConversionService conversionService) { this.conversionService = conversionService; this.sourceCollectionType = sourceCollectionType; this.targetCollectionType = targetCollectionType; @@ -61,7 +60,7 @@ abstract class AbstractCollectionConverter implements ConversionExecutor { return targetCollectionType.getElementType(); } - protected ConversionService getConversionService() { + protected GenericConversionService getConversionService() { return conversionService; } diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/service/ArrayToCollection.java b/org.springframework.core/src/main/java/org/springframework/core/convert/service/ArrayToCollection.java index d971a645ce2..e21315f5617 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/service/ArrayToCollection.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/service/ArrayToCollection.java @@ -18,7 +18,6 @@ package org.springframework.core.convert.service; import java.lang.reflect.Array; import java.util.Collection; -import org.springframework.core.convert.ConversionExecutor; import org.springframework.core.convert.TypeDescriptor; /** diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/service/CollectionToArray.java b/org.springframework.core/src/main/java/org/springframework/core/convert/service/CollectionToArray.java index b7e2ed98dba..d70bdae5159 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/service/CollectionToArray.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/service/CollectionToArray.java @@ -19,7 +19,6 @@ import java.lang.reflect.Array; import java.util.Collection; import java.util.Iterator; -import org.springframework.core.convert.ConversionExecutor; import org.springframework.core.convert.TypeDescriptor; /** diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/service/CollectionToCollection.java b/org.springframework.core/src/main/java/org/springframework/core/convert/service/CollectionToCollection.java index a5921926cb0..b189b547035 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/service/CollectionToCollection.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/service/CollectionToCollection.java @@ -18,7 +18,6 @@ package org.springframework.core.convert.service; import java.util.Collection; import java.util.Iterator; -import org.springframework.core.convert.ConversionExecutor; import org.springframework.core.convert.TypeDescriptor; /** diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/ConversionExecutor.java b/org.springframework.core/src/main/java/org/springframework/core/convert/service/ConversionExecutor.java similarity index 87% rename from org.springframework.core/src/main/java/org/springframework/core/convert/ConversionExecutor.java rename to org.springframework.core/src/main/java/org/springframework/core/convert/service/ConversionExecutor.java index 3059f003b72..a84bbe5019c 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/ConversionExecutor.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/service/ConversionExecutor.java @@ -13,7 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.core.convert; +package org.springframework.core.convert.service; + +import org.springframework.core.convert.ConversionExecutionException; /** * A command parameterized with the information necessary to perform a conversion of a source input to a @@ -29,6 +31,6 @@ public interface ConversionExecutor { * @param source the source to convert * @throws ConversionExecutionException if an exception occurs during type conversion */ - public Object execute(Object source) throws ConversionExecutionException; + public Object execute(Object source); } \ No newline at end of file diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/service/DefaultConversionService.java b/org.springframework.core/src/main/java/org/springframework/core/convert/service/DefaultConversionService.java index a149217bf58..73e28ea151a 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/service/DefaultConversionService.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/service/DefaultConversionService.java @@ -49,7 +49,6 @@ public class DefaultConversionService extends GenericConversionService { */ public DefaultConversionService() { addDefaultConverters(); - addDefaultAliases(); } /** @@ -73,21 +72,4 @@ public class DefaultConversionService extends GenericConversionService { addConverter(new ObjectToString()); } - protected void addDefaultAliases() { - addAlias("string", String.class); - addAlias("byte", Byte.class); - addAlias("boolean", Boolean.class); - addAlias("char", Character.class); - addAlias("short", Short.class); - addAlias("int", Integer.class); - addAlias("long", Long.class); - addAlias("float", Float.class); - addAlias("double", Double.class); - addAlias("bigInt", BigInteger.class); - addAlias("bigDecimal", BigDecimal.class); - addAlias("locale", Locale.class); - addAlias("enum", Enum.class); - addAlias("date", Date.class); - } - } \ No newline at end of file diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/service/GenericConversionService.java b/org.springframework.core/src/main/java/org/springframework/core/convert/service/GenericConversionService.java index 74d19fdcc08..8cee88e12eb 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/service/GenericConversionService.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/service/GenericConversionService.java @@ -26,10 +26,8 @@ import java.util.List; import java.util.Map; import org.springframework.core.GenericTypeResolver; -import org.springframework.core.convert.ConversionException; -import org.springframework.core.convert.ConversionExecutor; -import org.springframework.core.convert.ConversionExecutorNotFoundException; import org.springframework.core.convert.ConversionService; +import org.springframework.core.convert.ConverterNotFoundException; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.ConverterInfo; @@ -61,11 +59,6 @@ public class GenericConversionService implements ConversionService { */ private final Map sourceTypeSuperConverters = new HashMap(); - /** - * Indexes classes by well-known aliases. - */ - private final Map aliasMap = new HashMap>(); - /** * An optional parent conversion service. */ @@ -132,48 +125,41 @@ public class GenericConversionService implements ConversionService { return new SuperTwoWayConverterConverter(converter, sourceType, targetType); } - /** - * Add a convenient alias for the target type. {@link #getType(String)} can then be used to lookup the type given - * the alias. - * @see #getType(String) - */ - public void addAlias(String alias, Class targetType) { - aliasMap.put(alias, targetType); - } - // implementing ConversionService public boolean canConvert(Class sourceType, TypeDescriptor targetType) { - try { - getConversionExecutor(sourceType, targetType); + ConversionExecutor executor = getConversionExecutor(sourceType, targetType); + if (executor != null) { return true; - } catch (ConversionExecutorNotFoundException e) { - return false; + } else { + if (parent != null) { + return parent.canConvert(sourceType, targetType); + } else { + return false; + } } } - public boolean canConvert(Object source, TypeDescriptor targetType) { - if (source == null) { - return true; - } - try { - getConversionExecutor(source.getClass(), targetType); - return true; - } catch (ConversionExecutorNotFoundException e) { - return false; - } - } - - public Object executeConversion(Object source, TypeDescriptor targetType) - throws ConversionExecutorNotFoundException, ConversionException { + public Object executeConversion(Object source, TypeDescriptor targetType) { if (source == null) { return null; } - return getConversionExecutor(source.getClass(), targetType).execute(source); + ConversionExecutor executor = getConversionExecutor(source.getClass(), targetType); + if (executor != null) { + return executor.execute(source); + } else { + if (parent != null) { + return parent.executeConversion(source, targetType); + } else { + throw new ConverterNotFoundException(source.getClass(), targetType, + "No converter found that can convert from sourceType [" + source.getClass().getName() + + "] to targetType [" + targetType.getName() + "]"); + } + } } - public ConversionExecutor getConversionExecutor(Class sourceClass, TypeDescriptor targetType) - throws ConversionExecutorNotFoundException { + ConversionExecutor getConversionExecutor(Class sourceClass, TypeDescriptor targetType) + throws ConverterNotFoundException { Assert.notNull(sourceClass, "The sourceType to convert from is required"); Assert.notNull(targetType, "The targetType to convert to is required"); TypeDescriptor sourceType = TypeDescriptor.valueOf(sourceClass); @@ -193,21 +179,21 @@ public class GenericConversionService implements ConversionService { if (sourceType.isCollection()) { return new CollectionToArray(sourceType, targetType, this); } else { - throw new ConversionExecutorNotFoundException(sourceType, targetType, "Object to Array conversion not yet supported"); + return null; } } if (sourceType.isCollection()) { if (targetType.isCollection()) { return new CollectionToCollection(sourceType, targetType, this); } else { - throw new ConversionExecutorNotFoundException(sourceType, targetType, "Object to Collection conversion not yet supported"); + return null; } } if (sourceType.isMap()) { if (targetType.isMap()) { return new MapToMap(sourceType, targetType, this); } else { - throw new ConversionExecutorNotFoundException(sourceType, targetType, "Object to Map conversion not yet supported"); + return null; } } Converter converter = findRegisteredConverter(sourceClass, targetType.getType()); @@ -217,28 +203,10 @@ public class GenericConversionService implements ConversionService { SuperConverter superConverter = findRegisteredSuperConverter(sourceClass, targetType.getType()); if (superConverter != null) { return new StaticSuperConversionExecutor(sourceType, targetType, superConverter); - } - if (parent != null) { - return parent.getConversionExecutor(sourceClass, targetType); } else { if (sourceType.isAssignableTo(targetType)) { return new StaticConversionExecutor(sourceType, targetType, NoOpConverter.INSTANCE); } - throw new ConversionExecutorNotFoundException(sourceType, targetType, - "No ConversionExecutor found for converting from sourceType [" + sourceType.getName() - + "] to targetType [" + targetType.getName() + "]"); - } - } - } - - public Class getType(String name) throws IllegalArgumentException { - Class clazz = (Class) aliasMap.get(name); - if (clazz != null) { - return clazz; - } else { - if (parent != null) { - return parent.getType(name); - } else { return null; } } diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/service/MapToMap.java b/org.springframework.core/src/main/java/org/springframework/core/convert/service/MapToMap.java index 90db0082c84..9d6712433e6 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/service/MapToMap.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/service/MapToMap.java @@ -22,7 +22,6 @@ import java.util.SortedMap; import java.util.TreeMap; import org.springframework.core.convert.ConversionExecutionException; -import org.springframework.core.convert.ConversionExecutor; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.TypeDescriptor; @@ -36,7 +35,7 @@ class MapToMap implements ConversionExecutor { private TypeDescriptor targetType; - private ConversionService conversionService; + private GenericConversionService conversionService; private EntryConverter entryConverter; @@ -46,7 +45,7 @@ class MapToMap implements ConversionExecutor { * @param targetType the target map type * @param conversionService the conversion service */ - public MapToMap(TypeDescriptor sourceType, TypeDescriptor targetType, ConversionService conversionService) { + public MapToMap(TypeDescriptor sourceType, TypeDescriptor targetType, GenericConversionService conversionService) { this.sourceType = sourceType; this.targetType = targetType; this.conversionService = conversionService; diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/service/NoOpConversionExecutor.java b/org.springframework.core/src/main/java/org/springframework/core/convert/service/NoOpConversionExecutor.java index 81773172493..086eb3330be 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/service/NoOpConversionExecutor.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/service/NoOpConversionExecutor.java @@ -16,7 +16,6 @@ package org.springframework.core.convert.service; import org.springframework.core.convert.ConversionExecutionException; -import org.springframework.core.convert.ConversionExecutor; /** * Conversion executor that does nothing. Access singleton at {@link #INSTANCE}.s diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/service/StaticConversionExecutor.java b/org.springframework.core/src/main/java/org/springframework/core/convert/service/StaticConversionExecutor.java index 857d7d3dc27..be3b767a9aa 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/service/StaticConversionExecutor.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/service/StaticConversionExecutor.java @@ -16,7 +16,6 @@ package org.springframework.core.convert.service; import org.springframework.core.convert.ConversionExecutionException; -import org.springframework.core.convert.ConversionExecutor; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.Converter; import org.springframework.core.style.ToStringCreator; diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/service/StaticSuperConversionExecutor.java b/org.springframework.core/src/main/java/org/springframework/core/convert/service/StaticSuperConversionExecutor.java index 58241e9f615..e1f1303391c 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/service/StaticSuperConversionExecutor.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/service/StaticSuperConversionExecutor.java @@ -16,7 +16,6 @@ package org.springframework.core.convert.service; import org.springframework.core.convert.ConversionExecutionException; -import org.springframework.core.convert.ConversionExecutor; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.SuperConverter; import org.springframework.core.style.ToStringCreator; diff --git a/org.springframework.core/src/test/java/org/springframework/core/convert/service/GenericConversionServiceTests.java b/org.springframework.core/src/test/java/org/springframework/core/convert/service/GenericConversionServiceTests.java index dd96160956a..201ca828855 100644 --- a/org.springframework.core/src/test/java/org/springframework/core/convert/service/GenericConversionServiceTests.java +++ b/org.springframework.core/src/test/java/org/springframework/core/convert/service/GenericConversionServiceTests.java @@ -31,8 +31,7 @@ import java.util.Map; import org.junit.Ignore; import org.junit.Test; import org.springframework.core.convert.ConversionExecutionException; -import org.springframework.core.convert.ConversionExecutor; -import org.springframework.core.convert.ConversionExecutorNotFoundException; +import org.springframework.core.convert.ConverterNotFoundException; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.NumberToNumber; @@ -84,9 +83,9 @@ public class GenericConversionServiceTests { @Test public void convertExecutorNotFound() { try { - service.getConversionExecutor(String.class, type(Integer.class)); + service.executeConversion("3", type(Integer.class)); fail("Should have thrown an exception"); - } catch (ConversionExecutorNotFoundException e) { + } catch (ConverterNotFoundException e) { } } @@ -161,9 +160,9 @@ public class GenericConversionServiceTests { } }); try { - ConversionExecutor executor = service.getConversionExecutor(String.class, type(Integer.class)); + service.executeConversion("3", type(Integer.class)); fail("Should have failed"); - } catch (ConversionExecutorNotFoundException e) { + } catch (ConverterNotFoundException e) { } } diff --git a/org.springframework.expression/src/main/java/org/springframework/expression/spel/support/StandardTypeConverter.java b/org.springframework.expression/src/main/java/org/springframework/expression/spel/support/StandardTypeConverter.java index e1f4bfa5d42..3b11b06081b 100644 --- a/org.springframework.expression/src/main/java/org/springframework/expression/spel/support/StandardTypeConverter.java +++ b/org.springframework.expression/src/main/java/org/springframework/expression/spel/support/StandardTypeConverter.java @@ -17,7 +17,7 @@ package org.springframework.expression.spel.support; import org.springframework.core.convert.ConversionException; -import org.springframework.core.convert.ConversionExecutorNotFoundException; +import org.springframework.core.convert.ConverterNotFoundException; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.service.DefaultConversionService; @@ -53,7 +53,7 @@ public class StandardTypeConverter implements TypeConverter { public Object convertValue(Object value, TypeDescriptor typeDescriptor) throws EvaluationException { try { return conversionService.executeConversion(value, typeDescriptor); - } catch (ConversionExecutorNotFoundException cenfe) { + } catch (ConverterNotFoundException cenfe) { throw new SpelException(cenfe, SpelMessages.TYPE_CONVERSION_ERROR, value.getClass(), typeDescriptor.asString()); } catch (ConversionException ce) { throw new SpelException(ce, SpelMessages.TYPE_CONVERSION_ERROR, value.getClass(), typeDescriptor.asString()); diff --git a/org.springframework.expression/src/test/java/org/springframework/expression/spel/ExpressionTestsUsingCoreConversionService.java b/org.springframework.expression/src/test/java/org/springframework/expression/spel/ExpressionTestsUsingCoreConversionService.java index 2215acb3a4f..d3920f8b6d6 100644 --- a/org.springframework.expression/src/test/java/org/springframework/expression/spel/ExpressionTestsUsingCoreConversionService.java +++ b/org.springframework.expression/src/test/java/org/springframework/expression/spel/ExpressionTestsUsingCoreConversionService.java @@ -19,7 +19,6 @@ package org.springframework.expression.spel; import java.util.ArrayList; import java.util.List; -import org.springframework.core.convert.ConversionExecutor; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.service.DefaultConversionService; import org.springframework.core.convert.service.GenericConversionService; @@ -65,17 +64,14 @@ public class ExpressionTestsUsingCoreConversionService extends ExpressionTestCas // ArrayList containing List to List Class clazz = typeDescriptorForListOfString.getElementType(); assertEquals(String.class,clazz); - ConversionExecutor executor = tcs.getConversionExecutor(ArrayList.class, typeDescriptorForListOfString); - assertNotNull(executor); - List l = (List)executor.execute(listOfInteger); + List l = (List) tcs.executeConversion(listOfInteger, typeDescriptorForListOfString); assertNotNull(l); // ArrayList containing List to List clazz = typeDescriptorForListOfInteger.getElementType(); assertEquals(Integer.class,clazz); - executor = tcs.getConversionExecutor(ArrayList.class, typeDescriptorForListOfInteger); - assertNotNull(executor); - l = (List)executor.execute(listOfString); + + l = (List) tcs.executeConversion(listOfString, typeDescriptorForListOfString); assertNotNull(l); }