Buggy code:
public class UriTemplateServletAnnotationControllerTests { private DispatcherServlet servlet ; @ Test public void simple ( ) throws Exception { } @ Test public void multiple ( ) throws Exception { } @ Test public void binding ( ) throws Exception { } @ Test public void ambiguous ( ) throws Exception { } @ Test public void relative ( ) throws Exception { } @ Test public void extension ( ) throws Exception { } @ Test public void typeConversionError ( ) throws Exception { } @ Test public void explicitSubPath ( ) throws Exception { } @ Test public void implicitSubPath ( ) throws Exception { } @ Test public void crud ( ) throws Exception { } @ Test public void methodNotSupported ( ) throws Exception { } @ Test public void multiPaths ( ) throws Exception { } private void initServlet ( final Class < ? > controllerclass ) throws ServletException { } @ Test public void noDefaultSuffixPattern ( ) throws Exception { } @ Test public void customRegex ( ) throws Exception { } @ Controller public static class SimpleUriTemplateController { @ RequestMapping ( "//{root}" ) public void handle ( @ PathVariable ( "root" ) int root , Writer writer ) throws IOException { } } @ Controller public static class MultipleUriTemplateController { @ RequestMapping ( "//hotels//{hotel}//bookings//{booking}-{other}" ) public void handle ( @ PathVariable ( "hotel" ) String hotel , @ PathVariable int booking , @ PathVariable String other , Writer writer ) throws IOException { } } @ Controller public static class BindingUriTemplateController { @ InitBinder public void initBinder ( WebDataBinder binder , @ PathVariable ( "hotel" ) String hotel ) { } @ RequestMapping ( "//hotels//{hotel}//dates//{date}" ) public void handle ( @ PathVariable ( "hotel" ) String hotel , @ PathVariable Date date , Writer writer ) throws IOException { } } @ Controller public static class NonBindingUriTemplateController { @ RequestMapping ( "//hotels//{hotel}//dates//{date}" ) public void handle ( @ PathVariable ( "hotel" ) String hotel , @ PathVariable Date date , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "//hotels//{hotel}" ) public static class RelativePathUriTemplateController { @ RequestMapping ( "bookings//{booking}" ) public void handle ( @ PathVariable ( "hotel" ) String hotel , @ PathVariable int booking , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "//hotels" ) public static class AmbiguousUriTemplateController { @ RequestMapping ( "//{hotel}" ) public void handleVars ( @ PathVariable ( "hotel" ) String hotel , Writer writer ) throws IOException { } @ RequestMapping ( "//new" ) public void handleSpecific ( Writer writer ) throws IOException { } @ RequestMapping ( "//*" ) public void handleWildCard ( Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "//hotels//*" ) public static class ExplicitSubPathController { @ RequestMapping ( "{hotel}" ) public void handleHotel ( @ PathVariable String hotel , Writer writer ) throws IOException { writer . write ( ( "test-" + hotel ) ) ; } } @ Controller @ RequestMapping ( "hotels" ) public static class ImplicitSubPathController { <START_BUG> @ RequestMapping ( "{hotel:.*}" ) <END_BUG> public void handleHotel ( @ PathVariable String hotel , Writer writer ) throws IOException { writer . write ( ( "test-" + hotel ) ) ; } } @ Controller public static class CustomRegexController { @ RequestMapping ( "//{root:\\d+}" ) public void handle ( @ PathVariable ( "root" ) int root , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "hotels" ) public static class CrudController { @ RequestMapping ( method = RequestMethod . GET ) public void list ( Writer writer ) throws IOException { } @ RequestMapping ( method = RequestMethod . POST ) public void create ( Writer writer ) throws IOException { } @ RequestMapping ( value = "//{hotel}" , method = RequestMethod . GET ) public void show ( @ PathVariable String hotel , Writer writer ) throws IOException { } @ RequestMapping ( value = "{hotel}" , method = RequestMethod . PUT ) public void createOrUpdate ( @ PathVariable String hotel , Writer writer ) throws IOException { } @ RequestMapping ( value = "{hotel}" , method = RequestMethod . DELETE ) public void remove ( @ PathVariable String hotel , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "//hotels" ) public static class MethodNotAllowedController { @ RequestMapping ( method = RequestMethod . GET ) public void list ( Writer writer ) { } @ RequestMapping ( method = RequestMethod . GET , value = "{hotelId}" ) public void show ( @ PathVariable long hotelId , Writer writer ) { } @ RequestMapping ( method = RequestMethod . PUT , value = "{hotelId}" ) public void createOrUpdate ( @ PathVariable long hotelId , Writer writer ) { } @ RequestMapping ( method = RequestMethod . DELETE , value = "//{hotelId}" ) public void remove ( @ PathVariable long hotelId , Writer writer ) { } } @ Controller @ RequestMapping ( "//category" ) public static class MultiPathController { @ RequestMapping ( { "//{category}//page//{page}" , "//**//{category}//page//{page}" } ) public void category ( @ PathVariable String category , @ PathVariable int page , Writer writer ) throws IOException { } @ RequestMapping ( { "//{category}" , "//**//{category}" } ) public void category ( @ PathVariable String category , Writer writer ) throws IOException { } @ RequestMapping ( { "" } ) public void category ( Writer writer ) throws IOException { } @ RequestMapping ( { "//page//{page}" } ) public void category ( @ PathVariable int page , Writer writer ) throws IOException { } } }

Fix:
@ RequestMapping ( "{hotel}" )