Program: 113019
Project: 113019
Buggy source:
@Override public void setup(final PropertyManagement runTimeProperties,final Configuration configuration) throws Exception {
  final DataStorePluginOptions dataStoreOptions=((PersistableStore)runTimeProperties.getProperty(StoreParam.STORE)).getDataStoreOptions();
  GeoWaveInputFormat.setDataStoreName(configuration,dataStoreOptions.getType());
  GeoWaveInputFormat.setStoreConfigOptions(configuration,dataStoreOptions.getFactoryOptionsAsMap());
  final String indexId=runTimeProperties.getPropertyAsString(ExtractParameters.Extract.INDEX_ID);
  final String adapterId=runTimeProperties.getPropertyAsString(ExtractParameters.Extract.ADAPTER_ID);
  if (indexId != null) {
    final PrimaryIndex[] indices=ClusteringUtils.getIndices(runTimeProperties);
    final ByteArrayId byteId=new ByteArrayId(StringUtils.stringToBinary(indexId));
    for (    final PrimaryIndex index : indices) {
      if (byteId.equals(index.getId())) {
        GeoWaveInputFormat.setIndex(configuration,index);
      }
    }
  }
  for (  final PrimaryIndex index : indices) {
    GeoWaveInputFormat.setIndex(configuration,index);
  }
  if (adapterId != null) {
    final DataAdapter<?>[] adapters=ClusteringUtils.getAdapters(runTimeProperties);
    final ByteArrayId byteId=new ByteArrayId(StringUtils.stringToBinary(adapterId));
    for (    final DataAdapter<?> adapter : adapters) {
      if (byteId.equals(adapter.getAdapterId())) {
        GeoWaveInputFormat.addDataAdapter(configuration,adapter);
      }
    }
  }
  for (  final DataAdapter<?> adapter : adapters) {
    GeoWaveInputFormat.addDataAdapter(configuration,adapter);
  }
  final DistributableQuery query=runTimeProperties.getPropertyAsQuery(ExtractParameters.Extract.QUERY);
  if (query != null) {
    GeoWaveInputFormat.setQuery(configuration,query);
  }
  final QueryOptions queryoptions=runTimeProperties.getPropertyAsQueryOptions(ExtractParameters.Extract.QUERY_OPTIONS);
  if (queryoptions != null) {
    GeoWaveInputFormat.setQueryOptions(configuration,queryoptions);
  }
  final int minInputSplits=runTimeProperties.getPropertyAsInt(ExtractParameters.Extract.MIN_INPUT_SPLIT,-1);
  if (minInputSplits > 0) {
    GeoWaveInputFormat.setMinimumSplitCount(configuration,minInputSplits);
  }
  final int maxInputSplits=runTimeProperties.getPropertyAsInt(ExtractParameters.Extract.MAX_INPUT_SPLIT,-1);
  if (maxInputSplits > 0) {
    GeoWaveInputFormat.setMaximumSplitCount(configuration,maxInputSplits);
  }
  GeoWaveInputFormat.setIsOutputWritable(configuration,isDataWritable);
}

Fixed version (ground truth):
@Override public void setup(final PropertyManagement runTimeProperties,final Configuration configuration) throws Exception {
  final DataStorePluginOptions dataStoreOptions=((PersistableStore)runTimeProperties.getProperty(StoreParam.INPUT_STORE)).getDataStoreOptions();
  GeoWaveInputFormat.setDataStoreName(configuration,dataStoreOptions.getType());
  GeoWaveInputFormat.setStoreConfigOptions(configuration,dataStoreOptions.getFactoryOptionsAsMap());
  final String indexId=runTimeProperties.getPropertyAsString(ExtractParameters.Extract.INDEX_ID);
  final String adapterId=runTimeProperties.getPropertyAsString(ExtractParameters.Extract.ADAPTER_ID);
  if (indexId != null) {
    final PrimaryIndex[] indices=ClusteringUtils.getIndices(runTimeProperties);
    final ByteArrayId byteId=new ByteArrayId(StringUtils.stringToBinary(indexId));
    for (    final PrimaryIndex index : indices) {
      if (byteId.equals(index.getId())) {
        GeoWaveInputFormat.setIndex(configuration,index);
      }
    }
  }
  for (  final PrimaryIndex index : indices) {
    GeoWaveInputFormat.setIndex(configuration,index);
  }
  if (adapterId != null) {
    final DataAdapter<?>[] adapters=ClusteringUtils.getAdapters(runTimeProperties);
    final ByteArrayId byteId=new ByteArrayId(StringUtils.stringToBinary(adapterId));
    for (    final DataAdapter<?> adapter : adapters) {
      if (byteId.equals(adapter.getAdapterId())) {
        GeoWaveInputFormat.addDataAdapter(configuration,adapter);
      }
    }
  }
  for (  final DataAdapter<?> adapter : adapters) {
    GeoWaveInputFormat.addDataAdapter(configuration,adapter);
  }
  final DistributableQuery query=runTimeProperties.getPropertyAsQuery(ExtractParameters.Extract.QUERY);
  if (query != null) {
    GeoWaveInputFormat.setQuery(configuration,query);
  }
  final QueryOptions queryoptions=runTimeProperties.getPropertyAsQueryOptions(ExtractParameters.Extract.QUERY_OPTIONS);
  if (queryoptions != null) {
    GeoWaveInputFormat.setQueryOptions(configuration,queryoptions);
  }
  final int minInputSplits=runTimeProperties.getPropertyAsInt(ExtractParameters.Extract.MIN_INPUT_SPLIT,-1);
  if (minInputSplits > 0) {
    GeoWaveInputFormat.setMinimumSplitCount(configuration,minInputSplits);
  }
  final int maxInputSplits=runTimeProperties.getPropertyAsInt(ExtractParameters.Extract.MAX_INPUT_SPLIT,-1);
  if (maxInputSplits > 0) {
    GeoWaveInputFormat.setMaximumSplitCount(configuration,maxInputSplits);
  }
  GeoWaveInputFormat.setIsOutputWritable(configuration,isDataWritable);
}