Buggy code:
public class GenericConversionService implements ConversionService , ConverterRegistry { private static final Log logger = LogFactory . getLog ( GenericConversionService . class ) ; private static final GenericConverter NO_OP_CONVERTER = new GenericConverter ( ) { public Class < ? > [ ] [ ] getConvertibleTypes ( ) { } public Object convert ( Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) { } } ; private final Map < Class < ? > , Map < Class < ? > , GenericConversionService . MatchableConverters > > converters = new HashMap < Class < ? > , Map < Class < ? > , GenericConversionService . MatchableConverters > > ( 36 ) ; public void addConverter ( Converter < ? , ? > converter ) { } public void addConverterFactory ( ConverterFactory < ? , ? > converterFactory ) { } public void addGenericConverter ( GenericConverter converter ) { } public void removeConvertible ( Class < ? > sourceType , Class < ? > targetType ) { } public boolean canConvert ( Class < ? > sourceType , Class < ? > targetType ) { } @ SuppressWarnings ( "unchecked" ) public < T > T convert ( Object source , Class < T > targetType ) { } public boolean canConvert ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } public Object convert ( Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) { } public String toString ( ) { } protected Object convertNullSource ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } protected GenericConverter getConverter ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } protected GenericConverter getDefaultConverter ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } private Class < ? > [ ] getRequiredTypeInfo ( Object converter , Class < ? > genericIfc ) { } private GenericConversionService . MatchableConverters getMatchableConvertersList ( Class < ? > sourceType , Class < ? > targetType ) { } private Map < Class < ? > , GenericConversionService . MatchableConverters > getSourceConverterMap ( Class < ? > sourceType ) { } private void assertNotNull ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } private GenericConverter findConverterForClassPair ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } private Map < Class < ? > , GenericConversionService . MatchableConverters > getTargetConvertersForSource ( Class < ? > sourceType ) { } private GenericConverter getMatchingConverterForTarget ( TypeDescriptor sourceType , TypeDescriptor targetType , Map < Class < ? > , GenericConversionService . MatchableConverters > converters ) { } private GenericConverter matchConverter ( GenericConversionService . MatchableConverters matchable , TypeDescriptor sourceFieldType , TypeDescriptor targetFieldType ) { } @ SuppressWarnings ( "unchecked" ) private final class ConverterAdapter implements GenericConverter { private final Class < ? > [ ] typeInfo ; private final Converter converter ; public ConverterAdapter ( Class < ? > [ ] typeInfo , Converter < ? , ? > converter ) { } public Class < ? > [ ] [ ] getConvertibleTypes ( ) { } public Object convert ( Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) { } public String toString ( ) { } } @ SuppressWarnings ( "unchecked" ) private final class ConverterFactoryAdapter implements GenericConverter { private final Class < ? > [ ] typeInfo ; private final ConverterFactory converterFactory ; public ConverterFactoryAdapter ( Class < ? > [ ] typeInfo , ConverterFactory < ? , ? > converterFactory ) { } public Class < ? > [ ] [ ] getConvertibleTypes ( ) { } public Object convert ( Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) { } public String toString ( ) { } } private static class MatchableConverters { private LinkedList < ConditionalGenericConverter > conditionalConverters ; private GenericConverter defaultConverter ; public void add ( GenericConverter converter ) { if ( converter instanceof ConditionalGenericConverter ) { if ( ( this . conditionalConverters ) == null ) { this . conditionalConverters = new LinkedList < ConditionalGenericConverter > ( ) ; } <START_BUG> this . conditionalConverters . add ( ( ( ConditionalGenericConverter ) ( converter ) ) ) ; <END_BUG> } else { this . defaultConverter = converter ; } } public GenericConverter matchConverter ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } public String toString ( ) { } } }

Fix:
this . conditionalConverters . addFirst ( ( ( ConditionalGenericConverter ) ( converter ) ) ) ;