Source:
public String confirmImport( final Model model, final org.generationcp.middleware.domain.etl.Workbook importData, final String programUUID) { final List<String> errors = new ArrayList<>(); try { final org.generationcp.middleware.domain.etl.Workbook referenceWorkbook = this.dataImportService .parseWorkbookDescriptionSheet( this.etlService.retrieveCurrentWorkbook(this.userSelection), this.contextUtil.getCurrentWorkbenchUserId()); importData.setConstants(referenceWorkbook.getConstants()); importData.setConditions(referenceWorkbook.getConditions()); this.dataImportService.addExptDesignVariableIfNotExists(importData, importData.getFactors(), programUUID); this.dataImportService.addLocationIDVariableIfNotExists(importData, importData.getFactors(), programUUID); this.dataImportService.addEntryTypeVariableIfNotExists(importData, importData.getFactors(), programUUID); this.dataImportService.assignLocationIdVariableToEnvironmentDetailSection(importData); this.dataImportService.removeLocationNameVariableIfExists(importData); this.dataImportService.populatePossibleValuesForCategoricalVariates(importData.getConditions(), programUUID); this.etlService.saveProjectData(importData, programUUID); } catch (final PhenotypeException e) { ImportObservationsController.LOG.error(e.getMessage(), e); errors.add(e.getMessage().replaceAll("\n", "<br>")); } catch (final Exception e) { ImportObservationsController.LOG.error(e.getMessage(), e); errors.add(e.getMessage()); } finally { model.addAttribute("errors", errors); this.hasErrors = !errors.isEmpty(); model.addAttribute("hasErrors", this.hasErrors); } return super.show(model); }

Target:
public String confirmImport( final Model model, final org.generationcp.middleware.domain.etl.Workbook importData, final String programUUID) { final List<String> errors = new ArrayList<>(); try { final org.generationcp.middleware.domain.etl.Workbook referenceWorkbook = this.dataImportService .parseWorkbookDescriptionSheet( this.etlService.retrieveCurrentWorkbook(this.userSelection), this.contextUtil.getCurrentWorkbenchUserId()); importData.setConstants(referenceWorkbook.getConstants()); importData.setConditions(referenceWorkbook.getConditions()); this.dataImportService.addExptDesignVariableIfNotExists(importData, importData.getFactors(), programUUID); this.dataImportService.addLocationIDVariableIfNotExists(importData, importData.getFactors(), programUUID); this.dataImportService.addEntryTypeVariableIfNotExists(importData, programUUID); this.dataImportService.assignLocationIdVariableToEnvironmentDetailSection(importData); this.dataImportService.removeLocationNameVariableIfExists(importData); this.dataImportService.populatePossibleValuesForCategoricalVariates(importData.getConditions(), programUUID); this.etlService.saveProjectData(importData, programUUID); } catch (final PhenotypeException e) { ImportObservationsController.LOG.error(e.getMessage(), e); errors.add(e.getMessage().replaceAll("\n", "<br>")); } catch (final Exception e) { ImportObservationsController.LOG.error(e.getMessage(), e); errors.add(e.getMessage()); } finally { model.addAttribute("errors", errors); this.hasErrors = !errors.isEmpty(); model.addAttribute("hasErrors", this.hasErrors); } return super.show(model); }