Program: 48542
Project: 48542
Buggy source:
private boolean doSoftwareOperation(String clusterName,ApiRequest apiRequestSummary,ClusterReport clusterReport,ClusterReportQueue reports) throws Exception {
  ClusterOperationPoller poller=new ClusterOperationPoller(apiManager,apiRequestSummary,clusterName,clusterReport,reports,ProgressSplit.OPERATION_FINISHED.getProgress());
  poller.waitForComplete();
  boolean success=false;
  ApiRequest apiRequest=apiManager.getRequestWithTasks(clusterName,apiRequestSummary.getApiRequestInfo().getRequestId());
  ClusterRequestStatus clusterRequestStatus=ClusterRequestStatus.valueOf(apiRequest.getApiRequestInfo().getRequestStatus());
  if (!clusterRequestStatus.isFailedState()) {
    success=true;
  }
 else {
    logger.error("String_Node_Str" + ApiUtils.objectToJson(apiRequest.getApiRequestInfo()));
    List<ApiTask> apiTasks=apiRequest.getApiTasks();
    Map<String,NodeReport> nodeReports=clusterReport.getNodeReports();
    HashMap<String,List<String>> errMsg=new HashMap<>();
    for (    ApiTask apiTask : apiTasks) {
      ApiTaskInfo taskInfo=apiTask.getApiTaskInfo();
      if (TaskStatus.valueOf(taskInfo.getStatus()).isFailedState()) {
        if (!errMsg.containsKey(taskInfo.getHostName())) {
          List<String> errs=new ArrayList<>();
          errMsg.put(taskInfo.getHostName(),errs);
        }
        String taskErrMsg=taskInfo.getCommandDetail() + "String_Node_Str" + taskInfo.getStatus();
        errMsg.get(taskInfo.getHostName()).add(taskErrMsg);
        logger.error("String_Node_Str" + taskInfo.getCommandDetail() + "String_Node_Str"+ taskInfo.getRole()+ "String_Node_Str"+ taskInfo.getStructuredOut()+ "String_Node_Str"+ taskInfo.getStderr()+ "String_Node_Str"+ taskInfo.getStatus());
      }
    }
    for (    NodeReport nodeReport : nodeReports.values()) {
      if (errMsg.containsKey(nodeReport.getHostname())) {
        nodeReport.setErrMsg(errMsg.get(nodeReport.getHostname()).toString());
      }
    }
    String requestErrorMsg="String_Node_Str" + apiRequest.getApiRequestInfo().getRequestStatus() + "String_Node_Str";
    clusterReport.setErrMsg(requestErrorMsg);
    reportStatus(clusterReport.clone(),reports);
    throw new RuntimeException(requestErrorMsg);
  }
  return success;
}

Fixed version (ground truth):
private boolean doSoftwareOperation(String clusterName,ApiRequest apiRequestSummary,ClusterReport clusterReport,ClusterReportQueue reports) throws Exception {
  if (apiRequestSummary == null) {
    return true;
  }
  ClusterOperationPoller poller=new ClusterOperationPoller(apiManager,apiRequestSummary,clusterName,clusterReport,reports,ProgressSplit.OPERATION_FINISHED.getProgress());
  poller.waitForComplete();
  boolean success=false;
  ApiRequest apiRequest=apiManager.getRequestWithTasks(clusterName,apiRequestSummary.getApiRequestInfo().getRequestId());
  ClusterRequestStatus clusterRequestStatus=ClusterRequestStatus.valueOf(apiRequest.getApiRequestInfo().getRequestStatus());
  if (!clusterRequestStatus.isFailedState()) {
    success=true;
  }
 else {
    logger.error("String_Node_Str" + ApiUtils.objectToJson(apiRequest.getApiRequestInfo()));
    List<ApiTask> apiTasks=apiRequest.getApiTasks();
    Map<String,NodeReport> nodeReports=clusterReport.getNodeReports();
    HashMap<String,List<String>> errMsg=new HashMap<>();
    for (    ApiTask apiTask : apiTasks) {
      ApiTaskInfo taskInfo=apiTask.getApiTaskInfo();
      if (TaskStatus.valueOf(taskInfo.getStatus()).isFailedState()) {
        if (!errMsg.containsKey(taskInfo.getHostName())) {
          List<String> errs=new ArrayList<>();
          errMsg.put(taskInfo.getHostName(),errs);
        }
        String taskErrMsg=taskInfo.getCommandDetail() + "String_Node_Str" + taskInfo.getStatus();
        errMsg.get(taskInfo.getHostName()).add(taskErrMsg);
        logger.error("String_Node_Str" + taskInfo.getCommandDetail() + "String_Node_Str"+ taskInfo.getRole()+ "String_Node_Str"+ taskInfo.getStderr()+ "String_Node_Str"+ taskInfo.getStatus());
      }
    }
    for (    NodeReport nodeReport : nodeReports.values()) {
      if (errMsg.containsKey(nodeReport.getHostname())) {
        nodeReport.setErrMsg(errMsg.get(nodeReport.getHostname()).toString());
      }
    }
    String requestErrorMsg="String_Node_Str" + apiRequest.getApiRequestInfo().getRequestStatus() + "String_Node_Str";
    clusterReport.setErrMsg(requestErrorMsg);
    reportStatus(clusterReport.clone(),reports);
    throw new RuntimeException(requestErrorMsg);
  }
  return success;
}