Program: 57601
Project: 57601
Buggy source:
/** 
 * Performs lookup for multiple keys and returns a streaming iterator to results. Each element in the iterator is one of (1) an exception associated with a single lookup (2) a key value tuple
 * @param keys      lookup keys
 * @param progress  (optional) an AtomicInteger for tracking progress
 * @param skipped   (optional) an AtomicInteger for tracking missing keys
 * @return          iterator of lookup results
 */
public Iterator<Either<Exception,P2<K,V>>> getStreaming(final @Nonnull Iterator<K> keys,final @Nullable AtomicInteger progress,final @Nullable AtomicInteger skipped){
  log.info("String_Node_Str");
  LongArrayList addressList=new LongArrayList();
  int notFound=0;
  while (keys.hasNext()) {
    final K key=keys.next();
    final Long address;
    try {
      address=index.get(key);
    }
 catch (    IOException e) {
      log.error("String_Node_Str",e);
      return Iterators.singletonIterator(Left.<Exception,P2<K,V>>of(new IndexReadException(e)));
    }
    if (address != null) {
      addressList.add(address);
    }
 else {
      notFound++;
    }
  }
  if (progress != null)   progress.addAndGet(notFound);
  if (skipped != null)   skipped.addAndGet(notFound);
  log.info("String_Node_Str");
  final long[] addresses=addressList.elements();
  Arrays.sort(addresses,0,addressList.size());
  log.info("String_Node_Str");
  final BlockingQueue<Runnable> taskQueue=new ArrayBlockingQueue<Runnable>(100);
  final Iterator<List<Long>> iterable=Iterators.partition(addressList.iterator(),1000);
  final ExecutorService primerThreads=new ThreadPoolExecutor(10,10,0L,TimeUnit.MILLISECONDS,taskQueue,new NamedThreadFactory("String_Node_Str",true,log),new RejectedExecutionHandler(){
    @Override public void rejectedExecution(    Runnable r,    ThreadPoolExecutor executor){
      try {
        taskQueue.put(r);
      }
 catch (      InterruptedException e) {
        log.error("String_Node_Str",e);
        throw new RuntimeException(e);
      }
    }
  }
);
  final BlockingQueue<List<Either<Exception,P2<K,V>>>> completionQueue=new ArrayBlockingQueue<List<Either<Exception,P2<K,V>>>>(10);
  final AtomicLong runningTasks=new AtomicLong(0);
  final AtomicBoolean taskSubmitterRunning=new AtomicBoolean(true);
  new Thread(new Runnable(){
    @Override public void run(){
      while (iterable.hasNext()) {
        runningTasks.incrementAndGet();
        final List<Long> addressesSublist=iterable.next();
        primerThreads.submit(new FutureTask<List<Either<Exception,P2<K,V>>>>(new RecordLookupTask(addressesSublist)){
          @Override protected void done(){
            try {
              completionQueue.put(get());
            }
 catch (            InterruptedException e) {
              log.error("String_Node_Str",e);
              throw new RuntimeException(e);
            }
catch (            ExecutionException e) {
              log.error("String_Node_Str",e);
              throw new RuntimeException(e);
            }
          }
        }
);
      }
      taskSubmitterRunning.set(false);
    }
  }
,"String_Node_Str").start();
  return new Iterator<Either<Exception,P2<K,V>>>(){
    Iterator<Either<Exception,P2<K,V>>> currentIterator;
    @Override public boolean hasNext(){
      if (currentIterator != null && currentIterator.hasNext())       return true;
      while (taskSubmitterRunning.get() || runningTasks.get() > 0) {
        try {
          final List<Either<Exception,P2<K,V>>> list=completionQueue.poll(1,TimeUnit.SECONDS);
          if (list != null) {
            log.debug("String_Node_Str" + runningTasks.decrementAndGet());
            currentIterator=list.iterator();
            if (currentIterator.hasNext())             return true;
          }
        }
 catch (        InterruptedException e) {
          log.error("String_Node_Str",e);
          throw new RuntimeException(e);
        }
      }
      primerThreads.shutdown();
      return false;
    }
    @Override public Either<Exception,P2<K,V>> next(){
      return currentIterator.next();
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Performs lookup for multiple keys and returns a streaming iterator to results. Each element in the iterator is one of (1) an exception associated with a single lookup (2) a key value tuple
 * @param keys      lookup keys
 * @param progress  (optional) an AtomicInteger for tracking progress
 * @param skipped   (optional) an AtomicInteger for tracking missing keys
 * @return          iterator of lookup results
 */
public Iterator<Either<Exception,P2<K,V>>> getStreaming(final @Nonnull Iterator<K> keys,final @Nullable AtomicInteger progress,final @Nullable AtomicInteger skipped){
  log.info("String_Node_Str");
  LongArrayList addressList=new LongArrayList();
  int notFound=0;
  while (keys.hasNext()) {
    final K key=keys.next();
    final Long address;
    try {
      address=index.get(key);
    }
 catch (    IOException e) {
      log.error("String_Node_Str",e);
      return Iterators.singletonIterator(Left.<Exception,P2<K,V>>of(new IndexReadException(e)));
    }
    if (address != null) {
      addressList.add(address);
    }
 else {
      notFound++;
    }
  }
  if (progress != null)   progress.addAndGet(notFound);
  if (skipped != null)   skipped.addAndGet(notFound);
  log.info("String_Node_Str");
  final long[] addresses=addressList.elements();
  Arrays.sort(addresses,0,addressList.size());
  log.info("String_Node_Str");
  final BlockingQueue<Runnable> taskQueue=new ArrayBlockingQueue<Runnable>(100);
  final Iterator<List<Long>> iterable=Iterators.partition(addressList.iterator(),1000);
  final ExecutorService primerThreads=new ThreadPoolExecutor(10,10,0L,TimeUnit.MILLISECONDS,taskQueue,new NamedThreadFactory("String_Node_Str",true,log),new RejectedExecutionHandler(){
    @Override public void rejectedExecution(    Runnable r,    ThreadPoolExecutor executor){
      try {
        taskQueue.put(r);
      }
 catch (      InterruptedException e) {
        log.error("String_Node_Str",e);
        throw new RuntimeException(e);
      }
    }
  }
);
  final BlockingQueue<List<Either<Exception,P2<K,V>>>> completionQueue=new ArrayBlockingQueue<List<Either<Exception,P2<K,V>>>>(10);
  final AtomicLong runningTasks=new AtomicLong(0);
  final AtomicBoolean taskSubmitterRunning=new AtomicBoolean(true);
  new Thread(new Runnable(){
    @Override public void run(){
      while (iterable.hasNext()) {
        runningTasks.incrementAndGet();
        final List<Long> addressesSublist=iterable.next();
        primerThreads.submit(new FutureTask<List<Either<Exception,P2<K,V>>>>(new RecordLookupTask(addressesSublist)){
          @Override protected void done(){
            try {
              final List<Either<Exception,P2<K,V>>> results=get();
              if (progress != null) {
                progress.addAndGet(results.size());
              }
              completionQueue.put(results);
            }
 catch (            InterruptedException e) {
              log.error("String_Node_Str",e);
              throw new RuntimeException(e);
            }
catch (            ExecutionException e) {
              log.error("String_Node_Str",e);
              throw new RuntimeException(e);
            }
          }
        }
);
      }
      taskSubmitterRunning.set(false);
    }
  }
,"String_Node_Str").start();
  return new Iterator<Either<Exception,P2<K,V>>>(){
    Iterator<Either<Exception,P2<K,V>>> currentIterator;
    @Override public boolean hasNext(){
      if (currentIterator != null && currentIterator.hasNext())       return true;
      while (taskSubmitterRunning.get() || runningTasks.get() > 0) {
        try {
          final List<Either<Exception,P2<K,V>>> list=completionQueue.poll(1,TimeUnit.SECONDS);
          if (list != null) {
            log.debug("String_Node_Str" + runningTasks.decrementAndGet());
            currentIterator=list.iterator();
            if (currentIterator.hasNext())             return true;
          }
        }
 catch (        InterruptedException e) {
          log.error("String_Node_Str",e);
          throw new RuntimeException(e);
        }
      }
      primerThreads.shutdown();
      return false;
    }
    @Override public Either<Exception,P2<K,V>> next(){
      return currentIterator.next();
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}