Program: 113074
Project: 113074
Buggy source:
@Override protected void processFile(final File file,final String typeName,final LocalFileIngestPlugin<?> plugin,final LocalIngestRunData ingestRunData) throws IOException {
  LOGGER.info(String.format("String_Node_Str",file.getName()));
  final String[] dimensionTypes=ingestOptions.getDimensionalityTypes();
  final Map<ByteArrayId,PrimaryIndex> specifiedPrimaryIndexes=new HashMap<ByteArrayId,PrimaryIndex>();
  for (  final String dimensionType : dimensionTypes) {
    final PrimaryIndex primaryIndex=IngestUtils.getIndex(plugin,ingestRunData.getArgs(),dimensionType);
    if (primaryIndex == null) {
      LOGGER.error("String_Node_Str");
      throw new IOException("String_Node_Str");
    }
    specifiedPrimaryIndexes.put(primaryIndex.getId(),primaryIndex);
  }
  final Map<ByteArrayId,PrimaryIndex> requiredIndexMap=new HashMap<ByteArrayId,PrimaryIndex>();
  final PrimaryIndex[] requiredIndices=plugin.getRequiredIndices();
  if ((requiredIndices != null) && (requiredIndices.length > 0)) {
    for (    final PrimaryIndex requiredIndex : requiredIndices) {
      requiredIndexMap.put(requiredIndex.getId(),requiredIndex);
    }
  }
  BlockingQueue<GeoWaveData<?>> queue=LocalIngestRunData.createBlockingQueue(INGEST_BATCH_SIZE);
  LOGGER.debug(String.format("String_Node_Str",localInput.getThreads(),file.getName()));
  List<IngestTask> ingestTasks=new ArrayList<IngestTask>();
  try {
    for (int i=0; i < localInput.getThreads(); i++) {
      IngestTask task=new IngestTask(ingestRunData,specifiedPrimaryIndexes,requiredIndexMap,queue);
      ingestTasks.add(task);
      ingestExecutor.submit(task);
    }
    try (CloseableIterator<?> geowaveDataIt=plugin.toGeoWaveData(file,specifiedPrimaryIndexes.keySet(),ingestOptions.getVisibility())){
      while (geowaveDataIt.hasNext()) {
        final GeoWaveData<?> geowaveData=(GeoWaveData<?>)geowaveDataIt.next();
        try {
          queue.put(geowaveData);
        }
 catch (        InterruptedException e) {
          throw new RuntimeException("String_Node_Str");
        }
      }
    }
   }
  finally {
    for (    IngestTask task : ingestTasks) {
      task.terminate();
    }
  }
  LOGGER.info(String.format("String_Node_Str",file.getName()));
}

Fixed version (ground truth):
@Override protected void processFile(final File file,final String typeName,final LocalFileIngestPlugin<?> plugin,final LocalIngestRunData ingestRunData) throws IOException {
  LOGGER.info(String.format("String_Node_Str",file.getName()));
  final String[] dimensionTypes=ingestOptions.getDimensionalityTypes();
  final Map<ByteArrayId,PrimaryIndex> specifiedPrimaryIndexes=new HashMap<ByteArrayId,PrimaryIndex>();
  for (  final String dimensionType : dimensionTypes) {
    final PrimaryIndex primaryIndex=IngestUtils.getIndex(plugin,ingestRunData.getArgs(),dimensionType);
    if (primaryIndex == null) {
      LOGGER.error("String_Node_Str");
      throw new IOException("String_Node_Str");
    }
    specifiedPrimaryIndexes.put(primaryIndex.getId(),primaryIndex);
  }
  final Map<ByteArrayId,PrimaryIndex> requiredIndexMap=new HashMap<ByteArrayId,PrimaryIndex>();
  final PrimaryIndex[] requiredIndices=plugin.getRequiredIndices();
  if ((requiredIndices != null) && (requiredIndices.length > 0)) {
    for (    final PrimaryIndex requiredIndex : requiredIndices) {
      requiredIndexMap.put(requiredIndex.getId(),requiredIndex);
    }
  }
  BlockingQueue<GeoWaveData<?>> queue=LocalIngestRunData.createBlockingQueue(INGEST_BATCH_SIZE);
  LOGGER.debug(String.format("String_Node_Str",localInput.getThreads(),file.getName()));
  List<IngestTask> ingestTasks=new ArrayList<IngestTask>();
  try {
    for (int i=0; i < localInput.getThreads(); i++) {
      String id=String.format("String_Node_Str",file.getName(),i);
      IngestTask task=new IngestTask(id,ingestRunData,specifiedPrimaryIndexes,requiredIndexMap,queue);
      ingestTasks.add(task);
      ingestExecutor.submit(task);
    }
    try (CloseableIterator<?> geowaveDataIt=plugin.toGeoWaveData(file,specifiedPrimaryIndexes.keySet(),ingestOptions.getVisibility())){
      while (geowaveDataIt.hasNext()) {
        final GeoWaveData<?> geowaveData=(GeoWaveData<?>)geowaveDataIt.next();
        try {
          while (!queue.offer(geowaveData,1,TimeUnit.SECONDS)) {
            boolean workerAlive=false;
            for (            IngestTask task : ingestTasks) {
              if (!task.isFinished()) {
                workerAlive=true;
                break;
              }
            }
            if (workerAlive) {
              LOGGER.debug("String_Node_Str");
            }
 else {
              String message="String_Node_Str";
              LOGGER.error(message);
              throw new RuntimeException(message);
            }
          }
        }
 catch (        InterruptedException e) {
          throw new RuntimeException("String_Node_Str");
        }
      }
    }
   }
  finally {
    for (    IngestTask task : ingestTasks) {
      task.terminate();
    }
  }
  LOGGER.info(String.format("String_Node_Str",file.getName()));
}