Source:
<code>protected boolean removeMemoryVolumes(String memVols, VdcActionType parentCommand, boolean startPollingTasks) { <START> List<Guid> guids = GuidUtils.getGuidListFromString(memVols); <END> if (guids.size() == 6) { boolean postZero = LinqUtils.filter(getDiskDao().getAllForVm(getVm().getId()), new Predicate<Disk>() { @Override public boolean eval(Disk disk) { return disk.isWipeAfterDelete(); } }).size() > 0; Guid taskId1 = persistAsyncTaskPlaceHolder(parentCommand, DELETE_PRIMARY_IMAGE_TASK_KEY); VDSReturnValue vdsRetValue = runVdsCommand( VDSCommandType.DeleteImageGroup, new DeleteImageGroupVDSCommandParameters(guids.get(1), guids.get(0), guids.get(2), postZero, false, getVm().getVdsGroupCompatibilityVersion().toString())); if (!vdsRetValue.getSucceeded()) { return false; } Guid guid1 = createTask(taskId1, vdsRetValue.getCreationInfo(), parentCommand, VdcObjectType.Storage, guids.get(0)); getTaskIdList().add(guid1); Guid taskId2 = persistAsyncTaskPlaceHolder(parentCommand, DELETE_SECONDARY_IMAGES_TASK_KEY); vdsRetValue = runVdsCommand( VDSCommandType.DeleteImageGroup, new DeleteImageGroupVDSCommandParameters(guids.get(1), guids.get(0), guids.get(4), postZero, false, getVm().getVdsGroupCompatibilityVersion().toString())); if (!vdsRetValue.getSucceeded()) { if (startPollingTasks) { AsyncTaskManager.getInstance().StartPollingTask(guid1); } return false; } Guid guid2 = createTask(taskId2, vdsRetValue.getCreationInfo(), parentCommand); getTaskIdList().add(guid2); if (startPollingTasks) { AsyncTaskManager.getInstance().StartPollingTask(guid1); AsyncTaskManager.getInstance().StartPollingTask(guid2); } } return true; }</code><technical_language>This is a cleanup - change functionality. Please separate another patch</technical_language>

Target:
protected boolean removeMemoryVolumes(String memVols, VdcActionType parentCommand, boolean startPollingTasks) { String[] strings = memVols.split(","); Guid[] guids = new Guid[strings.length]; for (int i=0; i<strings.length; ++i) { guids[i] = new Guid(strings[i]); } if (guids.length == 6) { boolean postZero = LinqUtils.filter(getDiskDao().getAllForVm(getVm().getId()), new Predicate<Disk>() { @Override public boolean eval(Disk disk) { return disk.isWipeAfterDelete(); } }).size() > 0; Guid taskId1 = persistAsyncTaskPlaceHolder(parentCommand, DELETE_PRIMARY_IMAGE_TASK_KEY); VDSReturnValue vdsRetValue1 = runVdsCommand( VDSCommandType.DeleteImageGroup, new DeleteImageGroupVDSCommandParameters(guids[1], guids[0], guids[2], postZero, false, getVm().getVdsGroupCompatibilityVersion().toString())); if (!vdsRetValue1.getSucceeded()) { return false; } Guid guid1 = createTask(taskId1, vdsRetValue1.getCreationInfo(), parentCommand, VdcObjectType.Storage, guids[0]); getTaskIdList().add(guid1); Guid taskId2 = persistAsyncTaskPlaceHolder(parentCommand, DELETE_SECONDARY_IMAGES_TASK_KEY); VDSReturnValue vdsRetValue2 = runVdsCommand( VDSCommandType.DeleteImageGroup, new DeleteImageGroupVDSCommandParameters(guids[1], guids[0], guids[4], postZero, false, getVm().getVdsGroupCompatibilityVersion().toString())); if (!vdsRetValue2.getSucceeded()) { if (startPollingTasks) { AsyncTaskManager.getInstance().StartPollingTask(guid1); } return false; } Guid guid2 = createTask(taskId2, vdsRetValue2.getCreationInfo(), parentCommand); getTaskIdList().add(guid2); if (startPollingTasks) { AsyncTaskManager.getInstance().StartPollingTask(guid1); AsyncTaskManager.getInstance().StartPollingTask(guid2); } } return true; }