Source:
<code>public List<Map<String, Object>> executeFix() throws DotDataException, DotRuntimeException { List<Map<String, Object>> returnValue = new ArrayList<Map<String, Object>>(); Logger.info(FixTask00085FixEmptyParentPathOnIdentifier.class, "Beginning FixTask00085FixEmptyParentPathOnIdentifier"); if (!FixAssetsProcessStatus.getRunning()) { FixAssetsProcessStatus.startProgress(); FixAssetsProcessStatus .setDescription("Task 85: Updating Empty Parent Path in Identifiers"); FixAssetsProcessStatus.setTotal(total); try { HibernateUtil.startTransaction(); DotConnect dc = new DotConnect(); dc.setSQL( "update identifier set parent_path = '/' where parent_path is null or parent_path = ''"); <START> try { <END> dc.loadResult(); } catch (DotDataException e) { Logger.error(this, e.getMessage(), e); } FixAssetsProcessStatus.setErrorsFixed(total); FixAudit Audit = new FixAudit(); Audit.setTableName("identifier"); Audit.setDatetime(new Date()); Audit.setRecordsAltered(total); Audit.setAction("Task 85: Fixed EmptyParentPathInIdentifiers"); HibernateUtil.save(Audit); HibernateUtil.commitTransaction(); MaintenanceUtil.flushCache(); returnValue.add(FixAssetsProcessStatus.getFixAssetsMap()); FixAssetsProcessStatus.stopProgress(); Logger.debug(FixTask00085FixEmptyParentPathOnIdentifier.class, "Ending FixEmptyParentPathInIdentifiers"); } catch (Exception e) { Logger.error(this, e.getMessage(), e); HibernateUtil.rollbackTransaction(); FixAssetsProcessStatus.stopProgress(); FixAssetsProcessStatus.setActual(-1); } } return returnValue; }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Extract this nested try block a separate method. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public List<Map<String, Object>> executeFix() throws DotDataException { final List<Map<String, Object>> returnValue = new ArrayList<>(); Logger.info(FixTask00085FixEmptyParentPathOnIdentifier.class, "Beginning FixTask00085FixEmptyParentPathOnIdentifier"); if (!FixAssetsProcessStatus.getRunning()) { FixAssetsProcessStatus.startProgress(); FixAssetsProcessStatus .setDescription("Task 85: Updating Empty Parent Path in Identifiers"); FixAssetsProcessStatus.setTotal(total); try { HibernateUtil.startTransaction(); final DotConnect dc = new DotConnect(); dc.setSQL( "update identifier set parent_path = '/' where parent_path is null or parent_path = ''"); try { dc.loadResult(); } catch (DotDataException e) { Logger.error(this, e.getMessage(), e); } FixAssetsProcessStatus.setErrorsFixed(total); final FixAudit audit = new FixAudit(); audit.setTableName("identifier"); audit.setDatetime(new Date()); audit.setRecordsAltered(total); audit.setAction("Task 85: Fixed EmptyParentPathInIdentifiers"); HibernateUtil.save(audit); HibernateUtil.commitTransaction(); MaintenanceUtil.flushCache(); returnValue.add(FixAssetsProcessStatus.getFixAssetsMap()); FixAssetsProcessStatus.stopProgress(); Logger.debug(FixTask00085FixEmptyParentPathOnIdentifier.class, "Ending FixEmptyParentPathInIdentifiers"); } catch (Exception e) { Logger.error(this, e.getMessage(), e); HibernateUtil.rollbackTransaction(); FixAssetsProcessStatus.stopProgress(); FixAssetsProcessStatus.setActual(-1); } } return returnValue; }