Source:
<code>public ResponseEntity saveOrUpdate(@RequestParam Long applicationId, @Valid @RequestBody StateHistoryViewRepresentation stateHistoryViewRepresentation, BindingResult bindingResult, Locale locale) { StateHistoryDTO stateHistoryDTO = null; if (bindingResult.hasErrors()) { return fieldErrorResponseComposer.composeResponse(bindingResult); } else { stateHistoryDTO = StateHistoryDTO.builder() .id(stateHistoryViewRepresentation.getId()) .candidateId(stateHistoryViewRepresentation.getCandidateId()) .description(stateHistoryViewRepresentation.getDescription()) .result(stateHistoryViewRepresentation.getResult()) .offeredMoney(stateHistoryViewRepresentation.getOfferedMoney()) .claim(stateHistoryViewRepresentation.getClaim()) .feedbackDate(stateHistoryViewRepresentation.getFeedbackDate() != null <START> ? stateHistoryViewRepresentation.getFeedbackDate() : null) <END> .dayOfStart(stateHistoryViewRepresentation.getDayOfStart()) .dateOfEnter(stateHistoryViewRepresentation.getDateOfEnter()) .creationDate(null) .stateDTO(StateDTO.builder().id(stateHistoryViewRepresentation.getStateId()) .name(stateHistoryViewRepresentation.getStateName()).build()) .recommendation(stateHistoryViewRepresentation.getRecommendation() != null ? stateHistoryViewRepresentation.getRecommendation() == 1 : null) .reviewerName(stateHistoryViewRepresentation.getReviewerName()) .recommendedPositionLevel(stateHistoryViewRepresentation.getRecommendedPositionLevel()) .build(); } statesHistoryService.saveStateHistory(stateHistoryDTO, applicationId); return new ResponseEntity<>(Collections.singletonMap("applicationId", applicationId), HttpStatus.OK); }</code><technical_language>I do understand is this expression is necessary. If simply stateHistoryViewRepresentation.getFeedbackDate(), null set if feedback date is null</technical_language>

Target:
public ResponseEntity saveOrUpdate(@RequestParam Long applicationId, @Valid @RequestBody StateHistoryViewRepresentation stateHistoryViewRepresentation, BindingResult bindingResult, Locale locale) { StateHistoryDTO stateHistoryDTO; String stateName = stateHistoryViewRepresentation.getStateName(); if (isNewState(stateName)) { validateNewState(stateHistoryViewRepresentation, bindingResult); } if (bindingResult.hasErrors()) { return fieldErrorResponseComposer.composeResponse(bindingResult); } else { stateHistoryDTO = StateHistoryDTO.builder() .id(stateHistoryViewRepresentation.getId()) .applicationDTO(applicationsService.getApplicationDtoById(applicationId)) .candidateId(stateHistoryViewRepresentation.getCandidateId()) .description(stateHistoryViewRepresentation.getDescription()) .result(stateHistoryViewRepresentation.getResult()) .offeredMoney(stateHistoryViewRepresentation.getOfferedMoney()) .claim(stateHistoryViewRepresentation.getClaim()) .feedbackDate(stateHistoryViewRepresentation.getFeedbackDate()) .dayOfStart(stateHistoryViewRepresentation.getDayOfStart()) .dateOfEnter(stateHistoryViewRepresentation.getDateOfEnter()) .creationDate(null) .stateDTO(StateDTO.builder().id(stateHistoryViewRepresentation.getStateId()) .name(stateHistoryViewRepresentation.getStateName()).build()) .recommendation(stateHistoryViewRepresentation.getRecommendation() != null ? stateHistoryViewRepresentation.getRecommendation() == 1 : null) .reviewerName(stateHistoryViewRepresentation.getReviewerName()) .recommendedPositionLevel(stateHistoryViewRepresentation.getRecommendedPositionLevel()) .build(); if (isNewState(stateName)) { ChannelDTO channelDTO = channelService.getChannelDtoByName(stateHistoryViewRepresentation.getChannelName()); PositionDTO positionDTO = positionService.getPositionDtoByName(stateHistoryViewRepresentation.getPositionName()); stateHistoryDTO.getApplicationDTO().setChannelId(channelDTO.getId()); stateHistoryDTO.getApplicationDTO().setPositionId(positionDTO.getId()); stateHistoryDTO.setChannel(channelDTO); stateHistoryDTO.setPosition(positionDTO); } statesHistoryService.saveStateHistory(stateHistoryDTO); return new ResponseEntity<>(Collections.singletonMap("applicationId", applicationId), HttpStatus.OK); } }