Program: 89995
Project: 89995
Buggy source:
private Cluster getCluster(final JobRequest jobRequest) throws GenieException {
  final long start=System.nanoTime();
  try {
    log.info("String_Node_Str",jobRequest.getId().orElse(NO_ID_FOUND));
    final List<Cluster> clusters=ImmutableList.copyOf(this.clusterService.chooseClusterForJobRequest(jobRequest));
    Cluster cluster=null;
    if (clusters.isEmpty()) {
      throw new GeniePreconditionException("String_Node_Str");
    }
 else     if (clusters.size() == 1) {
      cluster=clusters.get(0);
    }
 else {
      for (      final ClusterLoadBalancer loadBalancer : this.clusterLoadBalancers) {
        final String loadBalancerClass=loadBalancer.getClass().getCanonicalName();
        try {
          final Cluster selectedCluster=loadBalancer.selectCluster(clusters,jobRequest);
          if (selectedCluster != null) {
            if (clusters.contains(selectedCluster)) {
              log.debug("String_Node_Str",selectedCluster.getId().orElse(NO_ID_FOUND),loadBalancerClass);
              this.registry.counter(this.loadBalancerId.withTag(LOAD_BALANCER_CLASS_TAG,loadBalancerClass).withTag(LOAD_BALANCER_STATUS_TAG,LOAD_BALANCER_STATUS_SUCCESS)).increment();
              cluster=selectedCluster;
              break;
            }
 else {
              log.error("String_Node_Str" + "String_Node_Str",selectedCluster.getId().orElse(NO_ID_FOUND),loadBalancerClass,clusters);
              this.registry.counter(this.loadBalancerId.withTag(LOAD_BALANCER_CLASS_TAG,loadBalancerClass).withTag(LOAD_BALANCER_STATUS_TAG,LOAD_BALANCER_STATUS_INVALID)).increment();
            }
          }
 else {
            this.registry.counter(this.loadBalancerId.withTag(LOAD_BALANCER_CLASS_TAG,loadBalancerClass).withTag(LOAD_BALANCER_STATUS_TAG,LOAD_BALANCER_STATUS_NO_PREFERENCE)).increment();
          }
        }
 catch (        final Exception e) {
          log.error("String_Node_Str",loadBalancer,e);
          this.registry.counter(this.loadBalancerId.withTag(LOAD_BALANCER_CLASS_TAG,loadBalancerClass).withTag(LOAD_BALANCER_STATUS_TAG,LOAD_BALANCER_STATUS_EXCEPTION)).increment();
        }
      }
      if (cluster == null) {
        this.noClusterFoundCounter.increment();
        throw new GeniePreconditionException("String_Node_Str");
      }
    }
    log.info("String_Node_Str",cluster.getId().orElse(NO_ID_FOUND),jobRequest.getId().orElse(NO_ID_FOUND));
    return cluster;
  }
  finally {
    this.selectClusterTimer.record(System.nanoTime() - start,TimeUnit.NANOSECONDS);
  }
}

Fixed version (ground truth):
private Cluster getCluster(final JobRequest jobRequest) throws GenieException {
  final long start=System.nanoTime();
  try {
    log.info("String_Node_Str",jobRequest.getId().orElse(NO_ID_FOUND));
    final List<Cluster> clusters=ImmutableList.copyOf(this.clusterService.chooseClusterForJobRequest(jobRequest));
    Cluster cluster=null;
    if (clusters.isEmpty()) {
      throw new GeniePreconditionException("String_Node_Str");
    }
 else     if (clusters.size() == 1) {
      cluster=clusters.get(0);
    }
 else {
      for (      final ClusterLoadBalancer loadBalancer : this.clusterLoadBalancers) {
        final String loadBalancerClass=(loadBalancer instanceof TargetClassAware ? ((TargetClassAware)loadBalancer).getTargetClass() : loadBalancer.getClass()).getCanonicalName();
        try {
          final Cluster selectedCluster=loadBalancer.selectCluster(clusters,jobRequest);
          if (selectedCluster != null) {
            if (clusters.contains(selectedCluster)) {
              log.debug("String_Node_Str",selectedCluster.getId().orElse(NO_ID_FOUND),loadBalancerClass);
              this.registry.counter(this.loadBalancerId.withTag(LOAD_BALANCER_CLASS_TAG,loadBalancerClass).withTag(LOAD_BALANCER_STATUS_TAG,LOAD_BALANCER_STATUS_SUCCESS)).increment();
              cluster=selectedCluster;
              break;
            }
 else {
              log.error("String_Node_Str" + "String_Node_Str",selectedCluster.getId().orElse(NO_ID_FOUND),loadBalancerClass,clusters);
              this.registry.counter(this.loadBalancerId.withTag(LOAD_BALANCER_CLASS_TAG,loadBalancerClass).withTag(LOAD_BALANCER_STATUS_TAG,LOAD_BALANCER_STATUS_INVALID)).increment();
            }
          }
 else {
            this.registry.counter(this.loadBalancerId.withTag(LOAD_BALANCER_CLASS_TAG,loadBalancerClass).withTag(LOAD_BALANCER_STATUS_TAG,LOAD_BALANCER_STATUS_NO_PREFERENCE)).increment();
          }
        }
 catch (        final Exception e) {
          log.error("String_Node_Str",loadBalancer,e);
          this.registry.counter(this.loadBalancerId.withTag(LOAD_BALANCER_CLASS_TAG,loadBalancerClass).withTag(LOAD_BALANCER_STATUS_TAG,LOAD_BALANCER_STATUS_EXCEPTION)).increment();
        }
      }
      if (cluster == null) {
        this.noClusterFoundCounter.increment();
        throw new GeniePreconditionException("String_Node_Str");
      }
    }
    log.info("String_Node_Str",cluster.getId().orElse(NO_ID_FOUND),jobRequest.getId().orElse(NO_ID_FOUND));
    return cluster;
  }
  finally {
    this.selectClusterTimer.record(System.nanoTime() - start,TimeUnit.NANOSECONDS);
  }
}