Buggy code:
public class ReflectionHelper { static ReflectionHelper . ArgumentsMatchInfo compareArguments ( List < TypeDescriptor > expectedArgTypes , List < TypeDescriptor > suppliedArgTypes , TypeConverter typeConverter ) { } public static int getTypeDifferenceWeight ( List < TypeDescriptor > paramTypes , List < TypeDescriptor > argTypes ) { } static ReflectionHelper . ArgumentsMatchInfo compareArgumentsVarargs ( List < TypeDescriptor > expectedArgTypes , List < TypeDescriptor > suppliedArgTypes , TypeConverter typeConverter ) { Assert . isTrue ( ( ( expectedArgTypes != null ) && ( ( expectedArgTypes . size ( ) ) > 0 ) ) , "Expected<seq2seq4repair_space>arguments<seq2seq4repair_space>must<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space>include<seq2seq4repair_space>one<seq2seq4repair_space>array<seq2seq4repair_space>(the<seq2seq4repair_space>vargargs<seq2seq4repair_space>parameter)" ) ; Assert . isTrue ( expectedArgTypes . get ( ( ( expectedArgTypes . size ( ) ) - 1 ) ) . isArray ( ) , "Final<seq2seq4repair_space>expected<seq2seq4repair_space>argument<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>array<seq2seq4repair_space>type<seq2seq4repair_space>(the<seq2seq4repair_space>varargs<seq2seq4repair_space>parameter)" ) ; ReflectionHelper . ArgsMatchKind match = ReflectionHelper . ArgsMatchKind . EXACT ; List < Integer > argsRequiringConversion = null ; int argCountUpToVarargs = ( expectedArgTypes . size ( ) ) - 1 ; for ( int i = 0 ; ( i < argCountUpToVarargs ) && ( match != null ) ; i ++ ) { TypeDescriptor suppliedArg = suppliedArgTypes . get ( i ) ; TypeDescriptor expectedArg = expectedArgTypes . get ( i ) ; if ( suppliedArg == null ) { if ( expectedArg . isPrimitive ( ) ) { match = null ; } } else { if ( ! ( expectedArg . equals ( suppliedArg ) ) ) { if ( suppliedArg . isAssignableTo ( expectedArg ) ) { if ( match != ( ReflectionHelper . ArgsMatchKind . REQUIRES_CONVERSION ) ) { match = ReflectionHelper . ArgsMatchKind . CLOSE ; } } else if ( typeConverter . canConvert ( suppliedArg , expectedArg ) ) { if ( argsRequiringConversion == null ) { argsRequiringConversion = new ArrayList < Integer > ( ) ; } argsRequiringConversion . add ( i ) ; match = ReflectionHelper . ArgsMatchKind . REQUIRES_CONVERSION ; } else { match = null ; } } } } if ( match == null ) { return null ; } if ( ( ( suppliedArgTypes . size ( ) ) == ( expectedArgTypes . size ( ) ) ) && ( expectedArgTypes . get ( ( ( expectedArgTypes . size ( ) ) - 1 ) ) . equals ( suppliedArgTypes . get ( ( ( suppliedArgTypes . size ( ) ) - 1 ) ) ) ) ) { } else { <START_BUG> Class varargsParameterType = expectedArgTypes . get ( ( ( expectedArgTypes . size ( ) ) - 1 ) ) . getElementType ( ) . getType ( ) ; <END_BUG> for ( int i = ( expectedArgTypes . size ( ) ) - 1 ; i < ( suppliedArgTypes . size ( ) ) ; i ++ ) { TypeDescriptor suppliedArg = suppliedArgTypes . get ( i ) ; if ( suppliedArg == null ) { if ( varargsParameterType . isPrimitive ( ) ) { match = null ; } } else { if ( varargsParameterType != ( suppliedArg . getType ( ) ) ) { if ( ClassUtils . isAssignable ( varargsParameterType , suppliedArg . getType ( ) ) ) { if ( match != ( ReflectionHelper . ArgsMatchKind . REQUIRES_CONVERSION ) ) { match = ReflectionHelper . ArgsMatchKind . CLOSE ; } } else if ( typeConverter . canConvert ( suppliedArg , TypeDescriptor . valueOf ( varargsParameterType ) ) ) { if ( argsRequiringConversion == null ) { argsRequiringConversion = new ArrayList < Integer > ( ) ; } argsRequiringConversion . add ( i ) ; match = ReflectionHelper . ArgsMatchKind . REQUIRES_CONVERSION ; } else { match = null ; } } } } } if ( match == null ) { return null ; } else { if ( match == ( ReflectionHelper . ArgsMatchKind . REQUIRES_CONVERSION ) ) { int [ ] argsArray = new int [ argsRequiringConversion . size ( ) ] ; for ( int i = 0 ; i < ( argsRequiringConversion . size ( ) ) ; i ++ ) { argsArray [ i ] = argsRequiringConversion . get ( i ) ; } return new ReflectionHelper . ArgumentsMatchInfo ( match , argsArray ) ; } else { return new ReflectionHelper . ArgumentsMatchInfo ( match ) ; } } } static void convertArguments ( TypeConverter converter , Object [ ] arguments , Object methodOrCtor , int [ ] argumentsRequiringConversion , Integer varargsPosition ) throws EvaluationException { } public static void convertAllArguments ( TypeConverter converter , Object [ ] arguments , Method method ) throws SpelEvaluationException { } public static Object [ ] setupArgumentsForVarargsInvocation ( Class [ ] requiredParameterTypes , Object ... args ) { } public static enum ArgsMatchKind { EXACT , CLOSE , REQUIRES_CONVERSION ; } public static class ArgumentsMatchInfo { public final ReflectionHelper . ArgsMatchKind kind ; public int [ ] argsRequiringConversion ; ArgumentsMatchInfo ( ReflectionHelper . ArgsMatchKind kind , int [ ] integers ) { } ArgumentsMatchInfo ( ReflectionHelper . ArgsMatchKind kind ) { } public boolean isExactMatch ( ) { } public boolean isCloseMatch ( ) { } public boolean isMatchRequiringConversion ( ) { } public String toString ( ) { } } }

Fix:
Class varargsParameterType = expectedArgTypes . get ( ( ( expectedArgTypes . size ( ) ) - 1 ) ) . getElementTypeDescriptor ( ) . getType ( ) ;