Buggy code:
@ RestController @ RequestMapping ( "//service//projects" ) public class ProjectRestController { @ Autowired private PersonDao personDao ; @ Autowired private DepartmentDao departmentDao ; @ Autowired private ProjectDepartmentSessionDao projectDepartmentSessionDao ; @ Autowired private VolunteersToConfirmModelFactory volunteersToConfirmModelFactory ; @ Autowired private ProjectAvailabilityDao projectAvailabilityDao ; @ Autowired private ProjectAttendanceDao projectAttendanceDao ; @ Autowired private VolunteerForProjectModelFactory volunteerForProjectModelFactory ; @ Autowired private ProjectGateListModelFactory projectGateListModelFactory ; @ RequestMapping ( value = "//sessions//{sessionId}//person//{personId}//availability" , method = RequestMethod . POST ) @ ResponseStatus ( HttpStatus . OK ) @ PreAuthorize ( "hasPermission('PROJECT',<seq2seq4repair_space>'EDIT')" ) public void insertAvailabilityForVolunteer ( @ PathVariable Integer sessionId , @ PathVariable Integer personId ) throws BadRequestException { } @ RequestMapping ( value = "//sessions//{sessionId}//person//{personId}//availability" , method = RequestMethod . DELETE ) @ ResponseStatus ( HttpStatus . OK ) @ PreAuthorize ( "hasPermission('PROJECT',<seq2seq4repair_space>'EDIT')" ) public void deleteAvailabilityForVolunteer ( @ PathVariable Integer sessionId , @ PathVariable Integer personId ) throws BadRequestException { } @ RequestMapping ( value = "//session//{sessionId}//dates" , method = RequestMethod . GET ) @ PreAuthorize ( "hasPermission('PROJECT',<seq2seq4repair_space>'READ')" ) public ResponseEntity < Object > getSessionDates ( @ PathVariable Integer sessionId ) throws BadRequestException { } @ RequestMapping ( value = "//department//volunteers//session//{sessionId}" , method = RequestMethod . GET ) @ PreAuthorize ( "hasPermission('PROJECT',<seq2seq4repair_space>'READ')" ) public ResponseEntity < Object > findDepartmentVolunteers ( @ PathVariable Integer sessionId ) throws BadRequestException { } @ RequestMapping ( value = "//session//{sessionId}//volunteers" , method = RequestMethod . GET ) @ PreAuthorize ( "hasPermission('PROJECT',<seq2seq4repair_space>'READ')" ) public ResponseEntity < Object > getVolunteersToConfirm ( @ PathVariable Integer sessionId ) throws BadRequestException { } @ RequestMapping ( value = "//attendance//{attendanceId}" , method = RequestMethod . PUT ) @ ResponseStatus ( HttpStatus . OK ) @ PreAuthorize ( "hasPermission('PROJECT',<seq2seq4repair_space>'EDIT')" ) public void inviteVolunteer ( @ PathVariable Integer attendanceId , @ RequestBody ProjectAttendanceModel requiredDate ) throws BadRequestException { } @ RequestMapping ( value = "//project-gatelist//{projectId}//date//{projectDate}" , method = RequestMethod . GET ) @ PreAuthorize ( "hasPermission('PROJECT',<seq2seq4repair_space>'READ')" ) public ResponseEntity < Object > getGateListByDate ( @ PathVariable Integer projectId , @ PathVariable String projectDate ) throws ParseException { } @ RequestMapping ( value = "//project-gatelist//{projectId}//date//{projectDate}//summary" , method = RequestMethod . GET ) @ PreAuthorize ( "hasPermission('PROJECT',<seq2seq4repair_space>'READ')" ) public ResponseEntity < Object > getGateListSummaryByDate ( @ PathVariable Integer projectId , @ PathVariable String projectDate ) throws ParseException { } private List < String > generateDateRange ( DateTime startDate , DateTime endDate ) { List < String > range = new ArrayList < > ( ) ; DateTime tmpdate ; tmpdate = startDate ; FastDateFormat formatter = FastDateFormat . getInstance ( "dd-MM-yyyy" ) ; <START_BUG> while ( ( tmpdate . isBefore ( endDate ) ) || ( tmpdate . equals ( endDate ) ) ) { <END_BUG> range . add ( formatter . format ( tmpdate . toDate ( ) ) ) ; tmpdate = tmpdate . plusDays ( 1 ) ; } return range ; } private Integer findUserId ( ) { } @ ExceptionHandler ( { BadRequestException . class , ParseException . class } ) @ ResponseStatus ( HttpStatus . BAD_REQUEST ) public void handleExceptions ( Exception e ) { } }

Fix:
while ( ! ( tmpdate . isAfter ( endDate ) ) ) {