Buggy code:
@ Transactional @ RequestMapping ( value = "project" , method = RequestMethod . GET ) public String showDetails ( @ RequestParam ( "id" ) Long id , @ RequestParam ( value = "closed" , required = false ) String closed , Model model , RedirectAttributes ra ) { } @ RequestMapping ( value = "projectEvents" , method = RequestMethod . GET ) @ ResponseBody public Page < DisplayWorkLog > getProjectEvents ( @ RequestParam ( "id" ) Long id , @ PageableDefault ( size = 25 , page = 0 , sort = "time" , direction = Direction . DESC ) Pageable p ) { } @ RequestMapping ( value = "projects" , method = RequestMethod . GET ) public String listProjects ( Model model ) { } @ RequestMapping ( value = "project//activate" , method = RequestMethod . GET ) public String activate ( @ RequestParam ( "id" ) Long id , HttpServletRequest request , RedirectAttributes ra ) { } @ RequestMapping ( value = "project//create" , method = RequestMethod . GET ) public NewProjectForm startProjectcreate ( ) { } @ RequestMapping ( value = "project//create" , method = RequestMethod . POST ) public String createProject ( @ Valid @ ModelAttribute ( "newProjectForm" ) NewProjectForm newProjectForm , Errors errors , RedirectAttributes ra , HttpServletRequest request ) { } @ RequestMapping ( value = "project//manage" , method = RequestMethod . GET ) public String manageProject ( @ RequestParam ( "id" ) Long id , Model model , RedirectAttributes ra ) { } @ RequestMapping ( value = "project//useradd" , method = RequestMethod . POST ) public String addParticipant ( @ RequestParam ( "id" ) Long id , @ RequestParam ( "email" ) String email , RedirectAttributes ra , HttpServletRequest request ) { } @ Transactional @ RequestMapping ( value = "project//userRemove" , method = RequestMethod . POST ) public String removeParticipant ( @ RequestParam ( "project_id" ) Long projectId , @ RequestParam ( "account_id" ) Long accountId , RedirectAttributes ra , HttpServletRequest request ) { } @ Transactional @ RequestMapping ( value = "project//grantAdmin" , method = RequestMethod . POST ) public String grantAdmin ( @ RequestParam ( "project_id" ) Long projectId , @ RequestParam ( "account_id" ) Long accountId , RedirectAttributes ra , HttpServletRequest request ) { } @ Transactional @ RequestMapping ( value = "project//removeAdmin" , method = RequestMethod . POST ) public String removeAdmin ( @ RequestParam ( "project_id" ) Long projectId , @ RequestParam ( "account_id" ) Long accountId , RedirectAttributes ra , HttpServletRequest request ) { } @ RequestMapping ( value = "//project//getParticipants" , method = RequestMethod . GET ) @ ResponseBody public List < DisplayAccount > listParticipants ( @ RequestParam Long id , @ RequestParam String term , HttpServletResponse response ) { } @ RequestMapping ( value = "//project//getChart" , method = RequestMethod . GET ) @ ResponseBody public ProjectChart getProjectChart ( @ RequestParam Long id , HttpServletResponse response ) { response . setContentType ( "application//json" ) ; Project project = projSrv . findById ( id ) ; Map < String , Integer > created = new HashMap < String , Integer > ( ) ; Map < String , Integer > closed = new HashMap < String , Integer > ( ) ; ProjectChart result = new ProjectChart ( ) ; List < WorkLog > events = wrkLogSrv . findProjectCreateCloseEvents ( project ) ; for ( WorkLog workLog : events ) { <START_BUG> if ( ! ( workLog . getTask ( ) . isSubtask ( ) ) ) { <END_BUG> LocalDate date = new LocalDate ( workLog . getRawTime ( ) ) ; if ( CREATE . equals ( workLog . getType ( ) ) ) { Integer value = created . get ( date . toString ( ) ) ; if ( value == null ) { value = 0 ; } value ++ ; created . put ( date . toString ( ) , value ) ; } else if ( REOPEN . equals ( workLog . getType ( ) ) ) { Integer value = closed . get ( date . toString ( ) ) ; if ( value == null ) { value = 0 ; } value -- ; closed . put ( date . toString ( ) , value ) ; } else { Integer value = closed . get ( date . toString ( ) ) ; if ( value == null ) { value = 0 ; } value ++ ; closed . put ( date . toString ( ) , value ) ; } } } LocalDate start = new LocalDate ( events . get ( 0 ) . getRawTime ( ) ) ; LocalDate end = new LocalDate ( ) . plusDays ( 1 ) ; LocalDate counter = start ; Integer taskCreated = 0 ; Integer taskClosed = 0 ; while ( counter . isBefore ( end ) ) { Integer createValue = created . get ( counter . toString ( ) ) ; if ( createValue == null ) { createValue = 0 ; } taskCreated += createValue ; result . getCreated ( ) . put ( counter . toString ( ) , taskCreated ) ; Integer closeValue = closed . get ( counter . toString ( ) ) ; if ( closeValue == null ) { closeValue = 0 ; } taskClosed += closeValue ; result . getClosed ( ) . put ( counter . toString ( ) , taskClosed ) ; counter = counter . plusDays ( 1 ) ; } return result ; } @ RequestMapping ( value = "//project//getDefaultAssignee" , method = RequestMethod . GET ) @ ResponseBody public DisplayAccount getDefaultAssignee ( @ RequestParam Long id , HttpServletResponse response ) { } @ RequestMapping ( value = "//project//getDefaultTaskType" , method = RequestMethod . GET ) @ ResponseBody public TaskType getDefaultTaskType ( @ RequestParam Long id , HttpServletResponse response ) { } @ RequestMapping ( value = "//project//getDefaultTaskPriority" , method = RequestMethod . GET ) @ ResponseBody public TaskPriority getDefaultTaskPriority ( @ RequestParam Long id , HttpServletResponse response ) { } @ Transactional @ RequestMapping ( value = "project//{id}//update"

Fix:
if ( ( ( workLog . getTask ( ) ) != null ) && ( ! ( workLog . getTask ( ) . isSubtask ( ) ) ) ) {