Buggy code:
@ Controller @ RequestMapping ( "add_train" ) public class AddTrainController { private static final Logger LOG = Logger . getLogger ( AddTrainController . class ) ; private static final String GET_ALL_TRAIN_PARAM = "getAllTrain" ; private static final String TRAIN_NUMBER_PARAM = "trainNumber" ; private static final String TRAIN_SEATS_PARAM = "trainSeats" ; private static final String ADD_TRAIN_ANYWAY_PARAM = "addTrainAnyway" ; private static final String ALL_TRAIN_LIST_ATTR = "allTrainList" ; private static final String INVALID_INPUT_DATA_ATTR = "invalidInputDataError" ; private static final String EXIST_TRAIN_WARNING_ATTR = "existTrainWarning" ; private static final String EXIST_TRAIN_NUMBER_ATTR = "existTrainNumber" ; private static final String EXIST_TRAIN_SEATS_ATTR = "existTrainSeats" ; @ Autowired private TrainService trainService ; @ RequestMapping ( method = RequestMethod . GET ) public String get ( HttpServletRequest request , HttpSession session ) { } @ RequestMapping ( method = RequestMethod . POST ) public String post ( @ RequestParam ( AddTrainController . TRAIN_NUMBER_PARAM ) String trainNumberStr , @ RequestParam ( AddTrainController . TRAIN_SEATS_PARAM ) <START_BUG> String trainSeatsStr , @ RequestParam ( AddTrainController . ADD_TRAIN_ANYWAY_PARAM ) <END_BUG> Boolean addTrainAnyway , HttpSession session ) { boolean allTrainListExist = ( session . getAttribute ( AddTrainController . ALL_TRAIN_LIST_ATTR ) ) != null ; if ( ( isValidTrainNumber ( trainNumberStr ) ) && ( isValidTrainSeats ( trainSeatsStr ) ) ) { try { int trainNumber = Integer . valueOf ( trainNumberStr ) ; int trainSeats = Integer . valueOf ( trainSeatsStr ) ; trainService . addTrain ( trainNumber , trainSeats , addTrainAnyway ) ; if ( allTrainListExist ) { session . setAttribute ( AddTrainController . ALL_TRAIN_LIST_ATTR , trainService . getAll ( ) ) ; } } catch ( TrainWithSuchNumberExistException e ) { session . setAttribute ( AddTrainController . EXIST_TRAIN_WARNING_ATTR , true ) ; session . setAttribute ( AddTrainController . EXIST_TRAIN_NUMBER_ATTR , trainNumberStr ) ; session . setAttribute ( AddTrainController . EXIST_TRAIN_SEATS_ATTR , trainSeatsStr ) ; AddTrainController . LOG . warn ( ( ( ( "Train<seq2seq4repair_space>with<seq2seq4repair_space>such<seq2seq4repair_space>number<seq2seq4repair_space>already<seq2seq4repair_space>exist." + ( AddTrainController . TRAIN_NUMBER_PARAM ) ) + ":" ) + trainNumberStr ) , e ) ; } catch ( NumberFormatException e ) { session . setAttribute ( AddTrainController . INVALID_INPUT_DATA_ATTR , true ) ; StringBuilder msg = new StringBuilder ( ) ; msg . append ( "Invalid<seq2seq4repair_space>input<seq2seq4repair_space>data:<seq2seq4repair_space>" ) . append ( AddTrainController . TRAIN_NUMBER_PARAM ) . append ( "<seq2seq4repair_space>:<seq2seq4repair_space>" ) . append ( trainNumberStr ) . append ( ",<seq2seq4repair_space>" ) . append ( AddTrainController . TRAIN_SEATS_PARAM ) . append ( "<seq2seq4repair_space>:<seq2seq4repair_space>" ) . append ( trainSeatsStr ) ; AddTrainController . LOG . warn ( msg , e ) ; } } else { session . setAttribute ( AddTrainController . INVALID_INPUT_DATA_ATTR , true ) ; StringBuilder msg = new StringBuilder ( ) ; msg . append ( "Invalid<seq2seq4repair_space>input<seq2seq4repair_space>data:<seq2seq4repair_space>" ) . append ( AddTrainController . TRAIN_NUMBER_PARAM ) . append ( "<seq2seq4repair_space>:<seq2seq4repair_space>" ) . append ( trainNumberStr ) . append ( ",<seq2seq4repair_space>" ) . append ( AddTrainController . TRAIN_SEATS_PARAM ) . append ( "<seq2seq4repair_space>:<seq2seq4repair_space>" ) . append ( trainSeatsStr ) ; AddTrainController . LOG . warn ( msg ) ; } return "employee_page" ; } }

Fix:
String trainSeatsStr , @ RequestParam ( value = AddTrainController . ADD_TRAIN_ANYWAY_PARAM , defaultValue = "false" )