Buggy code:
public class RequestPartMethodArgumentResolver extends AbstractMessageConverterMethodArgumentResolver { public RequestPartMethodArgumentResolver ( List < HttpMessageConverter < ? > > messageConverters ) { } public boolean supportsParameter ( MethodParameter parameter ) { } public Object resolveArgument ( MethodParameter parameter , ModelAndViewContainer mavContainer , NativeWebRequest request , WebDataBinderFactory binderFactory ) throws Exception { HttpServletRequest servletRequest = request . getNativeRequest ( HttpServletRequest . class ) ; if ( ! ( isMultipartRequest ( servletRequest ) ) ) { throw new MultipartException ( "The<seq2seq4repair_space>current<seq2seq4repair_space>request<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>multipart<seq2seq4repair_space>request" ) ; } MultipartHttpServletRequest multipartRequest = WebUtils . getNativeRequest ( servletRequest , MultipartHttpServletRequest . class ) ; String partName = getPartName ( parameter ) ; Object arg ; if ( MultipartFile . class . equals ( parameter . getParameterType ( ) ) ) { Assert . notNull ( multipartRequest , "Expected<seq2seq4repair_space>MultipartHttpServletRequest:<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>MultipartResolver<seq2seq4repair_space>configured?" ) ; arg = multipartRequest . getFile ( partName ) ; } else if ( isMultipartFileCollection ( parameter ) ) { Assert . notNull ( multipartRequest , "Expected<seq2seq4repair_space>MultipartHttpServletRequest:<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>MultipartResolver<seq2seq4repair_space>configured?" ) ; arg = multipartRequest . getFiles ( partName ) ; } else if ( "javax.servlet.http.Part" . equals ( parameter . getParameterType ( ) . getName ( ) ) ) { arg = servletRequest . getPart ( partName ) ; } else { try { HttpInputMessage inputMessage = new org . springframework . web . multipart . support . RequestPartServletServerHttpRequest ( servletRequest , partName ) ; arg = readWithMessageConverters ( inputMessage , parameter , parameter . getParameterType ( ) ) ; if ( arg != null ) { Annotation [ ] annotations = parameter . getParameterAnnotations ( ) ; for ( Annotation annot : annotations ) { <START_BUG> if ( "Valid" . equals ( annot . annotationType ( ) . getSimpleName ( ) ) ) { <END_BUG> WebDataBinder binder = binderFactory . createBinder ( request , arg , partName ) ; Object hints = AnnotationUtils . getValue ( annot ) ; binder . validate ( ( hints instanceof Object [ ] ? ( ( Object [ ] ) ( hints ) ) : new Object [ ] { hints } ) ) ; BindingResult bindingResult = binder . getBindingResult ( ) ; if ( bindingResult . hasErrors ( ) ) { throw new org . springframework . web . method . annotation . support . MethodArgumentNotValidException ( parameter , bindingResult ) ; } } } } } catch ( MissingServletRequestPartException ex ) { arg = null ; } } RequestPart annot = parameter . getParameterAnnotation ( RequestPart . class ) ; boolean isRequired = ( annot == null ) || ( annot . required ( ) ) ; if ( ( arg == null ) && isRequired ) { throw new MissingServletRequestPartException ( partName ) ; } return arg ; } private boolean isMultipartRequest ( HttpServletRequest request ) { } private String getPartName ( MethodParameter parameter ) { } private boolean isMultipartFileCollection ( MethodParameter parameter ) { } }

Fix:
if ( annot . annotationType ( ) . getSimpleName ( ) . startsWith ( "Valid" ) ) {