Program: 49021
Project: 49021
Buggy source:
public void setAutoElasticity(String clusterName,boolean enableAutoElasticity,Integer minComputeNodeNum,ElasticityOperation op) throws Exception {
  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);
  }
  Boolean preEnableSetting=cluster.getAutomationEnable();
  int preMinComputeNodeNum=cluster.getVhmMinNum();
  if (preEnableSetting == null) {
    if (op != ElasticityOperation.OP_SET_AUTO) {
      return;
    }
    logger.error("String_Node_Str" + clusterName + "String_Node_Str");
    throw ClusterManagerException.SET_AUTO_ELASTICITY_NOT_ALLOWED_ERROR(clusterName,"String_Node_Str");
  }
  cluster.setAutomationEnable(enableAutoElasticity);
  if (minComputeNodeNum != null) {
    cluster.setVhmMinNum(minComputeNodeNum);
  }
  clusterEntityMgr.update(cluster);
  if (!ClusterStatus.RUNNING.equals(cluster.getStatus()) && !ClusterStatus.STOPPED.equals(cluster.getStatus())) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str"+ cluster.getStatus()+ "String_Node_Str");
    throw ClusterManagerException.SET_AUTO_ELASTICITY_NOT_ALLOWED_ERROR(clusterName,"String_Node_Str");
  }
  Map<String,JobParameter> param=new TreeMap<String,JobParameter>();
  param.put(JobConstants.TIMESTAMP_JOB_PARAM,new JobParameter(new Date()));
  param.put(JobConstants.CLUSTER_NAME_JOB_PARAM,new JobParameter(clusterName));
  JobParameters jobParameters=new JobParameters(param);
  try {
    jobManager.runJob(JobConstants.SET_AUTO_ELASTICITY_JOB_NAME,jobParameters);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + clusterName,e);
    throw e;
  }
}

Fixed version (ground truth):
public void setAutoElasticity(String clusterName,boolean enableAutoElasticity,Integer minComputeNodeNum,ElasticityOperation op) throws Exception {
  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);
  }
  Boolean preEnableSetting=cluster.getAutomationEnable();
  if (preEnableSetting == null) {
    if (op != ElasticityOperation.OP_SET_AUTO) {
      return;
    }
    logger.error("String_Node_Str" + clusterName + "String_Node_Str");
    throw ClusterManagerException.SET_AUTO_ELASTICITY_NOT_ALLOWED_ERROR(clusterName,"String_Node_Str");
  }
  cluster.setAutomationEnable(enableAutoElasticity);
  if (minComputeNodeNum != null) {
    cluster.setVhmMinNum(minComputeNodeNum);
  }
  clusterEntityMgr.update(cluster);
  if (!ClusterStatus.RUNNING.equals(cluster.getStatus()) && !ClusterStatus.STOPPED.equals(cluster.getStatus())) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str"+ cluster.getStatus()+ "String_Node_Str");
    throw ClusterManagerException.SET_AUTO_ELASTICITY_NOT_ALLOWED_ERROR(clusterName,"String_Node_Str");
  }
  Map<String,JobParameter> param=new TreeMap<String,JobParameter>();
  param.put(JobConstants.TIMESTAMP_JOB_PARAM,new JobParameter(new Date()));
  param.put(JobConstants.CLUSTER_NAME_JOB_PARAM,new JobParameter(clusterName));
  JobParameters jobParameters=new JobParameters(param);
  try {
    jobManager.runJob(JobConstants.SET_AUTO_ELASTICITY_JOB_NAME,jobParameters);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + clusterName,e);
    throw e;
  }
}