Program: 48960
Project: 48960
Buggy source:
@SuppressWarnings("String_Node_Str") public boolean setAutoElasticity(String clusterName){
  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) {
    logger.error("String_Node_Str");
    throw ClusteringServiceException.SET_AUTO_ELASTICITY_FAILED(cluster.getName());
  }
  String serengetiUUID=ConfigInfo.getSerengetiRootFolder();
  int minComputeNodeNum=cluster.getVhmMinNum();
  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) {
    List<String> roles=new Gson().fromJson(node.getNodeGroup().getRoles(),List.class);
    boolean isComputeOnlyNode=false;
    if (roles.contains(HadoopRole.HADOOP_TASKTRACKER.toString()) && (roles.size() == 1 || (roles.size() == 2 && roles.contains(HadoopRole.TEMPFS_CLIENT_ROLE.toString())))) {
      isComputeOnlyNode=true;
    }
    VcVirtualMachine vm=VcCache.getIgnoreMissing(node.getMoId());
    if (vm == null) {
      logger.error("String_Node_Str" + node.getVmName());
      return false;
    }
    SetAutoElasticitySP sp=new SetAutoElasticitySP(vm,serengetiUUID,masterMoId,masterUUID,enableAutoElasticity,minComputeNodeNum,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) {
    logger.error("String_Node_Str");
    throw ClusteringServiceException.SET_AUTO_ELASTICITY_FAILED(cluster.getName());
  }
  String serengetiUUID=ConfigInfo.getSerengetiRootFolder();
  int minComputeNodeNum=cluster.getVhmMinNum();
  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());
      return false;
    }
    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,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());
  }
}