Buggy code:
@ Controller public class JobController { @ Autowired private WebApplicationContext context ; @ RequestMapping ( "//job//{job_identifier:[a-z]+}-{level:[1-9][0-9]*}" ) public String job ( HttpServletResponse response , @ PathVariable ( "job_identifier" ) String jobIdentifier , @ PathVariable ( "level" ) int level , ModelMap model ) throws IOException { String bean = "job_" + jobIdentifier ; if ( ! ( context . containsBean ( bean ) ) ) { response . sendError ( SC_NOT_FOUND , ( ( "No<seq2seq4repair_space>job<seq2seq4repair_space>'" + jobIdentifier ) + "'" ) ) ; } ArrayList < Integer > levels = ( ( ArrayList < Integer > ) ( context . getBean ( "levels" ) ) ) ; <START_BUG> if ( ( level < 1 ) || ( level > ( levels . size ( ) ) ) ) { <END_BUG> response . sendError ( SC_NOT_FOUND , ( ( "No<seq2seq4repair_space>level<seq2seq4repair_space>'" + level ) + "'<seq2seq4repair_space>entry<seq2seq4repair_space>found" ) ) ; } int maxSP = levels . get ( level ) ; LinkedList < Job > jobList = new LinkedList < Job > ( ) ; HashSet < String > images = new HashSet < String > ( ) ; try { Job job = ( ( Job ) ( context . getBean ( bean ) ) ) ; float [ ] spRatios = job . getSpRatio ( ) ; for ( int i = ( spRatios . length ) - 1 ; job != null ; i -- ) { job . setMaxSP ( ( ( int ) ( maxSP * ( spRatios [ i ] ) ) ) ) ; jobList . addFirst ( job ) ; for ( int j = 0 ; j < ( job . getImages ( ) . length ) ; j ++ ) { images . add ( job . getImages ( ) [ j ] ) ; images . add ( ( ( job . getImages ( ) [ j ] ) + "_b" ) ) ; } job = job . getParent ( ) ; } } catch ( Exception e ) { response . sendError ( SC_NOT_FOUND , e . getMessage ( ) ) ; } if ( ( jobList . size ( ) ) != 3 ) { response . sendError ( SC_FORBIDDEN , ( ( jobList . getLast ( ) . getName ( ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>allowed<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>simulatled." ) ) ; } model . addAttribute ( "jobs" , jobList ) ; model . addAttribute ( "max_sp" , maxSP ) ; model . addAttribute ( "job0" , context . getBean ( "all_jobs_0" ) ) ; model . addAttribute ( "job1" , context . getBean ( "all_jobs_1" ) ) ; model . addAttribute ( "job2" , context . getBean ( "all_jobs_2" ) ) ; model . addAttribute ( "images" , new ArrayList < String > ( images ) ) ; if ( level == ( ( levels . size ( ) ) - 1 ) ) { model . addAttribute ( "path" , ( "//job//" + ( jobList . getLast ( ) . getIdentifier ( ) ) ) ) ; } else { model . addAttribute ( "path" , ( ( ( "//job//" + ( jobList . getLast ( ) . getIdentifier ( ) ) ) + "-" ) + level ) ) ; } int [ ] levelList = new int [ ] { Math . min ( ( ( levels . size ( ) ) - 1 ) , level ) , Math . min ( ( ( levels . size ( ) ) - 11 ) , level ) , Math . min ( ( ( levels . size ( ) ) - 1 ) , level ) } ; model . addAttribute ( "levels" , levelList ) ; return "home" ; } @ RequestMapping ( "//job//{job_identifier:[a-z]+}" ) public String job ( HttpServletResponse response , @ PathVariable ( "job_identifier" ) String jobIdentifier , ModelMap model ) throws IOException { } @ RequestMapping ( "//" ) public String job ( HttpServletResponse response , ModelMap model ) throws IOException { } No newline ; at end ; of file ; }

Fix:
if ( ( level < 1 ) || ( level > ( ( levels . size ( ) ) - 1 ) ) ) {