Buggy code:
public class RequestMappingInfoHandlerMappingTests { private RequestMappingInfoHandlerMappingTests . TestRequestMappingInfoHandlerMapping mapping ; private RequestMappingInfoHandlerMappingTests . Handler handler ; private HandlerMethod fooMethod ; private HandlerMethod fooParamMethod ; private HandlerMethod barMethod ; private HandlerMethod emptyMethod ; @ Before public void setUp ( ) throws Exception { } @ Test public void getMappingPathPatterns ( ) throws Exception { } @ Test public void directMatch ( ) throws Exception { } @ Test public void globMatch ( ) throws Exception { } @ Test public void emptyPathMatch ( ) throws Exception { } @ Test public void bestMatch ( ) throws Exception { } @ Test public void requestMethodNotAllowed ( ) throws Exception { } @ Test public void mediaTypeNotSupported ( ) throws Exception { } private void testMediaTypeNotSupported ( String url ) throws Exception { } @ Test public void mediaTypeNotAccepted ( ) throws Exception { } private void testMediaTypeNotAccepted ( String url ) throws Exception { } @ Test public void uriTemplateVariables ( ) { } @ Test public void bestMatchingPatternAttribute ( ) { } @ Test public void bestMatchingPatternAttributeNoPatternsDefined ( ) { } @ Test public void producibleMediaTypesAttribute ( ) throws Exception { } @ Test public void mappedInterceptors ( ) throws Exception { } @ SuppressWarnings ( "unused" ) @ Controller private static class Handler { @ RequestMapping ( value = "//foo" , method = RequestMethod . GET ) public void foo ( ) { } @ RequestMapping ( value = "//foo" , method = RequestMethod . GET , params = "p" ) public void fooParam ( ) { } @ RequestMapping ( value = "//ba*" , method = { RequestMethod . GET , RequestMethod . HEAD } ) public void bar ( ) { } @ RequestMapping ( "" ) public void empty ( ) { } @ RequestMapping ( value = "//person//{id}" , method = RequestMethod . PUT , consumes = "application//xml" ) public void consumes ( @ RequestBody String text ) { } @ RequestMapping ( value = "//persons" , produces = "application//xml" ) public String produces ( ) { } @ RequestMapping ( value = "//content" , produces = "application//xml" ) public String xmlContent ( ) { } @ RequestMapping ( value = "//content" , produces = "!application//xml" ) public String nonXmlContent ( ) { } } private static class TestRequestMappingInfoHandlerMapping extends RequestMappingInfoHandlerMapping { public void registerHandler ( Object handler ) { } @ Override protected boolean isHandler ( Class < ? > beanType ) { } @ Override protected RequestMappingInfo getMappingForMethod ( Method method , Class < ? > handlerType ) { RequestMapping annotation = AnnotationUtils . findAnnotation ( method , RequestMapping . class ) ; if ( annotation != null ) { <START_BUG> return new RequestMappingInfo ( new org . springframework . web . servlet . mvc . condition . PatternsRequestCondition ( annotation . value ( ) , getUrlPathHelper ( ) , getPathMatcher ( ) , true ) , new org . springframework . web . servlet . mvc . condition . RequestMethodsRequestCondition ( annotation . method ( ) ) , new org . springframework . web . servlet . mvc . condition . ParamsRequestCondition ( annotation . params ( ) ) , new org . springframework . web . servlet . mvc . condition . HeadersRequestCondition ( annotation . headers ( ) ) , new org . springframework . web . servlet . mvc . condition . ConsumesRequestCondition ( annotation . consumes ( ) , annotation . headers ( ) ) , new org . springframework . web . servlet . mvc . condition . ProducesRequestCondition ( annotation . produces ( ) , annotation . headers ( ) ) , null ) ; <END_BUG> } else { return null ; } } } }

Fix:
return new RequestMappingInfo ( new org . springframework . web . servlet . mvc . condition . PatternsRequestCondition ( annotation . value ( ) , getUrlPathHelper ( ) , getPathMatcher ( ) , true , true ) , new org . springframework . web . servlet . mvc . condition . RequestMethodsRequestCondition ( annotation . method ( ) ) , new org . springframework . web . servlet . mvc . condition . ParamsRequestCondition ( annotation . params ( ) ) , new org . springframework . web . servlet . mvc . condition . HeadersRequestCondition ( annotation . headers ( ) ) , new org . springframework . web . servlet . mvc . condition . ConsumesRequestCondition ( annotation . consumes ( ) , annotation . headers ( ) ) , new org . springframework . web . servlet . mvc . condition . ProducesRequestCondition ( annotation . produces ( ) , annotation . headers ( ) ) , null ) ;