Program: 113085
Project: 113085
Buggy source:
/** 
 * Main method to execute the MapReduce analytic.
 */
public int runJob() throws Exception {
  final Configuration conf=super.getConf();
  GeoWaveConfiguratorBase.setRemoteInvocationParams(rasterResizeOptions.getHdfsHostPort(),rasterResizeOptions.getJobTrackerOrResourceManHostPort(),conf);
  conf.set(OLD_ADAPTER_ID_KEY,rasterResizeOptions.getInputCoverageName());
  conf.set(NEW_ADAPTER_ID_KEY,rasterResizeOptions.getOutputCoverageName());
  final Job job=new Job(conf);
  job.setJarByClass(this.getClass());
  job.setJobName("String_Node_Str" + rasterResizeOptions.getInputCoverageName() + "String_Node_Str"+ rasterResizeOptions.getOutputTileSize());
  job.setMapperClass(RasterTileResizeMapper.class);
  job.setCombinerClass(RasterTileResizeCombiner.class);
  job.setReducerClass(RasterTileResizeReducer.class);
  job.setInputFormatClass(GeoWaveInputFormat.class);
  job.setOutputFormatClass(GeoWaveOutputFormat.class);
  job.setMapOutputKeyClass(GeoWaveInputKey.class);
  job.setMapOutputValueClass(ObjectWritable.class);
  job.setOutputKeyClass(GeoWaveOutputKey.class);
  job.setOutputValueClass(GridCoverage.class);
  job.setNumReduceTasks(8);
  GeoWaveInputFormat.setMinimumSplitCount(job.getConfiguration(),rasterResizeOptions.getMinSplits());
  GeoWaveInputFormat.setMaximumSplitCount(job.getConfiguration(),rasterResizeOptions.getMaxSplits());
  GeoWaveInputFormat.setDataStoreName(job.getConfiguration(),inputDataStoreOptions.getFactory().getName());
  GeoWaveInputFormat.setStoreConfigOptions(job.getConfiguration(),ConfigUtils.valuesToStrings(inputDataStoreOptions.getConfigOptions(),inputDataStoreOptions.getFactory().getOptions()));
  GeoWaveInputFormat.setGeoWaveNamespace(job.getConfiguration(),inputDataStoreOptions.getNamespace());
  final DataAdapter adapter=inputAdapterStoreOptions.createStore().getAdapter(new ByteArrayId(rasterResizeOptions.getInputCoverageName()));
  if (adapter == null) {
    throw new IllegalArgumentException("String_Node_Str" + rasterResizeOptions.getInputCoverageName() + "String_Node_Str"+ inputAdapterStoreOptions.getNamespace()+ "String_Node_Str");
  }
  final RasterDataAdapter newAdapter=new RasterDataAdapter((RasterDataAdapter)adapter,rasterResizeOptions.getOutputCoverageName(),rasterResizeOptions.getOutputTileSize(),new NoDataMergeStrategy());
  JobContextAdapterStore.addDataAdapter(job.getConfiguration(),adapter);
  JobContextAdapterStore.addDataAdapter(job.getConfiguration(),newAdapter);
  PrimaryIndex index=null;
  final IndexStore indexStore=inputIndexStoreOptions.createStore();
  if (rasterResizeOptions.getIndexId() != null) {
    index=(PrimaryIndex)indexStore.getIndex(new ByteArrayId(rasterResizeOptions.getIndexId()));
  }
  if (index == null) {
    try (CloseableIterator<Index<?,?>> indices=indexStore.getIndices()){
      index=(PrimaryIndex)indices.next();
    }
     if (index == null) {
      throw new IllegalArgumentException("String_Node_Str" + inputIndexStoreOptions.getNamespace() + "String_Node_Str");
    }
  }
  GeoWaveOutputFormat.setDataStoreName(job.getConfiguration(),outputDataStoreOptions.getFactory().getName());
  GeoWaveOutputFormat.setStoreConfigOptions(job.getConfiguration(),ConfigUtils.valuesToStrings(outputDataStoreOptions.getConfigOptions(),outputDataStoreOptions.getFactory().getOptions()));
  GeoWaveOutputFormat.setGeoWaveNamespace(job.getConfiguration(),outputDataStoreOptions.getNamespace());
  JobContextIndexStore.addIndex(job.getConfiguration(),index);
  final DataStore store=outputDataStoreOptions.createStore();
  final IndexWriter writer=store.createIndexWriter(index,DataStoreUtils.DEFAULT_VISIBILITY);
  writer.setupAdapter(newAdapter);
  boolean retVal=false;
  try {
    retVal=job.waitForCompletion(true);
  }
 catch (  final IOException ex) {
    LOGGER.error("String_Node_Str",ex);
  }
 finally {
    writer.close();
  }
  return retVal ? 0 : 1;
}

