Program: 48536
Project: 48536
Buggy source:
public Long configCluster(String clusterName,ClusterCreate createSpec) throws Exception {
  logger.info("String_Node_Str" + clusterName);
  ClusterEntity cluster;
  if ((cluster=clusterEntityMgr.findByName(clusterName)) == 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() && !ClusterStatus.CONFIGURE_ERROR.equals(cluster.getStatus()) && !ClusterStatus.SERVICE_ERROR.equals(cluster.getStatus())) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str"+ cluster.getStatus());
    throw ClusterManagerException.UPDATE_NOT_ALLOWED_ERROR(clusterName,"String_Node_Str");
  }
  clusterConfigMgr.updateAppConfig(clusterName,createSpec);
  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.CONFIGURE_ERROR.name()));
  JobParameters jobParameters=new JobParameters(param);
  clusterEntityMgr.updateClusterStatus(clusterName,ClusterStatus.CONFIGURING);
  clusterEntityMgr.cleanupActionError(clusterName);
  try {
    return jobManager.runJob(JobConstants.CONFIG_CLUSTER_JOB_NAME,jobParameters);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + clusterName,e);
    clusterEntityMgr.updateClusterStatus(clusterName,ClusterStatus.CONFIGURE_ERROR);
    throw e;
  }
}

Fixed version (ground truth):
public Long configCluster(String clusterName,ClusterCreate createSpec) throws Exception {
  logger.info("String_Node_Str" + clusterName);
  ClusterEntity cluster;
  if ((cluster=clusterEntityMgr.findByName(clusterName)) == 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() && !ClusterStatus.CONFIGURE_ERROR.equals(cluster.getStatus()) && !ClusterStatus.SERVICE_STOPPED.equals(cluster.getStatus())) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str"+ cluster.getStatus());
    throw ClusterManagerException.UPDATE_NOT_ALLOWED_ERROR(clusterName,"String_Node_Str");
  }
  clusterConfigMgr.updateAppConfig(clusterName,createSpec);
  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.CONFIGURE_ERROR.name()));
  JobParameters jobParameters=new JobParameters(param);
  clusterEntityMgr.updateClusterStatus(clusterName,ClusterStatus.CONFIGURING);
  clusterEntityMgr.cleanupActionError(clusterName);
  try {
    return jobManager.runJob(JobConstants.CONFIG_CLUSTER_JOB_NAME,jobParameters);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + clusterName,e);
    clusterEntityMgr.updateClusterStatus(clusterName,ClusterStatus.CONFIGURE_ERROR);
    throw e;
  }
}