Program: 48583
Project: 48583
Buggy source:
public Long resumeClusterCreation(String clusterName) throws Exception {
  logger.info("String_Node_Str" + clusterName);
  ClusterEntity cluster=clusterEntityMgr.findByName(clusterName);
  if (cluster == null) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str");
    throw BddException.NOT_FOUND("String_Node_Str",clusterName);
  }
  ValidationUtils.validateVersion(clusterEntityMgr,clusterName);
  if (cluster.getStatus() != ClusterStatus.PROVISION_ERROR || cluster.getStatus() != ClusterStatus.SERVICE_ERROR) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str"+ cluster.getStatus());
    throw ClusterManagerException.UPDATE_NOT_ALLOWED_ERROR(clusterName,"String_Node_Str");
  }
  List<String> dsNames=getUsedDS(cluster.getVcDatastoreNameList());
  if (dsNames.isEmpty()) {
    throw ClusterConfigException.NO_RESOURCE_POOL_ADDED();
  }
  List<VcCluster> vcClusters=getUsedVcClusters(cluster.getVcRpNameList());
  if (vcClusters.isEmpty()) {
    throw ClusterConfigException.NO_DATASTORE_ADDED();
  }
  validateDatastore(dsNames,vcClusters);
  validateNetworkAccessibility(cluster.fetchNetworkNameList(),vcClusters);
  Map<String,JobParameter> param=new TreeMap<String,JobParameter>();
  param.put(JobConstants.CLUSTER_NAME_JOB_PARAM,new JobParameter(clusterName));
  param.put(JobConstants.TIMESTAMP_JOB_PARAM,new JobParameter(new Date()));
  param.put(JobConstants.CLUSTER_SUCCESS_STATUS_JOB_PARAM,new JobParameter(ClusterStatus.RUNNING.name()));
  param.put(JobConstants.CLUSTER_FAILURE_STATUS_JOB_PARAM,new JobParameter(ClusterStatus.PROVISION_ERROR.name()));
  JobParameters jobParameters=new JobParameters(param);
  clusterEntityMgr.updateClusterStatus(clusterName,ClusterStatus.PROVISIONING);
  clusterEntityMgr.cleanupActionError(clusterName);
  try {
    return jobManager.runJob(JobConstants.RESUME_CLUSTER_JOB_NAME,jobParameters);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + clusterName,e);
    clusterEntityMgr.updateClusterStatus(clusterName,ClusterStatus.PROVISION_ERROR);
    throw e;
  }
}

Fixed version (ground truth):
public Long resumeClusterCreation(String clusterName) throws Exception {
  logger.info("String_Node_Str" + clusterName);
  ClusterEntity cluster=clusterEntityMgr.findByName(clusterName);
  if (cluster == null) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str");
    throw BddException.NOT_FOUND("String_Node_Str",clusterName);
  }
  ValidationUtils.validateVersion(clusterEntityMgr,clusterName);
  if (cluster.getStatus() != ClusterStatus.PROVISION_ERROR && cluster.getStatus() != ClusterStatus.SERVICE_ERROR) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str"+ cluster.getStatus());
    throw ClusterManagerException.UPDATE_NOT_ALLOWED_ERROR(clusterName,"String_Node_Str");
  }
  List<String> dsNames=getUsedDS(cluster.getVcDatastoreNameList());
  if (dsNames.isEmpty()) {
    throw ClusterConfigException.NO_RESOURCE_POOL_ADDED();
  }
  List<VcCluster> vcClusters=getUsedVcClusters(cluster.getVcRpNameList());
  if (vcClusters.isEmpty()) {
    throw ClusterConfigException.NO_DATASTORE_ADDED();
  }
  validateDatastore(dsNames,vcClusters);
  validateNetworkAccessibility(cluster.fetchNetworkNameList(),vcClusters);
  Map<String,JobParameter> param=new TreeMap<String,JobParameter>();
  param.put(JobConstants.CLUSTER_NAME_JOB_PARAM,new JobParameter(clusterName));
  param.put(JobConstants.TIMESTAMP_JOB_PARAM,new JobParameter(new Date()));
  param.put(JobConstants.CLUSTER_SUCCESS_STATUS_JOB_PARAM,new JobParameter(ClusterStatus.RUNNING.name()));
  param.put(JobConstants.CLUSTER_FAILURE_STATUS_JOB_PARAM,new JobParameter(ClusterStatus.PROVISION_ERROR.name()));
  JobParameters jobParameters=new JobParameters(param);
  clusterEntityMgr.updateClusterStatus(clusterName,ClusterStatus.PROVISIONING);
  clusterEntityMgr.cleanupActionError(clusterName);
  try {
    return jobManager.runJob(JobConstants.RESUME_CLUSTER_JOB_NAME,jobParameters);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + clusterName,e);
    clusterEntityMgr.updateClusterStatus(clusterName,ClusterStatus.PROVISION_ERROR);
    throw e;
  }
}