Buggy code:
public class ReservationAction extends ActionDispatcher < Reservation > { public static final String FIELD_BEGIN_NAME = "begin" ; public static final String FIELD_END_NAME = "end" ; public static final String FIELD_RESERVED_NAME = "reserved" ; public static final String FIELD_RESERVER_NAME = "reserver" ; public static final String FIELD_RESERVED_TYPE_NAME = "resourceType" ; private static final String REQUEST_ATTR_RESOURCETYPES_NAME = "resourceTypes" ; private static final String REQUEST_ATTR_SELECTED_RESOURCETYPE_NAME = "resourceType" ; private static final String REQUEST_ATTR_RESOURCES_NAME = "resources" ; private static final String DATE_EXPECTED_FORMAT = "dd//MM//yyyy" ; private final SimpleDateFormat formatter = new SimpleDateFormat ( ReservationAction . DATE_EXPECTED_FORMAT ) ; private ResourceTypeCrud typeCrud ; private ResourceCrud resourceCrud ; private UserCrud userCrud ; public ReservationAction ( ) { } @ Override protected String getEntityPageTitle ( ) { } @ Override protected String getEntityFolderName ( ) { } @ Override protected void createEntity ( HttpServletRequest req , HttpServletResponse resp ) { } @ Override protected void editEntity ( HttpServletRequest req , HttpServletResponse resp ) { } @ Override protected void getAll ( HttpServletRequest req , HttpServletResponse resp ) { } @ Override protected Map < String , Object > getFilters ( HttpServletRequest req ) { } @ Override protected Reservation createEntityModel ( ) { } @ Override protected Reservation mapEntity ( Reservation model , HttpServletRequest req ) { } @ Override protected void validateFields ( HttpServletRequest req ) throws BeanValidationError { int reserverId = Integer . parseInt ( req . getParameter ( ReservationAction . FIELD_RESERVER_NAME ) ) ; if ( ( userCrud . find ( reserverId ) ) == null ) { throw new BeanValidationError ( "Utilisateur<seq2seq4repair_space>invalide" ) ; } int reservedId = Integer . parseInt ( req . getParameter ( ReservationAction . FIELD_RESERVED_NAME ) ) ; Resource resource = resourceCrud . find ( reservedId ) ; if ( resource == null ) { throw new BeanValidationError ( "Ressource<seq2seq4repair_space>invalide" ) ; } String begin = req . getParameter ( ReservationAction . FIELD_BEGIN_NAME ) ; if ( ! ( isFieldValid ( begin ) ) ) { throw new BeanValidationError ( "Date<seq2seq4repair_space>de<seq2seq4repair_space>début<seq2seq4repair_space>invalide" ) ; } String end = req . getParameter ( ReservationAction . FIELD_END_NAME ) ; if ( ! ( isFieldValid ( end ) ) ) { throw new BeanValidationError ( "Date<seq2seq4repair_space>de<seq2seq4repair_space>fin<seq2seq4repair_space>invalide" ) ; } Date endDate ; Date beginDate ; try { endDate = formatter . parse ( end ) ; beginDate = formatter . parse ( begin ) ; if ( ( beginDate . compareTo ( endDate ) ) > 0 ) { throw new BeanValidationError ( "La<seq2seq4repair_space>date<seq2seq4repair_space>de<seq2seq4repair_space>fin<seq2seq4repair_space>est<seq2seq4repair_space>antérieure<seq2seq4repair_space>à<seq2seq4repair_space>la<seq2seq4repair_space>date<seq2seq4repair_space>de<seq2seq4repair_space>début" ) ; } } catch ( ParseException e ) { throw new BeanValidationError ( "Erreur<seq2seq4repair_space>de<seq2seq4repair_space>convertion<seq2seq4repair_space>des<seq2seq4repair_space>dates." ) ; } boolean isFree ; <START_BUG> if ( req . getParameter ( "id" ) . isEmpty ( ) ) { <END_BUG> isFree = ( ( ReservationCrud ) ( this . crud ) ) . isFree ( beginDate , endDate , resource ) ; } else { isFree = ( ( ReservationCrud ) ( this . crud ) ) . isFree ( beginDate , endDate , resource , this . getId ( req ) ) ; } if ( ! isFree ) { throw new BeanValidationError ( ( ( ( ( ( ( "La<seq2seq4repair_space>ressource<seq2seq4repair_space>" + ( resource . getName ( ) ) ) + "<seq2seq4repair_space>est<seq2seq4repair_space>déjà<seq2seq4repair_space>réservée<seq2seq4repair_space>pour<seq2seq4repair_space>la<seq2seq4repair_space>période<seq2seq4repair_space>du<seq2seq4repair_space>" ) + begin ) + "<seq2seq4repair_space>au<seq2seq4repair_space>" ) + end ) + "." ) ) ; } } private void createEntityStepOne ( HttpServletRequest req , HttpServletResponse resp ) { } private void creatEntityStepTwo ( HttpServletRequest req , HttpServletResponse resp ) { } private void editEntity ( HttpServletRequest req , ResourceType type ) { } private Date readDate ( String date ) throws ParseException { } No newline ; at end ; of file ; }

Fix:
if ( ( req . getParameter ( "id" ) ) == null ) {