Source:
<code>public List<Map<String, Object>> executeFix() throws DotDataException, DotRuntimeException { List<Map<String, Object>> returnValue = new ArrayList<Map<String, Object>>(); Logger.info(FixTask00015FixAssetTypesInIdentifiers.class, "Beginning FixAssetTypesInIdentifiers"); if (!FixAssetsProcessStatus.getRunning()) { FixAssetsProcessStatus.startProgress(); FixAssetsProcessStatus.setDescription("Task 15: Updating Invalid Identifier Asset-Types"); FixAssetsProcessStatus.setTotal(total); try{ HibernateUtil.startTransaction(); DotConnect dc = new DotConnect(); for (String asset : assetNames) { Inode.Type assetType = Inode.Type.valueOf(asset.toUpperCase()); final String tableName = assetType.getTableName(); Integer assetDataCount = badDataCount.get("identifier_"+asset); if (assetDataCount != null && assetDataCount.intValue() > 0) { final String identifiersToUpdate = "UPDATE identifier SET asset_type = '"+ asset +"' "+ "WHERE asset_type <> '"+asset+"' AND EXISTS ("+ "SELECT * FROM "+ tableName +" WHERE identifier.id = identifier"+ ")"; Logger.debug(MaintenanceUtil.class,"Task 15: Updating from identifier type " + asset + " : " + identifiersToUpdate); dc.setSQL(identifiersToUpdate); try { 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); <START> Audit.setAction("task 20: Fixed DeleteOrphanedIdentifiers"); <END> HibernateUtil.save(Audit); HibernateUtil.commitTransaction(); MaintenanceUtil.flushCache(); returnValue.add(FixAssetsProcessStatus.getFixAssetsMap()); FixAssetsProcessStatus.stopProgress(); Logger.debug(FixTask00015FixAssetTypesInIdentifiers.class, "Ending FixAssetTypesInIdentifiers"); } catch (Exception e) { Logger.error(this,e.getMessage(), e); HibernateUtil.rollbackTransaction(); FixAssetsProcessStatus.stopProgress(); FixAssetsProcessStatus.setActual(-1); } } return returnValue; }</code><technical_language>'task 15' description</technical_language>

Target:
public List<Map<String, Object>> executeFix() throws DotDataException, DotRuntimeException { List<Map<String, Object>> returnValue = new ArrayList<Map<String, Object>>(); Logger.info(FixTask00015FixAssetTypesInIdentifiers.class, "Beginning FixAssetTypesInIdentifiers"); if (!FixAssetsProcessStatus.getRunning()) { FixAssetsProcessStatus.startProgress(); FixAssetsProcessStatus.setDescription("Task 15: Updating Invalid Identifier Asset-Types"); FixAssetsProcessStatus.setTotal(total); try{ HibernateUtil.startTransaction(); DotConnect dc = new DotConnect(); for (String asset : assetNames) { Inode.Type assetType = Inode.Type.valueOf(asset.toUpperCase()); final String tableName = assetType.getTableName(); Integer assetDataCount = badDataCount.get("identifier_"+asset); if (assetDataCount != null && assetDataCount.intValue() > 0) { final String identifiersToUpdate = "UPDATE identifier SET asset_type = '"+ asset +"' "+ "WHERE asset_type <> '"+asset+"' AND EXISTS ("+ "SELECT * FROM "+ tableName +" WHERE identifier.id = identifier"+ ")"; Logger.debug(MaintenanceUtil.class,"Task 15: Updating from identifier type " + asset + " : " + identifiersToUpdate); dc.setSQL(identifiersToUpdate); dc.loadResult(); } } FixAssetsProcessStatus.setErrorsFixed(total); FixAudit Audit = new FixAudit(); Audit.setTableName("identifier"); Audit.setDatetime(new Date()); Audit.setRecordsAltered(total); Audit.setAction("task 15: Fixed FixAssetTypesInIdentifiers"); HibernateUtil.save(Audit); HibernateUtil.commitTransaction(); MaintenanceUtil.flushCache(); returnValue.add(FixAssetsProcessStatus.getFixAssetsMap()); FixAssetsProcessStatus.stopProgress(); Logger.debug(FixTask00015FixAssetTypesInIdentifiers.class, "Ending FixAssetTypesInIdentifiers"); } catch (Exception e) { Logger.error(this,e.getMessage(), e); HibernateUtil.rollbackTransaction(); FixAssetsProcessStatus.stopProgress(); FixAssetsProcessStatus.setActual(-1); } } return returnValue; }