Program: 48996
Project: 48996
Buggy source:
/** 
 * set cluster parameters synchronously
 * @param clusterName
 * @param nodeGroupName
 * @param activeComputeNodeNum
 * @param minComputeNodeNum
 * @param mode
 * @param ioPriority
 * @throws Exception
 */
@SuppressWarnings("String_Node_Str") public List<String> syncSetParam(String clusterName,String nodeGroupName,Integer activeComputeNodeNum,Integer minComputeNodeNum,Boolean enableAuto,Priority ioPriority) throws Exception {
  ClusterEntity cluster=clusterEntityMgr.findByName(clusterName);
  ClusterRead clusterRead=getClusterByName(clusterName,false);
  if (cluster == null) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str");
    throw BddException.NOT_FOUND("String_Node_Str",clusterName);
  }
  if (enableAuto != null && enableAuto != cluster.getAutomationEnable()) {
    cluster.setAutomationEnable(enableAuto);
  }
  if (minComputeNodeNum != null && minComputeNodeNum != cluster.getVhmMinNum()) {
    cluster.setVhmMinNum(minComputeNodeNum);
  }
  List<String> nodeGroupNames=new ArrayList<String>();
  if (!clusterRead.validateSetManualElasticity(nodeGroupName,nodeGroupNames)) {
    if (nodeGroupName != null) {
      throw BddException.INVALID_PARAMETER("String_Node_Str",nodeGroupName);
    }
 else {
      throw BddException.INVALID_PARAMETER("String_Node_Str",clusterName);
    }
  }
  if (nodeGroupName == null && activeComputeNodeNum != null) {
    if (activeComputeNodeNum != cluster.getVhmTargetNum()) {
      cluster.setVhmTargetNum(activeComputeNodeNum);
    }
  }
  clusterEntityMgr.update(cluster);
  if (nodeGroupName != null) {
    NodeGroupEntity ngEntity=clusterEntityMgr.findByName(clusterName,nodeGroupName);
    if (activeComputeNodeNum != ngEntity.getVhmTargetNum()) {
      ngEntity.setVhmTargetNum(activeComputeNodeNum);
      clusterEntityMgr.update(ngEntity);
    }
  }
  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");
  }
  boolean sucess=clusteringService.setAutoElasticity(clusterName,null);
  if (!sucess) {
    throw ClusterManagerException.SET_AUTO_ELASTICITY_NOT_ALLOWED_ERROR(clusterName,"String_Node_Str");
  }
  if (ioPriority != null) {
    prioritizeCluster(clusterName,nodeGroupName,ioPriority);
  }
  return nodeGroupNames;
}

Fixed version (ground truth):
/** 
 * set cluster parameters synchronously
 * @param clusterName
 * @param nodeGroupName
 * @param activeComputeNodeNum
 * @param minComputeNodeNum
 * @param mode
 * @param ioPriority
 * @throws Exception
 */
@SuppressWarnings("String_Node_Str") public List<String> syncSetParam(String clusterName,String nodeGroupName,Integer activeComputeNodeNum,Integer minComputeNodeNum,Boolean enableAuto,Priority ioPriority) throws Exception {
  ClusterEntity cluster=clusterEntityMgr.findByName(clusterName);
  ClusterRead clusterRead=getClusterByName(clusterName,false);
  if (cluster == null) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str");
    throw BddException.NOT_FOUND("String_Node_Str",clusterName);
  }
  if (ioPriority != null) {
    prioritizeCluster(clusterName,nodeGroupName,ioPriority);
  }
  if (enableAuto != null && enableAuto != cluster.getAutomationEnable()) {
    cluster.setAutomationEnable(enableAuto);
  }
  if (minComputeNodeNum != null && minComputeNodeNum != cluster.getVhmMinNum()) {
    cluster.setVhmMinNum(minComputeNodeNum);
  }
  List<String> nodeGroupNames=new ArrayList<String>();
  if (!clusterRead.validateSetManualElasticity(nodeGroupName,nodeGroupNames)) {
    if (nodeGroupName != null) {
      throw BddException.INVALID_PARAMETER("String_Node_Str",nodeGroupName);
    }
 else {
      throw BddException.INVALID_PARAMETER("String_Node_Str",clusterName);
    }
  }
  if (nodeGroupName == null && activeComputeNodeNum != null) {
    if (activeComputeNodeNum != cluster.getVhmTargetNum()) {
      cluster.setVhmTargetNum(activeComputeNodeNum);
    }
  }
  clusterEntityMgr.update(cluster);
  if (nodeGroupName != null) {
    NodeGroupEntity ngEntity=clusterEntityMgr.findByName(clusterName,nodeGroupName);
    if (activeComputeNodeNum != ngEntity.getVhmTargetNum()) {
      ngEntity.setVhmTargetNum(activeComputeNodeNum);
      clusterEntityMgr.update(ngEntity);
    }
  }
  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");
  }
  if (enableAuto != null && enableAuto) {
    boolean sucess=clusteringService.setAutoElasticity(clusterName,null);
    if (!sucess) {
      throw ClusterManagerException.SET_AUTO_ELASTICITY_NOT_ALLOWED_ERROR(clusterName,"String_Node_Str");
    }
  }
  return nodeGroupNames;
}