Source:
<code>private void handleEndedTask() { AsyncTask asyncTask = getParameters().getDbAsyncTask(); <START> log.debug("Task of command: with id: has ended.", <END> asyncTask.getActionType(), getCommandId()); if (getState() != AsyncTaskState.Ended) { setState(AsyncTaskState.Ended); setLastStatusAccessTime(); } CommandEntity rootCmdEntity = coco.getCommandEntity(asyncTask.getRootCommandId()); if (rootCmdEntity != null && !rootCmdEntity.isExecuted()) { setPartiallyCompletedCommandTask(true); log.debug("Marking task of command: with id: as partially completed.", asyncTask.getActionType(), getCommandId()); } if (isZombieTask() || isPartiallyCompletedCommandTask()) { log.debug("Task of command: with id: is a zombie or is partially completed, executing failure logic.", asyncTask.getActionType(), getCommandId()); getParameters().getDbAsyncTask().getTaskParameters().setTaskGroupSuccess(false); ExecutionHandler.getInstance().endTaskStep(parameters.getDbAsyncTask().getStepId(), JobExecutionStatus.FAILED); onTaskEndFailure(); } if (hasTaskEndedSuccessfully()) { log.debug("Task of command: with id: has succeeded, executing success logic.", asyncTask.getActionType(), getCommandId()); ExecutionHandler.getInstance().endTaskStep(parameters.getDbAsyncTask().getStepId(), JobExecutionStatus.FINISHED); onTaskEndSuccess(); } else if (hasTaskEndedInFailure()) { log.debug("Task of command: with id: has failed, executing failure logic.", asyncTask.getActionType(), getCommandId()); ExecutionHandler.getInstance().endTaskStep(parameters.getDbAsyncTask().getStepId(), JobExecutionStatus.FAILED); onTaskEndFailure(); } else if (!doesTaskExist()) { log.debug("Task of command: with id: does not exist, executing cleanup logic.", asyncTask.getActionType(), getCommandId()); ExecutionHandler.getInstance().endTaskStep(parameters.getDbAsyncTask().getStepId(), JobExecutionStatus.UNKNOWN); onTaskDoesNotExist(); } }</code><technical_language>prefer: log.debug("Task of command id '{}' ended."</technical_language>

Target:
private void handleEndedTask() { AsyncTask asyncTask = getParameters().getDbAsyncTask(); log.debug("Task of command: with id '{}' has ended.", asyncTask.getActionType(), getCommandId()); if (getState() != AsyncTaskState.Ended) { setState(AsyncTaskState.Ended); setLastStatusAccessTime(); } CommandEntity rootCmdEntity = coco.getCommandEntity(asyncTask.getRootCommandId()); if (rootCmdEntity != null && !rootCmdEntity.isExecuted()) { setPartiallyCompletedCommandTask(true); log.debug("Marking task of command: with id '{}' as partially completed.", asyncTask.getActionType(), getCommandId()); } if (isZombieTask() || isPartiallyCompletedCommandTask()) { log.debug("Task of command: with id '{}' is a zombie or is partially completed, executing failure logic.", asyncTask.getActionType(), getCommandId()); getParameters().getDbAsyncTask().getTaskParameters().setTaskGroupSuccess(false); ExecutionHandler.getInstance().endTaskStep(parameters.getDbAsyncTask().getStepId(), JobExecutionStatus.FAILED); onTaskEndFailure(); } if (hasTaskEndedSuccessfully()) { log.debug("Task of command: with id '{}' has succeeded, executing success logic.", asyncTask.getActionType(), getCommandId()); ExecutionHandler.getInstance().endTaskStep(parameters.getDbAsyncTask().getStepId(), JobExecutionStatus.FINISHED); onTaskEndSuccess(); } else if (hasTaskEndedInFailure()) { log.debug("Task of command: with id '{}' has failed, executing failure logic.", asyncTask.getActionType(), getCommandId()); ExecutionHandler.getInstance().endTaskStep(parameters.getDbAsyncTask().getStepId(), JobExecutionStatus.FAILED); onTaskEndFailure(); } else if (!doesTaskExist()) { log.debug("Task of command: with id '{}' does not exist, executing cleanup logic.", asyncTask.getActionType(), getCommandId()); ExecutionHandler.getInstance().endTaskStep(parameters.getDbAsyncTask().getStepId(), JobExecutionStatus.UNKNOWN); onTaskDoesNotExist(); } }