Buggy code:
public abstract class GenericTypeResolver { private static final Map < Class , Map < TypeVariable , Type > > typeVariableCache = new org . springframework . util . ConcurrentReferenceHashMap < Class , Map < TypeVariable , Type > > ( ) ; @ Deprecated public static Type getTargetType ( MethodParameter methodParam ) { } public static Class < ? > resolveParameterType ( MethodParameter methodParam , Class < ? > clazz ) { } public static Class < ? > resolveReturnType ( Method method , Class < ? > clazz ) { } public static Class < ? > resolveReturnTypeForGenericMethod ( Method method , Object [ ] args , ClassLoader classLoader ) { Assert . notNull ( method , "Method<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; Assert . notNull ( args , "Argument<seq2seq4repair_space>array<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; TypeVariable < Method > [ ] declaredTypeVariables = method . getTypeParameters ( ) ; Type genericReturnType = method . getGenericReturnType ( ) ; Type [ ] methodArgumentTypes = method . getGenericParameterTypes ( ) ; if ( ( declaredTypeVariables . length ) == 0 ) { return method . getReturnType ( ) ; } if ( ( args . length ) < ( methodArgumentTypes . length ) ) { return null ; } boolean locallyDeclaredTypeVariableMatchesReturnType = false ; for ( TypeVariable < Method > currentTypeVariable : declaredTypeVariables ) { if ( currentTypeVariable . equals ( genericReturnType ) ) { locallyDeclaredTypeVariableMatchesReturnType = true ; break ; } } if ( locallyDeclaredTypeVariableMatchesReturnType ) { for ( int i = 0 ; i < ( methodArgumentTypes . length ) ; i ++ ) { Type currentMethodArgumentType = methodArgumentTypes [ i ] ; if ( currentMethodArgumentType . equals ( genericReturnType ) ) { return args [ i ] . getClass ( ) ; } if ( currentMethodArgumentType instanceof ParameterizedType ) { ParameterizedType parameterizedType = ( ( ParameterizedType ) ( currentMethodArgumentType ) ) ; Type [ ] actualTypeArguments = parameterizedType . getActualTypeArguments ( ) ; for ( Type typeArg : actualTypeArguments ) { if ( typeArg . equals ( genericReturnType ) ) { Object arg = args [ i ] ; if ( arg instanceof Class ) { return ( ( Class < ? > ) ( arg ) ) ; } else <START_BUG> if ( arg instanceof String ) { <END_BUG> try { return classLoader . loadClass ( ( ( String ) ( arg ) ) ) ; } catch ( ClassNotFoundException ex ) { throw new IllegalStateException ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>resolve<seq2seq4repair_space>specific<seq2seq4repair_space>class<seq2seq4repair_space>name<seq2seq4repair_space>argument<seq2seq4repair_space>[" + arg ) + "]" ) , ex ) ; } } else { return method . getReturnType ( ) ; } } } } } } return method . getReturnType ( ) ; } public static Class < ? > resolveReturnTypeArgument ( Method method , Class < ? > genericIfc ) { } public static Class < ? > resolveTypeArgument ( Class < ? > clazz , Class < ? > genericIfc ) { } private static Class < ? > getSingleGeneric ( ResolvableType resolvableType ) { } public static Class [ ] resolveTypeArguments ( Class < ? > clazz , Class < ? > genericIfc ) { } @ Deprecated public static Class < ? > resolveType ( Type genericType , Map < TypeVariable , Type > typeVariableMap ) { } @ Deprecated public static Map < TypeVariable , Type > getTypeVariableMap ( Class < ? > clazz ) { } private static void buildTypeVariableMap ( ResolvableType type , Map < TypeVariable , Type > typeVariableMap ) { } private static class TypeVariableMapResolver implements TypeVariableResolver { private final Map < TypeVariable , Type > typeVariableMap ; public TypeVariableMapResolver ( Map < TypeVariable , Type > typeVariableMap ) { } @ Override public Type resolveVariable ( TypeVariable typeVariable ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } } }

Fix:
if ( ( arg instanceof String ) && ( classLoader != null ) ) {