Source:
public String show(final Model model, final HttpServletRequest request) { model.addAttribute("displayedRows", AngularSelectSheetController.ROW_COUNT_PER_SCREEN); final List<StudyDetails> previousStudies = this.getPreviousStudies(); for (final StudyDetails previousStudy : previousStudies) { if (!StringUtils.isEmpty(previousStudy.getStartDate())) { try { final Date date = AngularSelectSheetController.DB_FORMAT.parse(previousStudy.getStartDate()); previousStudy.setStartDate(AngularSelectSheetController.DATE_PICKER_FORMAT.format(date)); } catch (final ParseException e) { AngularSelectSheetController.LOG.error(e.getMessage(), e); } } if (!StringUtils.isEmpty(previousStudy.getEndDate())) { try { final Date date = AngularSelectSheetController.DB_FORMAT.parse(previousStudy.getEndDate()); previousStudy.setEndDate(AngularSelectSheetController.DATE_PICKER_FORMAT.format(date)); } catch (final ParseException e) { AngularSelectSheetController.LOG.error(e.getMessage(), e); } } } if ((this.userSelection.getStudyId() == null || this.userSelection.getStudyId() == 0 || this.userSelection.getStudyId() == AngularSelectSheetController.FIELDBOOK_DEFAULT_STUDY_ID) && !StringUtils .isEmpty(this.userSelection.getStudyName())) { this.createStudyDetails(previousStudies); } else { try { if (!this.populateStudyDetailsIfFieldbookFormat(previousStudies, model)) { final StudyDetails newStudy = new StudyDetails(); newStudy.setId(0); newStudy.setLabel(this.etlService.convertMessage(new Message(AngularSelectSheetController.ADD_TO_NEW_STUDY))); previousStudies.add(newStudy); } } catch (final IOException e) { AngularSelectSheetController.LOG.error(e.getMessage(), e); } } model.addAttribute("previousStudies", previousStudies); this.userSelection.clearMeasurementVariables(); return super.show(model); }

Target:
public String show(final Model model, final HttpServletRequest request) { model.addAttribute("displayedRows", AngularSelectSheetController.ROW_COUNT_PER_SCREEN); final List<StudyDetails> previousStudies = this.getPreviousStudies(); for (final StudyDetails previousStudy : previousStudies) { if (!StringUtils.isEmpty(previousStudy.getStartDate())) { try { final Date date = AngularSelectSheetController.DB_FORMAT.parse(previousStudy.getStartDate()); previousStudy.setStartDate(AngularSelectSheetController.DATE_PICKER_FORMAT.format(date)); } catch (final ParseException e) { AngularSelectSheetController.LOG.error(e.getMessage(), e); } } if (!StringUtils.isEmpty(previousStudy.getEndDate())) { try { final Date date = AngularSelectSheetController.DB_FORMAT.parse(previousStudy.getEndDate()); previousStudy.setEndDate(AngularSelectSheetController.DATE_PICKER_FORMAT.format(date)); } catch (final ParseException e) { AngularSelectSheetController.LOG.error(e.getMessage(), e); } } } if ((this.userSelection.getStudyId() == null || this.userSelection.getStudyId() == 0 || this.userSelection.getStudyId() == AngularSelectSheetController.FIELDBOOK_DEFAULT_STUDY_ID) && !StringUtils .isEmpty(this.userSelection.getStudyName())) { this.addStudyDetails(previousStudies); } else { try { if (!this.populateStudyDetailsIfFieldbookFormat(previousStudies, model)) { final StudyDetails newStudy = new StudyDetails(); newStudy.setId(0); newStudy.setLabel(this.etlService.convertMessage(new Message(AngularSelectSheetController.ADD_TO_NEW_STUDY))); previousStudies.add(newStudy); } } catch (final IOException e) { AngularSelectSheetController.LOG.error(e.getMessage(), e); } } model.addAttribute("previousStudies", previousStudies); this.userSelection.clearMeasurementVariables(); return super.show(model); }