Program: 17285
Project: 17285
Buggy source:
@Override public Void call() throws Exception {
  while (numCompletedInputs.get() < numInputs) {
    if (numRunningFetchers.get() >= numFetchers || pendingHosts.size() == 0) {
      lock.lock();
      try {
        wakeLoop.await();
      }
  finally {
        lock.unlock();
      }
    }
    if (shuffleError != null) {
      break;
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + numCompletedInputs);
    }
    if (numCompletedInputs.get() < numInputs) {
      lock.lock();
      try {
        int numFetchersToRun=Math.min(pendingHosts.size(),numFetchers - numRunningFetchers.get());
        int count=0;
        while (pendingHosts.peek() != null) {
          InputHost inputHost=pendingHosts.take();
          if (LOG.isDebugEnabled()) {
            LOG.debug("String_Node_Str" + inputHost);
          }
          if (inputHost.getNumPendingInputs() > 0) {
            LOG.info("String_Node_Str" + inputHost);
            Fetcher fetcher=constructFetcherForHost(inputHost);
            numRunningFetchers.incrementAndGet();
            ListenableFuture<FetchResult> future=fetcherExecutor.submit(fetcher);
            Futures.addCallback(future,fetchFutureCallback);
            if (++count >= numFetchersToRun) {
              break;
            }
          }
 else {
            if (LOG.isDebugEnabled()) {
              LOG.debug("String_Node_Str" + inputHost.getHost() + "String_Node_Str");
            }
          }
        }
      }
  finally {
        lock.unlock();
      }
    }
  }
  LOG.info("String_Node_Str");
  if (!fetcherExecutor.isShutdown()) {
    fetcherExecutor.shutdownNow();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void call() throws Exception {
  while (numCompletedInputs.get() < numInputs) {
    if (numRunningFetchers.get() >= numFetchers || pendingHosts.size() == 0) {
      lock.lock();
      try {
        wakeLoop.await();
      }
  finally {
        lock.unlock();
      }
    }
    if (shuffleError != null) {
      break;
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + numCompletedInputs);
    }
    if (numCompletedInputs.get() < numInputs) {
      lock.lock();
      try {
        int maxFetchersToRun=numFetchers - numRunningFetchers.get();
        int count=0;
        while (pendingHosts.peek() != null) {
          InputHost inputHost=pendingHosts.take();
          if (LOG.isDebugEnabled()) {
            LOG.debug("String_Node_Str" + inputHost.toDetailedString());
          }
          if (inputHost.getNumPendingInputs() > 0) {
            LOG.info("String_Node_Str" + inputHost.getHost());
            Fetcher fetcher=constructFetcherForHost(inputHost);
            numRunningFetchers.incrementAndGet();
            ListenableFuture<FetchResult> future=fetcherExecutor.submit(fetcher);
            Futures.addCallback(future,fetchFutureCallback);
            if (++count >= maxFetchersToRun) {
              break;
            }
          }
 else {
            if (LOG.isDebugEnabled()) {
              LOG.debug("String_Node_Str" + inputHost.getHost() + "String_Node_Str");
            }
          }
        }
      }
  finally {
        lock.unlock();
      }
    }
  }
  LOG.info("String_Node_Str");
  if (!fetcherExecutor.isShutdown()) {
    fetcherExecutor.shutdownNow();
  }
  return null;
}