Program: 39416
Project: 39416
Buggy source:
private synchronized LinkedBlockingQueue<IAtomContainer> submitMultiThreadedJob(List<IAtomContainer> mcssList,JobType jobType,int nThreads){
  int taskNumber=1;
  LinkedBlockingQueue<IAtomContainer> solutions=new LinkedBlockingQueue<>();
  LinkedBlockingQueue<Callable<LinkedBlockingQueue<IAtomContainer>>> callablesQueue=new LinkedBlockingQueue<>();
  ExecutorService threadPool=Executors.newFixedThreadPool(nThreads);
  int step=(int)Math.ceil((double)mcssList.size() / (double)nThreads);
  if (step < 2) {
    step=2;
  }
  for (int i=0; i < mcssList.size(); i+=step) {
    int endPoint=i + step;
    if (endPoint > mcssList.size()) {
      endPoint=mcssList.size();
    }
    List<IAtomContainer> subList=new ArrayList<>(mcssList.subList(i,endPoint));
    if (subList.size() > 1) {
      MCSSThread mcssJobThread=new MCSSThread(subList,jobType,taskNumber,matchBonds,matchRings,matchAtomType);
      callablesQueue.add(mcssJobThread);
      taskNumber++;
    }
 else {
      solutions.add(subList.get(0));
    }
  }
  try {
    List<Future<LinkedBlockingQueue<IAtomContainer>>> futureList=threadPool.invokeAll(callablesQueue);
    for (Iterator<Future<LinkedBlockingQueue<IAtomContainer>>> it=futureList.iterator(); it.hasNext(); ) {
      Future<LinkedBlockingQueue<IAtomContainer>> callable=it.next();
      LinkedBlockingQueue<IAtomContainer> mapping=callable.get();
      if (callable.isDone() && mapping != null) {
        solutions.addAll(mapping);
      }
 else {
        logger.warn("String_Node_Str");
      }
    }
    threadPool.shutdown();
    while (!threadPool.isTerminated()) {
    }
    System.gc();
  }
 catch (  InterruptedException|ExecutionException e) {
    logger.debug("String_Node_Str" + e.getMessage());
    logger.error(e);
  }
 finally {
    threadPool.shutdown();
  }
  return solutions;
}

Fixed version (ground truth):
private synchronized LinkedBlockingQueue<IAtomContainer> submitMultiThreadedJob(List<IAtomContainer> mcssList,JobType jobType,int nThreads){
  int taskNumber=1;
  LinkedBlockingQueue<IAtomContainer> solutions=new LinkedBlockingQueue<>();
  LinkedBlockingQueue<Callable<LinkedBlockingQueue<IAtomContainer>>> callablesQueue=new LinkedBlockingQueue<>();
  ExecutorService threadPool=Executors.newFixedThreadPool(nThreads);
  int step=(int)Math.ceil((double)mcssList.size() / (double)nThreads);
  if (step < 2) {
    step=2;
  }
  for (int i=0; i < mcssList.size(); i+=step) {
    int endPoint=i + step;
    if (endPoint > mcssList.size()) {
      endPoint=mcssList.size();
    }
    List<IAtomContainer> subList=new ArrayList<>(mcssList.subList(i,endPoint));
    if (subList.size() > 1) {
      MCSSThread mcssJobThread=new MCSSThread(subList,jobType,taskNumber,matchBonds,matchRings,matchAtomType);
      callablesQueue.add(mcssJobThread);
      taskNumber++;
    }
 else {
      solutions.add(subList.get(0));
    }
  }
  try {
    List<Future<LinkedBlockingQueue<IAtomContainer>>> futureList=threadPool.invokeAll(callablesQueue);
    for (    Future<LinkedBlockingQueue<IAtomContainer>> callable : futureList) {
      LinkedBlockingQueue<IAtomContainer> mapping=callable.get();
      if (callable.isDone() && mapping != null) {
        solutions.addAll(mapping);
      }
 else {
        logger.warn("String_Node_Str");
      }
    }
    threadPool.shutdown();
    while (!threadPool.isTerminated()) {
    }
    System.gc();
  }
 catch (  InterruptedException|ExecutionException e) {
    logger.debug("String_Node_Str" + e.getMessage());
    logger.error(e);
  }
 finally {
    threadPool.shutdown();
  }
  return solutions;
}