Buggy code:
public class ReflectivePropertyAccessor implements PropertyAccessor { protected final Map < ReflectivePropertyAccessor . CacheKey , ReflectivePropertyAccessor . InvokerPair > readerCache = new ConcurrentHashMap < ReflectivePropertyAccessor . CacheKey , ReflectivePropertyAccessor . InvokerPair > ( ) ; protected final Map < ReflectivePropertyAccessor . CacheKey , Member > writerCache = new ConcurrentHashMap < ReflectivePropertyAccessor . CacheKey , Member > ( ) ; protected final Map < ReflectivePropertyAccessor . CacheKey , TypeDescriptor > typeDescriptorCache = new ConcurrentHashMap < ReflectivePropertyAccessor . CacheKey , TypeDescriptor > ( ) ; public Class < ? > [ ] getSpecificTargetClasses ( ) { } public boolean canRead ( EvaluationContext context , Object target , String name ) throws AccessException { } public TypedValue read ( EvaluationContext context , Object target , String name ) throws AccessException { } public boolean canWrite ( EvaluationContext context , Object target , String name ) throws AccessException { } public void write ( EvaluationContext context , Object target , String name , Object newValue ) throws AccessException { if ( target == null ) { throw new AccessException ( "Cannot<seq2seq4repair_space>write<seq2seq4repair_space>property<seq2seq4repair_space>on<seq2seq4repair_space>null<seq2seq4repair_space>target" ) ; } Class < ? > type = ( target instanceof Class ) ? ( ( Class < ? > ) ( target ) ) : target . getClass ( ) ; Object possiblyConvertedNewValue = newValue ; TypeDescriptor typeDescriptor = getTypeDescriptor ( context , target , name ) ; if ( typeDescriptor != null ) { try { <START_BUG> possiblyConvertedNewValue = context . getTypeConverter ( ) . convertValue ( newValue , TypeDescriptor . forObject ( newValue ) , typeDescriptor ) ; <END_BUG> } catch ( EvaluationException evaluationException ) { throw new AccessException ( "Type<seq2seq4repair_space>conversion<seq2seq4repair_space>failure" , evaluationException ) ; } } ReflectivePropertyAccessor . CacheKey cacheKey = new ReflectivePropertyAccessor . CacheKey ( type , name ) ; Member cachedMember = this . writerCache . get ( cacheKey ) ; if ( ( cachedMember == null ) || ( cachedMember instanceof Method ) ) { Method method = ( ( Method ) ( cachedMember ) ) ; if ( method == null ) { method = findSetterForProperty ( name , type , ( target instanceof Class ) ) ; if ( method != null ) { cachedMember = method ; this . writerCache . put ( cacheKey , cachedMember ) ; } } if ( method != null ) { try { ReflectionUtils . makeAccessible ( method ) ; method . invoke ( target , possiblyConvertedNewValue ) ; return ; } catch ( Exception ex ) { throw new AccessException ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>access<seq2seq4repair_space>property<seq2seq4repair_space>'" + name ) + "'<seq2seq4repair_space>through<seq2seq4repair_space>setter" ) , ex ) ; } } } if ( ( cachedMember == null ) || ( cachedMember instanceof Field ) ) { Field field = ( ( Field ) ( cachedMember ) ) ; if ( field == null ) { field = findField ( name , type , ( target instanceof Class ) ) ; if ( field != null ) { cachedMember = field ; this . writerCache . put ( cacheKey , cachedMember ) ; } } if ( field != null ) { try { ReflectionUtils . makeAccessible ( field ) ; field . set ( target , possiblyConvertedNewValue ) ; return ; } catch ( Exception ex ) { throw new AccessException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>access<seq2seq4repair_space>field:<seq2seq4repair_space>" + name ) , ex ) ; } } } throw new AccessException ( ( ( "Neither<seq2seq4repair_space>setter<seq2seq4repair_space>nor<seq2seq4repair_space>field<seq2seq4repair_space>found<seq2seq4repair_space>for<seq2seq4repair_space>property<seq2seq4repair_space>'" + name ) + "'" ) ) ; } private TypeDescriptor getTypeDescriptor ( EvaluationContext context , Object target , String name ) { } protected Method findGetterForProperty ( String propertyName , Class < ? > clazz , boolean mustBeStatic ) { } protected Method findSetterForProperty ( String propertyName , Class < ? > clazz , boolean mustBeStatic ) { } protected Field findField ( String name , Class < ? > clazz , boolean mustBeStatic ) { } private static class InvokerPair { final Member member ; final TypeDescriptor typeDescriptor ; public InvokerPair ( Member member , TypeDescriptor typeDescriptor ) { } } private static class CacheKey { private final Class clazz ; private final String name ; public CacheKey ( Class clazz , String name ) { } @ Override public boolean equals ( Object other ) { } @ Override public int hashCode ( ) { } } public PropertyAccessor createOptimalAccessor ( EvaluationContext eContext , Object target , String name ) { } static class OptimalPropertyAccessor implements PropertyAccessor { private final Member member ; private final TypeDescriptor typeDescriptor ; private final boolean needsToBeMadeAccessible ; OptimalPropertyAccessor ( ReflectivePropertyAccessor . InvokerPair target ) { } public Class [ ] getSpecificTargetClasses ( ) { } public boolean canRead ( EvaluationContext context , Object target , String name ) throws AccessException { } public TypedValue read ( EvaluationContext context , Object target , String name ) throws AccessException { } public boolean canWrite ( EvaluationContext context , Object target , String name ) throws AccessException { } public void write ( EvaluationContext context , Object target , String name , Object newValue ) throws AccessException { throw new UnsupportedOperationException ( "Should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>called<seq2seq4repair_space>on<seq2seq4repair_space>an<seq2seq4repair_space>OptimalPropertyAccessor" ) ; } } }

Fix:
possiblyConvertedNewValue = context . getTypeConverter ( ) . convertValue ( newValue , typeDescriptor ) ;