Buggy code:
public static final String ACCEPT_LANGUAGE = "Accept-Language" ; public static final String ACCEPT_RANGES = "Accept-Ranges" ; public static final String AGE = "Age" ; public static final String ALLOW = "Allow" ; public static final String AUTHORIZATION = "Authorization" ; public static final String CACHE_CONTROL = "Cache-Control" ; public static final String CONNECTION = "Connection" ; public static final String CONTENT_ENCODING = "Content-Encoding" ; public static final String CONTENT_DISPOSITION = "Content-Disposition" ; public static final String CONTENT_LANGUAGE = "Content-Language" ; public static final String CONTENT_LENGTH = "Content-Length" ; public static final String CONTENT_LOCATION = "Content-Location" ; public static final String CONTENT_RANGE = "Content-Range" ; public static final String CONTENT_TYPE = "Content-Type" ; public static final String COOKIE = "Cookie" ; public static final String DATE = "Date" ; public static final String ETAG = "ETag" ; public static final String EXPECT = "Expect" ; public static final String EXPIRES = "Expires" ; public static final String FROM = "From" ; public static final String HOST = "Host" ; public static final String IF_MATCH = "If-Match" ; public static final String IF_MODIFIED_SINCE = "If-Modified-Since" ; public static final String IF_NONE_MATCH = "If-None-Match" ; public static final String IF_RANGE = "If-Range" ; public static final String IF_UNMODIFIED_SINCE = "If-Unmodified-Since" ; public static final String LAST_MODIFIED = "Last-Modified" ; public static final String LINK = "Link" ; public static final String LOCATION = "Location" ; public static final String MAX_FORWARDS = "Max-Forwards" ; public static final String ORIGIN = "Origin" ; public static final String PRAGMA = "Pragma" ; public static final String PROXY_AUTHENTICATE = "Proxy-Authenticate" ; public static final String PROXY_AUTHORIZATION = "Proxy-Authorization" ; public static final String RANGE = "Range" ; public static final String REFERER = "Referer" ; public static final String RETRY_AFTER = "Retry-After" ; public static final String SERVER = "Server" ; public static final String SET_COOKIE = "Set-Cookie" ; public static final String SET_COOKIE2 = "Set-Cookie2" ; public static final String TE = "TE" ; public static final String TRAILER = "Trailer" ; public static final String TRANSFER_ENCODING = "Transfer-Encoding" ; public static final String UPGRADE = "Upgrade" ; public static final String USER_AGENT = "User-Agent" ; public static final String VARY = "Vary" ; public static final String VIA = "Via" ; public static final String WARNING = "Warning" ; public static final String WWW_AUTHENTICATE = "WWW-Authenticate" ; private static final String [ ] DATE_FORMATS = new String [ ] { "EEE,<seq2seq4repair_space>dd<seq2seq4repair_space>MMM<seq2seq4repair_space>yyyy<seq2seq4repair_space>HH:mm:ss<seq2seq4repair_space>zzz" , "EEE,<seq2seq4repair_space>dd-MMM-yy<seq2seq4repair_space>HH:mm:ss<seq2seq4repair_space>zzz" , "EEE<seq2seq4repair_space>MMM<seq2seq4repair_space>dd<seq2seq4repair_space>HH:mm:ss<seq2seq4repair_space>yyyy" } ; private static TimeZone GMT = TimeZone . getTimeZone ( "GMT" ) ; private final Map < String , List < String > > headers ; private HttpHeaders ( Map < String , List < String > > headers , boolean readOnly ) { } public HttpHeaders ( ) { } public static HttpHeaders readOnlyHttpHeaders ( HttpHeaders headers ) { } public void setAccept ( List < MediaType > acceptableMediaTypes ) { } public List < MediaType > getAccept ( ) { } public void setAcceptCharset ( List < Charset > acceptableCharsets ) { } public List < Charset > getAcceptCharset ( ) { } public void setAllow ( Set < HttpMethod > allowedMethods ) { } public Set < HttpMethod > getAllow ( ) { } public void setCacheControl ( String cacheControl ) { } public String getCacheControl ( ) { } public void setConnection ( String connection ) { } public void setConnection ( List < String > connection ) { } public List < String > getConnection ( ) { } public void setContentDispositionFormData ( String name , String filename ) { } public void setContentLength ( long contentLength ) { } public long getContentLength ( ) { } public void setContentType ( MediaType mediaType ) { } public MediaType getContentType ( ) { String value = getFirst ( HttpHeaders . CONTENT_TYPE ) ; <START_BUG> return value != null ? MediaType . parseMediaType ( value ) : null ; <END_BUG> } public void setDate ( long date ) { } public long getDate ( ) { } public void setETag ( String eTag ) { } public String getETag ( ) { } public void setExpires ( long expires ) { } public long getExpires ( ) { } public void setIfModifiedSince ( long ifModifiedSince ) { } @ Deprecated public long getIfNotModifiedSince ( ) { } public long getIfModifiedSince ( ) { } public void setIfNoneMatch ( String ifNoneMatch ) { } public void setIfNoneMatch ( List < String > ifNoneMatchList ) { } protected String toCommaDelimitedString ( List < String > list ) { } public List < String > getIfNoneMatch ( ) { } protected List < String > getFirstValueAsList ( String header ) { } public void setLastModified ( long lastModified ) { } public long getLastModified ( ) { } public void setLocation ( URI location ) { } public URI getLocation ( ) { } public void setOrigin ( String origin ) { } public String getOrigin ( ) { } public void setPragma ( String pragma ) { } public String getPragma ( ) { } public void setUpgrade ( String upgrade ) { } public String getUpgrade ( ) { } public long getFirstDate ( String headerName ) { } public void setDate ( String headerName , long date ) { } @ Override public String getFirst ( String headerName ) { } @ Override public void add ( String headerName , String headerValue ) { } @ Override public void set ( String headerName , String headerValue ) { } @ Override public void setAll ( Map < String , String > values ) { } @ Override public Map < String , String > toSingleValueMap ( ) { } @ Override public int size ( ) { } @ Override public boolean isEmpty ( ) { } @ Override public boolean containsKey ( Object key ) { } @ Override public boolean containsValue ( Object value ) { }

Fix:
return StringUtils . hasLength ( value ) ? MediaType . parseMediaType ( value ) : null ;