Program: 34447
Project: 34447
Buggy source:
public synchronized GpuAllocation selectCandidateRequestNode(ResourceDescriptor request,String nodeLabel,String nodeGpuType){
  LOGGER.logDebug("String_Node_Str",request,nodeLabel,nodeGpuType);
  ClusterConfiguration clusterConfiguration=am.getClusterConfiguration();
  Map<String,NodeConfiguration> nodes=clusterConfiguration.getNodes();
  Long candidateGpu=request.getGpuAttribute();
  if (candidateGpu > 0 && Long.bitCount(candidateGpu) != request.getGpuNumber()) {
    LOGGER.logError("String_Node_Str",request.getGpuNumber(),Long.toBinaryString(candidateGpu));
    return null;
  }
  GpuAllocation gpuAllocation=null;
  List gpuTypeList=null;
  if (nodeGpuType != null && !nodeGpuType.trim().isEmpty()) {
    gpuTypeList=Arrays.asList(nodeGpuType.split("String_Node_Str"));
  }
  for (  Map.Entry<String,Node> entry : candidateRequestNodes.entrySet()) {
    LOGGER.logDebug("String_Node_Str" + entry.getValue().toString());
    if (nodeLabel != null) {
      Set<String> nodeLabels=entry.getValue().getNodeLabels();
      if (nodeLabels != null && nodeLabels.size() > 0 && !nodeLabels.contains(nodeLabel)) {
        LOGGER.logDebug("String_Node_Str",entry.getValue().getHostName(),CommonExtensions.toString(nodeLabels),nodeLabel);
        continue;
      }
    }
    if (gpuTypeList != null) {
      if (nodes.size() > 0) {
        if (!nodes.containsKey(entry.getValue().getHostName())) {
          LOGGER.logWarning("String_Node_Str",entry.getValue().getHostName());
          continue;
        }
        String gpuType=(nodes.get(entry.getValue().getHostName())).getGpuType();
        if (!gpuTypeList.contains(gpuType)) {
          LOGGER.logDebug("String_Node_Str",entry.getValue().getHostName(),gpuType,nodeGpuType);
          continue;
        }
      }
    }
    if (request.getMemoryMB() <= entry.getValue().getAvailableMemory() && request.getCpuNumber() <= entry.getValue().getAvailableCpu() && request.getGpuNumber() <= entry.getValue().getAvailableNumGpus()) {
      if (request.getGpuNumber() > 0) {
        if (candidateGpu > 0) {
          if ((candidateGpu & entry.getValue().getNodeGpuStatus()) != candidateGpu)           continue;
        }
 else {
          candidateGpu=selectCandidateGpu(entry.getValue(),request.getGpuNumber());
          if (Long.bitCount(candidateGpu) != request.getGpuNumber()) {
            continue;
          }
        }
        gpuAllocation=new GpuAllocation();
        gpuAllocation.setNodeName(entry.getValue().getHostName());
        gpuAllocation.setGpuBitmap(candidateGpu);
        break;
      }
    }
  }
  if (gpuAllocation != null) {
    LOGGER.logInfo("String_Node_Str" + gpuAllocation.getNodeName() + "String_Node_Str"+ Long.toBinaryString(gpuAllocation.getGpuBitmap()));
  }
 else {
    LOGGER.logInfo("String_Node_Str");
  }
  return gpuAllocation;
}

Fixed version (ground truth):
public synchronized GpuAllocation selectCandidateRequestNode(ResourceDescriptor request,String nodeLabel,String nodeGpuType){
  LOGGER.logDebug("String_Node_Str",request,nodeLabel,nodeGpuType);
  ClusterConfiguration clusterConfiguration=am.getClusterConfiguration();
  Map<String,NodeConfiguration> nodes=clusterConfiguration.getNodes();
  Long requestGpu=request.getGpuAttribute();
  if (requestGpu > 0 && Long.bitCount(requestGpu) != request.getGpuNumber()) {
    LOGGER.logError("String_Node_Str",request.getGpuNumber(),Long.toBinaryString(requestGpu));
    return null;
  }
  GpuAllocation gpuAllocation=null;
  List gpuTypeList=null;
  if (nodeGpuType != null && !nodeGpuType.trim().isEmpty()) {
    gpuTypeList=Arrays.asList(nodeGpuType.split("String_Node_Str"));
  }
  for (  Map.Entry<String,Node> entry : candidateRequestNodes.entrySet()) {
    LOGGER.logDebug("String_Node_Str" + entry.getValue().toString());
    if (nodeLabel != null) {
      Set<String> nodeLabels=entry.getValue().getNodeLabels();
      if (nodeLabels != null && nodeLabels.size() > 0 && !nodeLabels.contains(nodeLabel)) {
        LOGGER.logDebug("String_Node_Str",entry.getValue().getHostName(),CommonExtensions.toString(nodeLabels),nodeLabel);
        continue;
      }
    }
    if (gpuTypeList != null) {
      if (nodes.size() > 0) {
        if (!nodes.containsKey(entry.getValue().getHostName())) {
          LOGGER.logWarning("String_Node_Str",entry.getValue().getHostName());
          continue;
        }
        String gpuType=(nodes.get(entry.getValue().getHostName())).getGpuType();
        if (!gpuTypeList.contains(gpuType)) {
          LOGGER.logDebug("String_Node_Str",entry.getValue().getHostName(),gpuType,nodeGpuType);
          continue;
        }
      }
 else {
        LOGGER.logWarning("String_Node_Str");
      }
    }
    if (request.getMemoryMB() <= entry.getValue().getAvailableMemory() && request.getCpuNumber() <= entry.getValue().getAvailableCpu() && request.getGpuNumber() <= entry.getValue().getAvailableNumGpus()) {
      if (request.getGpuNumber() > 0) {
        Long candidateGpu=requestGpu;
        if (candidateGpu > 0) {
          if ((candidateGpu & entry.getValue().getNodeGpuStatus()) != candidateGpu)           continue;
        }
 else {
          candidateGpu=selectCandidateGpu(entry.getValue(),request.getGpuNumber());
          if (Long.bitCount(candidateGpu) != request.getGpuNumber()) {
            continue;
          }
        }
        gpuAllocation=new GpuAllocation();
        gpuAllocation.setNodeName(entry.getValue().getHostName());
        gpuAllocation.setGpuBitmap(candidateGpu);
        break;
      }
    }
  }
  if (gpuAllocation != null) {
    LOGGER.logInfo("String_Node_Str" + gpuAllocation.getNodeName() + "String_Node_Str"+ Long.toBinaryString(gpuAllocation.getGpuBitmap()));
  }
 else {
    LOGGER.logInfo("String_Node_Str");
  }
  return gpuAllocation;
}