Program: 48787
Project: 48787
Buggy source:
@SuppressWarnings("String_Node_Str") public boolean setAutoElasticity(String clusterName,boolean refreshAllNodes){
  logger.info("String_Node_Str" + clusterName);
  ClusterEntity cluster=getClusterEntityMgr().findByName(clusterName);
  List<NodeEntity> nodes=clusterEntityMgr.findAllNodes(clusterName);
  Boolean enableAutoElasticity=cluster.getAutomationEnable();
  if (enableAutoElasticity == null) {
    return true;
  }
  String masterMoId=cluster.getVhmMasterMoid();
  if (masterMoId == null) {
    updateVhmMasterMoid(clusterName);
    cluster=getClusterEntityMgr().findByName(clusterName);
    masterMoId=cluster.getVhmMasterMoid();
    if (masterMoId == null) {
      logger.error("String_Node_Str");
      throw ClusteringServiceException.SET_AUTO_ELASTICITY_FAILED(cluster.getName());
    }
  }
  String serengetiUUID=ConfigInfo.getSerengetiRootFolder();
  int minComputeNodeNum=cluster.getVhmMinNum();
  int maxComputeNodeNum=cluster.getVhmMaxNum();
  String jobTrackerPort=cluster.getVhmJobTrackerPort();
  VcVirtualMachine vcVm=VcCache.getIgnoreMissing(masterMoId);
  if (vcVm == null) {
    logger.error("String_Node_Str");
    return false;
  }
  String masterUUID=vcVm.getConfig().getUuid();
  Callable<Void>[] storeProcedures=new Callable[nodes.size()];
  int i=0;
  for (  NodeEntity node : nodes) {
    VcVirtualMachine vm=VcCache.getIgnoreMissing(node.getMoId());
    if (vm == null) {
      logger.error("String_Node_Str" + node.getVmName());
      continue;
    }
    if (!refreshAllNodes && !vm.getId().equalsIgnoreCase(masterMoId)) {
      continue;
    }
    List<String> roles=new Gson().fromJson(node.getNodeGroup().getRoles(),List.class);
    String distroVendor=node.getNodeGroup().getCluster().getDistroVendor();
    boolean isComputeOnlyNode=CommonUtil.isComputeOnly(roles,distroVendor);
    SetAutoElasticitySP sp=new SetAutoElasticitySP(vm,serengetiUUID,masterMoId,masterUUID,enableAutoElasticity,minComputeNodeNum,maxComputeNodeNum,jobTrackerPort,isComputeOnlyNode);
    storeProcedures[i]=sp;
    i++;
  }
  try {
    logger.info("String_Node_Str");
    boolean success=true;
    NoProgressUpdateCallback callback=new NoProgressUpdateCallback();
    ExecutionResult[] result=Scheduler.executeStoredProcedures(com.vmware.aurora.composition.concurrent.Priority.BACKGROUND,storeProcedures,callback);
    if (result == null) {
      logger.error("String_Node_Str");
      throw ClusteringServiceException.SET_AUTO_ELASTICITY_FAILED(clusterName);
    }
    for (i=0; i < storeProcedures.length; i++) {
      if (result[i].throwable != null) {
        logger.error("String_Node_Str",result[i].throwable);
        success=false;
      }
    }
    return success;
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw BddException.INTERNAL(e,e.getMessage());
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean setAutoElasticity(String clusterName,boolean refreshAllNodes){
  logger.info("String_Node_Str" + clusterName);
  ClusterEntity cluster=getClusterEntityMgr().findByName(clusterName);
  List<NodeEntity> nodes=clusterEntityMgr.findAllNodes(clusterName);
  Boolean enableAutoElasticity=cluster.getAutomationEnable();
  if (enableAutoElasticity == null) {
    return true;
  }
  String masterMoId=cluster.getVhmMasterMoid();
  if (masterMoId == null) {
    updateVhmMasterMoid(clusterName);
    cluster=getClusterEntityMgr().findByName(clusterName);
    masterMoId=cluster.getVhmMasterMoid();
    if (masterMoId == null) {
      logger.error("String_Node_Str");
      throw ClusteringServiceException.SET_AUTO_ELASTICITY_FAILED(cluster.getName());
    }
  }
  String serengetiUUID=ConfigInfo.getSerengetiRootFolder();
  int minComputeNodeNum=cluster.getVhmMinNum();
  int maxComputeNodeNum=cluster.getVhmMaxNum();
  String jobTrackerPort=cluster.getVhmJobTrackerPort();
  VcVirtualMachine vcVm=VcCache.getIgnoreMissing(masterMoId);
  if (vcVm == null) {
    logger.error("String_Node_Str");
    return false;
  }
  String masterUUID=vcVm.getConfig().getUuid();
  Callable<Void>[] storeProcedures=new Callable[nodes.size()];
  int i=0;
  for (  NodeEntity node : nodes) {
    VcVirtualMachine vm=VcCache.getIgnoreMissing(node.getMoId());
    if (vm == null) {
      logger.error("String_Node_Str" + node.getVmName());
      continue;
    }
    if (!refreshAllNodes && !vm.getId().equalsIgnoreCase(masterMoId)) {
      continue;
    }
    List<String> roles=new Gson().fromJson(node.getNodeGroup().getRoles(),List.class);
    String distroVendor=node.getNodeGroup().getCluster().getDistroVendor();
    boolean isComputeOnlyNode=CommonUtil.isComputeOnly(roles,distroVendor);
    SetAutoElasticitySP sp=new SetAutoElasticitySP(clusterName,vm,serengetiUUID,masterMoId,masterUUID,enableAutoElasticity,minComputeNodeNum,maxComputeNodeNum,jobTrackerPort,isComputeOnlyNode);
    storeProcedures[i]=sp;
    i++;
  }
  try {
    logger.info("String_Node_Str");
    boolean success=true;
    NoProgressUpdateCallback callback=new NoProgressUpdateCallback();
    ExecutionResult[] result=Scheduler.executeStoredProcedures(com.vmware.aurora.composition.concurrent.Priority.BACKGROUND,storeProcedures,callback);
    if (result == null) {
      logger.error("String_Node_Str");
      throw ClusteringServiceException.SET_AUTO_ELASTICITY_FAILED(clusterName);
    }
    for (i=0; i < storeProcedures.length; i++) {
      if (result[i].throwable != null) {
        logger.error("String_Node_Str",result[i].throwable);
        success=false;
      }
    }
    return success;
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw BddException.INTERNAL(e,e.getMessage());
  }
}