Buggy code:
public class FormHttpMessageConverter implements HttpMessageConverter < MultiValueMap < String , ? > > { public static final Charset DEFAULT_CHARSET = Charset . forName ( "UTF-8" ) ; private static final byte [ ] BOUNDARY_CHARS = new byte [ ] { '-' , '_' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' , 'j' , 'k' , 'l' , 'm' , 'n' , 'o' , 'p' , 'q' , 'r' , 's' , 't' , 'u' , 'v' , 'w' , 'x' , 'y' , 'z' , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' , 'J' , 'K' , 'L' , 'M' , 'N' , 'O' , 'P' , 'Q' , 'R' , 'S' , 'T' , 'U' , 'V' , 'W' , 'X' , 'Y' , 'Z' } ; private Charset charset = FormHttpMessageConverter . DEFAULT_CHARSET ; private Charset multipartCharset ; private List < MediaType > supportedMediaTypes = new ArrayList < MediaType > ( ) ; private List < HttpMessageConverter < ? > > partConverters = new ArrayList < HttpMessageConverter < ? > > ( ) ; private final Random random = new Random ( ) ; public FormHttpMessageConverter ( ) { } public void setCharset ( Charset charset ) { } public void setMultipartCharset ( Charset multipartCharset ) { } public void setSupportedMediaTypes ( List < MediaType > supportedMediaTypes ) { } @ Override public List < MediaType > getSupportedMediaTypes ( ) { } public void setPartConverters ( List < HttpMessageConverter < ? > > partConverters ) { } public void addPartConverter ( HttpMessageConverter < ? > partConverter ) { } @ Override public boolean canRead ( Class < ? > clazz , MediaType mediaType ) { } @ Override public boolean canWrite ( Class < ? > clazz , MediaType mediaType ) { } @ Override public MultiValueMap < String , String > read ( Class < ? extends MultiValueMap < String , ? > > clazz , HttpInputMessage inputMessage ) throws IOException , HttpMessageNotReadableException { } @ Override @ SuppressWarnings ( "unchecked" ) public void write ( MultiValueMap < String , ? > map , MediaType contentType , HttpOutputMessage outputMessage ) throws IOException , HttpMessageNotWritableException { } private boolean isMultipart ( MultiValueMap < String , ? > map , MediaType contentType ) { if ( contentType != null ) { <START_BUG> return MULTIPART_FORM_DATA . equals ( contentType ) ; <END_BUG> } for ( String name : map . keySet ( ) ) { for ( Object value : map . get ( name ) ) { if ( ( value != null ) && ( ! ( value instanceof String ) ) ) { return true ; } } } return false ; } private void writeForm ( MultiValueMap < String , String > form , MediaType contentType , HttpOutputMessage outputMessage ) throws IOException { } private void writeMultipart ( MultiValueMap < String , Object > parts , HttpOutputMessage outputMessage ) throws IOException { } private void writeParts ( OutputStream os , MultiValueMap < String , Object > parts , byte [ ] boundary ) throws IOException { } @ SuppressWarnings ( "unchecked" ) private void writePart ( String name , HttpEntity < ? > partEntity , OutputStream os ) throws IOException { } protected byte [ ] generateMultipartBoundary ( ) { } protected HttpEntity < ? > getHttpEntity ( Object part ) { } protected String getFilename ( Object part ) { } private void writeBoundary ( OutputStream os , byte [ ] boundary ) throws IOException { } private static void writeEnd ( OutputStream os , byte [ ] boundary ) throws IOException { } private static void writeNewLine ( OutputStream os ) throws IOException { } private static class MultipartHttpOutputMessage implements HttpOutputMessage { private final OutputStream outputStream ; private final HttpHeaders headers = new HttpHeaders ( ) ; private boolean headersWritten = false ; public MultipartHttpOutputMessage ( OutputStream outputStream ) { } @ Override public HttpHeaders getHeaders ( ) { } @ Override public OutputStream getBody ( ) throws IOException { } private void writeHeaders ( ) throws IOException { } private byte [ ] getAsciiBytes ( String name ) { } } private static class MimeDelegate { public static String encode ( String value , String charset ) { } } }

Fix:
return MULTIPART_FORM_DATA . includes ( contentType ) ;