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 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 ( ) { } } private static class TestRequestMappingInfoHandlerMapping extends RequestMappingInfoHandlerMapping { @ Override protected boolean isHandler ( Class < ? > beanType ) { } @ Override protected RequestMappingInfo getMappingForMethod ( Method method , Class < ? > handlerType ) { RequestMapping annotation = AnnotationUtils . findAnnotation ( method , RequestMapping . class ) ; <START_BUG> return new RequestMappingInfo ( new org . springframework . web . servlet . mvc . condition . PatternsRequestCondition ( annotation . value ( ) , getUrlPathHelper ( ) , getPathMatcher ( ) ) , 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> } } }

Fix:
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 ) ;