Program: 48557
Project: 48557
Buggy source:
public Long startCluster(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().isActiveServiceStatus() || cluster.getStatus() == ClusterStatus.SERVICE_ERROR) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str");
    throw ClusterManagerException.ALREADY_STARTED_ERROR(clusterName);
  }
  if (!ClusterStatus.STOPPED.equals(cluster.getStatus()) && !ClusterStatus.ERROR.equals(cluster.getStatus())) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str"+ cluster.getStatus()+ "String_Node_Str");
    throw ClusterManagerException.START_NOT_ALLOWED_ERROR(clusterName,"String_Node_Str");
  }
  cluster.setVhmTargetNum(-1);
  clusterEntityMgr.update(cluster);
  clusterEntityMgr.cleanupActionError(clusterName);
  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.ERROR.name()));
  JobParameters jobParameters=new JobParameters(param);
  clusterEntityMgr.updateClusterStatus(clusterName,ClusterStatus.STARTING);
  try {
    return jobManager.runJob(JobConstants.START_CLUSTER_JOB_NAME,jobParameters);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + clusterName,e);
    clusterEntityMgr.updateClusterStatus(clusterName,ClusterStatus.ERROR);
    throw e;
  }
}

Fixed version (ground truth):
public Long startCluster(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().isActiveServiceStatus()) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str");
    throw ClusterManagerException.ALREADY_STARTED_ERROR(clusterName);
  }
  if (!ClusterStatus.STOPPED.equals(cluster.getStatus()) && !ClusterStatus.ERROR.equals(cluster.getStatus())) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str"+ cluster.getStatus()+ "String_Node_Str");
    throw ClusterManagerException.START_NOT_ALLOWED_ERROR(clusterName,"String_Node_Str");
  }
  cluster.setVhmTargetNum(-1);
  clusterEntityMgr.update(cluster);
  clusterEntityMgr.cleanupActionError(clusterName);
  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.ERROR.name()));
  JobParameters jobParameters=new JobParameters(param);
  clusterEntityMgr.updateClusterStatus(clusterName,ClusterStatus.STARTING);
  try {
    return jobManager.runJob(JobConstants.START_CLUSTER_JOB_NAME,jobParameters);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + clusterName,e);
    clusterEntityMgr.updateClusterStatus(clusterName,ClusterStatus.ERROR);
    throw e;
  }
}