Fixed version (ground truth):
/** 
 * Main method to execute the MapReduce analytic.
 */
public int runJob() throws Exception {
  Configuration conf=super.getConf();
  if (conf == null) {
    conf=new Configuration();
    setConf(conf);
  }
  GeoWaveConfiguratorBase.setRemoteInvocationParams(rasterResizeOptions.getHdfsHostPort(),rasterResizeOptions.getJobTrackerOrResourceManHostPort(),conf);
  conf.set(OLD_ADAPTER_ID_KEY,rasterResizeOptions.getInputCoverageName());
  conf.set(NEW_ADAPTER_ID_KEY,rasterResizeOptions.getOutputCoverageName());
  final Job job=new Job(conf);
  job.setJarByClass(this.getClass());
  job.setJobName("String_Node_Str" + rasterResizeOptions.getInputCoverageName() + "String_Node_Str"+ rasterResizeOptions.getOutputTileSize());
  job.setMapperClass(RasterTileResizeMapper.class);
  job.setCombinerClass(RasterTileResizeCombiner.class);
  job.setReducerClass(RasterTileResizeReducer.class);
  job.setInputFormatClass(GeoWaveInputFormat.class);
  job.setOutputFormatClass(GeoWaveOutputFormat.class);
  job.setMapOutputKeyClass(GeoWaveInputKey.class);
  job.setMapOutputValueClass(ObjectWritable.class);
  job.setOutputKeyClass(GeoWaveOutputKey.class);
  job.setOutputValueClass(GridCoverage.class);
  job.setNumReduceTasks(8);
  GeoWaveInputFormat.setMinimumSplitCount(job.getConfiguration(),rasterResizeOptions.getMinSplits());
  GeoWaveInputFormat.setMaximumSplitCount(job.getConfiguration(),rasterResizeOptions.getMaxSplits());
  GeoWaveInputFormat.setDataStoreName(job.getConfiguration(),inputDataStoreOptions.getFactory().getName());
  GeoWaveInputFormat.setStoreConfigOptions(job.getConfiguration(),ConfigUtils.valuesToStrings(inputDataStoreOptions.getConfigOptions(),inputDataStoreOptions.getFactory().getOptions()));
  GeoWaveInputFormat.setGeoWaveNamespace(job.getConfiguration(),inputDataStoreOptions.getNamespace());
  final DataAdapter adapter=inputAdapterStoreOptions.createStore().getAdapter(new ByteArrayId(rasterResizeOptions.getInputCoverageName()));
  if (adapter == null) {
    throw new IllegalArgumentException("String_Node_Str" + rasterResizeOptions.getInputCoverageName() + "String_Node_Str"+ inputAdapterStoreOptions.getNamespace()+ "String_Node_Str");
  }
  final RasterDataAdapter newAdapter=new RasterDataAdapter((RasterDataAdapter)adapter,rasterResizeOptions.getOutputCoverageName(),rasterResizeOptions.getOutputTileSize(),new NoDataMergeStrategy());
  JobContextAdapterStore.addDataAdapter(job.getConfiguration(),adapter);
  JobContextAdapterStore.addDataAdapter(job.getConfiguration(),newAdapter);
  PrimaryIndex index=null;
  final IndexStore indexStore=inputIndexStoreOptions.createStore();
  if (rasterResizeOptions.getIndexId() != null) {
    index=(PrimaryIndex)indexStore.getIndex(new ByteArrayId(rasterResizeOptions.getIndexId()));
  }
  if (index == null) {
    try (CloseableIterator<Index<?,?>> indices=indexStore.getIndices()){
      index=(PrimaryIndex)indices.next();
    }
     if (index == null) {
      throw new IllegalArgumentException("String_Node_Str" + inputIndexStoreOptions.getNamespace() + "String_Node_Str");
    }
  }
  GeoWaveOutputFormat.setDataStoreName(job.getConfiguration(),outputDataStoreOptions.getFactory().getName());
  GeoWaveOutputFormat.setStoreConfigOptions(job.getConfiguration(),ConfigUtils.valuesToStrings(outputDataStoreOptions.getConfigOptions(),outputDataStoreOptions.getFactory().getOptions()));
  GeoWaveOutputFormat.setGeoWaveNamespace(job.getConfiguration(),outputDataStoreOptions.getNamespace());
  JobContextIndexStore.addIndex(job.getConfiguration(),index);
  final DataStore store=outputDataStoreOptions.createStore();
  final IndexWriter writer=store.createIndexWriter(index,DataStoreUtils.DEFAULT_VISIBILITY);
  writer.setupAdapter(newAdapter);
  boolean retVal=false;
  try {
    retVal=job.waitForCompletion(true);
  }
 catch (  final IOException ex) {
    LOGGER.error("String_Node_Str",ex);
  }
 finally {
    writer.close();
  }
  return retVal ? 0 : 1;
}