Program: 112927
Project: 112927
Buggy source:
@Override public RecordWriter<GeoWaveOutputKey<Object>,Object> getRecordWriter(final TaskAttemptContext context) throws IOException, InterruptedException {
  try {
    final Map<String,String> configOptions=getStoreOptionsMap(context);
    final AdapterStore persistentAdapterStore=GeoWaveStoreFinder.createAdapterStore(configOptions);
    final DataAdapter<?>[] adapters=JobContextAdapterStore.getDataAdapters(context);
    for (    final DataAdapter<?> a : adapters) {
      if (!persistentAdapterStore.adapterExists(a.getAdapterId())) {
        persistentAdapterStore.addAdapter(a);
      }
    }
    final IndexStore persistentIndexStore=GeoWaveStoreFinder.createIndexStore(configOptions);
    final Index[] indices=JobContextIndexStore.getIndices(context);
    if (LOGGER.isDebugEnabled()) {
      final StringBuilder sbDebug=new StringBuilder();
      sbDebug.append("String_Node_Str");
      for (      final Map.Entry<String,String> entry : configOptions.entrySet()) {
        sbDebug.append(entry.getKey() + "String_Node_Str" + entry.getValue()+ "String_Node_Str");
      }
      sbDebug.append("String_Node_Str" + indices.length);
      sbDebug.append("String_Node_Str" + persistentIndexStore);
      final String filename="String_Node_Str";
      final InputStream is=context.getClass().getResourceAsStream(filename);
      if (is == null) {
        sbDebug.append("String_Node_Str" + filename + "String_Node_Str");
      }
 else {
        sbDebug.append("String_Node_Str" + IOUtils.toString(is,"String_Node_Str"));
      }
      LOGGER.debug(sbDebug.toString());
    }
    for (    final Index i : indices) {
      if (!persistentIndexStore.indexExists(i.getId())) {
        persistentIndexStore.addIndex(i);
      }
    }
    final AdapterStore jobContextAdapterStore=new JobContextAdapterStore(context,persistentAdapterStore);
    final IndexStore jobContextIndexStore=new JobContextIndexStore(context,persistentIndexStore);
    final DataStore dataStore=GeoWaveStoreFinder.createDataStore(configOptions);
    return new GeoWaveRecordWriter(context,dataStore,jobContextIndexStore,jobContextAdapterStore);
  }
 catch (  final Exception e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
@Override public RecordWriter<GeoWaveOutputKey<Object>,Object> getRecordWriter(final TaskAttemptContext context) throws IOException, InterruptedException {
  try {
    final Map<String,String> configOptions=getStoreOptionsMap(context);
    final AdapterStore persistentAdapterStore=GeoWaveStoreFinder.createAdapterStore(configOptions);
    final DataAdapter<?>[] adapters=JobContextAdapterStore.getDataAdapters(context);
    for (    final DataAdapter<?> a : adapters) {
      if (!persistentAdapterStore.adapterExists(a.getAdapterId())) {
        persistentAdapterStore.addAdapter(a);
      }
    }
    final IndexStore persistentIndexStore=GeoWaveStoreFinder.createIndexStore(configOptions);
    final Index[] indices=JobContextIndexStore.getIndices(context);
    if (LOGGER.isDebugEnabled()) {
      final StringBuilder sbDebug=new StringBuilder();
      sbDebug.append("String_Node_Str");
      for (      final Map.Entry<String,String> entry : configOptions.entrySet()) {
        sbDebug.append(entry.getKey() + "String_Node_Str" + entry.getValue()+ "String_Node_Str");
      }
      sbDebug.append("String_Node_Str" + indices.length);
      sbDebug.append("String_Node_Str" + persistentIndexStore);
      final String filename="String_Node_Str";
      final InputStream is=context.getClass().getResourceAsStream(filename);
      if (is == null) {
        sbDebug.append("String_Node_Str" + filename + "String_Node_Str");
      }
 else {
        sbDebug.append("String_Node_Str" + IOUtils.toString(is,"String_Node_Str"));
        is.close();
      }
      LOGGER.debug(sbDebug.toString());
    }
    for (    final Index i : indices) {
      if (!persistentIndexStore.indexExists(i.getId())) {
        persistentIndexStore.addIndex(i);
      }
    }
    final AdapterStore jobContextAdapterStore=new JobContextAdapterStore(context,persistentAdapterStore);
    final IndexStore jobContextIndexStore=new JobContextIndexStore(context,persistentIndexStore);
    final DataStore dataStore=GeoWaveStoreFinder.createDataStore(configOptions);
    return new GeoWaveRecordWriter(context,dataStore,jobContextIndexStore,jobContextAdapterStore);
  }
 catch (  final Exception e) {
    throw new IOException(e);
  }
}