Buggy code:
class TypeConverterDelegate { private static final Log logger = LogFactory . getLog ( TypeConverterDelegate . class ) ; private final PropertyEditorRegistrySupport propertyEditorRegistry ; private final Object targetObject ; public TypeConverterDelegate ( PropertyEditorRegistrySupport propertyEditorRegistry ) { } public TypeConverterDelegate ( PropertyEditorRegistrySupport propertyEditorRegistry , Object targetObject ) { } public < T > T convertIfNecessary ( Object newValue , Class < T > requiredType , MethodParameter methodParam ) throws IllegalArgumentException { } public < T > T convertIfNecessary ( String propertyName , Object oldValue , Object newValue , Class < T > requiredType ) throws IllegalArgumentException { } @ SuppressWarnings ( "unchecked" ) public < T > T convertIfNecessary ( String propertyName , Object oldValue , Object newValue , Class < T > requiredType , TypeDescriptor typeDescriptor ) throws IllegalArgumentException { Object convertedValue = newValue ; PropertyEditor editor = this . propertyEditorRegistry . findCustomEditor ( requiredType , propertyName ) ; ConversionService conversionService = this . propertyEditorRegistry . getConversionService ( ) ; if ( ( ( editor == null ) && ( conversionService != null ) ) && ( convertedValue != null ) ) { TypeDescriptor sourceTypeDesc = TypeDescriptor . forObject ( convertedValue ) ; <START_BUG> TypeDescriptor targetTypeDesc = typeDescriptor . forElementType ( requiredType ) ; <END_BUG> if ( conversionService . canConvert ( sourceTypeDesc , targetTypeDesc ) ) { return ( ( T ) ( conversionService . convert ( convertedValue , sourceTypeDesc , targetTypeDesc ) ) ) ; } } if ( ( editor != null ) || ( ( requiredType != null ) && ( ! ( ClassUtils . isAssignableValue ( requiredType , convertedValue ) ) ) ) ) { if ( ( ( ( requiredType != null ) && ( Collection . class . isAssignableFrom ( requiredType ) ) ) && ( convertedValue instanceof String ) ) && ( ( typeDescriptor . getMethodParameter ( ) ) != null ) ) { Class elemType = GenericCollectionTypeResolver . getCollectionParameterType ( typeDescriptor . getMethodParameter ( ) ) ; if ( ( elemType != null ) && ( Enum . class . isAssignableFrom ( elemType ) ) ) { convertedValue = StringUtils . commaDelimitedListToStringArray ( ( ( String ) ( convertedValue ) ) ) ; } } if ( editor == null ) { editor = findDefaultEditor ( requiredType , typeDescriptor ) ; } convertedValue = doConvertValue ( oldValue , convertedValue , requiredType , editor ) ; } if ( requiredType != null ) { if ( convertedValue != null ) { if ( requiredType . isArray ( ) ) { if ( ( convertedValue instanceof String ) && ( Enum . class . isAssignableFrom ( requiredType . getComponentType ( ) ) ) ) { convertedValue = StringUtils . commaDelimitedListToStringArray ( ( ( String ) ( convertedValue ) ) ) ; } return ( ( T ) ( convertToTypedArray ( convertedValue , propertyName , requiredType . getComponentType ( ) ) ) ) ; } else if ( convertedValue instanceof Collection ) { convertedValue = convertToTypedCollection ( ( ( Collection ) ( convertedValue ) ) , propertyName , requiredType , typeDescriptor ) ; } else if ( convertedValue instanceof Map ) { convertedValue = convertToTypedMap ( ( ( Map ) ( convertedValue ) ) , propertyName , requiredType , typeDescriptor ) ; } if ( ( convertedValue . getClass ( ) . isArray ( ) ) && ( ( Array . getLength ( convertedValue ) ) == 1 ) ) { convertedValue = Array . get ( convertedValue , 0 ) ; } if ( ( String . class . equals ( requiredType ) ) && ( ClassUtils . isPrimitiveOrWrapper ( convertedValue . getClass ( ) ) ) ) { return ( ( T ) ( convertedValue . toString ( ) ) ) ; } else if ( ( convertedValue instanceof String ) && ( ! ( requiredType . isInstance ( convertedValue ) ) ) ) { if ( ( ! ( requiredType . isInterface ( ) ) ) && ( ! ( requiredType . isEnum ( ) ) ) ) { try { Constructor strCtor = requiredType . getConstructor ( String . class ) ; return ( ( T ) ( BeanUtils . instantiateClass ( strCtor , convertedValue ) ) ) ; } catch ( NoSuchMethodException ex ) { if ( TypeConverterDelegate . logger . isTraceEnabled ( ) ) { TypeConverterDelegate . logger . trace ( ( ( "No<seq2seq4repair_space>String<seq2seq4repair_space>constructor<seq2seq4repair_space>found<seq2seq4repair_space>on<seq2seq4repair_space>type<seq2seq4repair_space>[" + ( requiredType . getName ( ) ) ) + "]" ) , ex ) ; } } catch ( Exception ex ) { if ( TypeConverterDelegate . logger . isDebugEnabled ( ) ) { TypeConverterDelegate . logger . debug ( ( ( "Construction<seq2seq4repair_space>via<seq2seq4repair_space>String<seq2seq4repair_space>failed<seq2seq4repair_space>for<seq2seq4repair_space>type<seq2seq4repair_space>[" + ( requiredType . getName ( ) ) ) + "]" ) , ex ) ; } } } String trimmedValue = ( ( String ) ( convertedValue ) ) . trim ( ) ; if ( ( requiredType . isEnum ( ) ) && ( "" . equals ( trimmedValue ) ) ) { return null ; } convertedValue = attemptToConvertStringToEnum ( requiredType , trimmedValue , convertedValue ) ; } } if ( ! ( ClassUtils . isAssignableValue ( requiredType , convertedValue ) ) ) { StringBuilder msg = new StringBuilder ( ) ; msg . append ( "Cannot<seq2seq4repair_space>convert<seq2seq4repair_space>value<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>[" ) . append ( ClassUtils . getDescriptiveType ( newValue ) ) ; msg . append ( "]<seq2seq4repair_space>to<seq2seq4repair_space>required<seq2seq4repair_space>type<seq2seq4repair_space>[" ) . append ( ClassUtils . getQualifiedName ( requiredType ) ) . append ( "]" ) ; if ( propertyName != null ) { msg . append ( "<seq2seq4repair_space>for<seq2seq4repair_space>property<seq2seq4repair_space>'" ) . append ( propertyName ) . append ( "'" ) ; } if ( editor != null ) { msg . append ( ":<seq2seq4repair_space>PropertyEditor<seq2seq4repair_space>[" ) . append ( editor . getClass ( ) . getName ( ) ) . append ( "]<seq2seq4repair_space>returned<seq2seq4repair_space>inappropriate<seq2seq4repair_space>value" ) ; throw new IllegalArgumentException ( msg . toString ( ) ) ; } else { msg . append ( ":<seq2seq4repair_space>no<seq2seq4repair_space>matching<seq2seq4repair_space>editors<seq2seq4repair_space>or<seq2seq4repair_space>conversion<seq2seq4repair_space>strategy<seq2seq4repair_space>found" ) ; throw new IllegalStateException ( msg . toString ( ) ) ; } } }

Fix:
TypeDescriptor targetTypeDesc = typeDescriptor ;