Program: 113084
Project: 113084
Buggy source:
/** 
 * Main method to execute the MapReduce analytic.
 */
@SuppressWarnings("String_Node_Str") public int runJob() throws Exception {
  final Configuration conf=super.getConf();
  GeoWaveConfiguratorBase.setRemoteInvocationParams(kdeCommandLineOptions.getHdfsHostPort(),kdeCommandLineOptions.getJobTrackerOrResourceManHostPort(),conf);
  conf.setInt(MAX_LEVEL_KEY,kdeCommandLineOptions.getMaxLevel());
  conf.setInt(MIN_LEVEL_KEY,kdeCommandLineOptions.getMinLevel());
  conf.set(COVERAGE_NAME_KEY,kdeCommandLineOptions.getCoverageName());
  conf.setInt(TILE_SIZE_KEY,kdeCommandLineOptions.getTileSize());
  if (kdeCommandLineOptions.getCqlFilter() != null) {
    conf.set(GaussianCellMapper.CQL_FILTER_KEY,kdeCommandLineOptions.getCqlFilter());
  }
  preJob1Setup(conf);
  final Job job=new Job(conf);
  job.setJarByClass(this.getClass());
  addJobClasspathDependencies(job,conf);
  job.setJobName(getJob1Name());
  job.setMapperClass(getJob1Mapper());
  job.setCombinerClass(CellSummationCombiner.class);
  job.setReducerClass(getJob1Reducer());
  job.setMapOutputKeyClass(LongWritable.class);
  job.setMapOutputValueClass(DoubleWritable.class);
  job.setOutputKeyClass(DoubleWritable.class);
  job.setOutputValueClass(LongWritable.class);
  job.setInputFormatClass(GeoWaveInputFormat.class);
  job.setOutputFormatClass(SequenceFileOutputFormat.class);
  job.setNumReduceTasks(8);
  job.setSpeculativeExecution(false);
  final AdapterStore adapterStore=inputAdapterStoreOptions.createStore();
  GeoWaveInputFormat.addDataAdapter(job.getConfiguration(),adapterStore.getAdapter(new ByteArrayId(kdeCommandLineOptions.getFeatureType())));
  GeoWaveInputFormat.setMinimumSplitCount(job.getConfiguration(),kdeCommandLineOptions.getMinSplits());
  GeoWaveInputFormat.setMaximumSplitCount(job.getConfiguration(),kdeCommandLineOptions.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());
  if (kdeCommandLineOptions.getCqlFilter() != null) {
    final Filter filter=ECQL.toFilter(kdeCommandLineOptions.getCqlFilter());
    final Geometry bbox=(Geometry)filter.accept(ExtractGeometryFilterVisitor.GEOMETRY_VISITOR,null);
    if ((bbox != null) && !bbox.equals(GeometryUtils.infinity())) {
      GeoWaveInputFormat.setQuery(job.getConfiguration(),new SpatialQuery(bbox));
    }
  }
  final FileSystem fs=FileSystem.get(conf);
  fs.delete(new Path("String_Node_Str" + inputDataStoreOptions.getNamespace() + "String_Node_Str"+ kdeCommandLineOptions.getMinLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getMaxLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getCoverageName()),true);
  FileOutputFormat.setOutputPath(job,new Path("String_Node_Str" + inputDataStoreOptions.getNamespace() + "String_Node_Str"+ kdeCommandLineOptions.getMinLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getMaxLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getCoverageName()+ "String_Node_Str"));
  final boolean job1Success=job.waitForCompletion(true);
  boolean job2Success=false;
  boolean postJob2Success=false;
  if (job1Success) {
    setupEntriesPerLevel(job,conf);
    final Job statsReducer=new Job(conf);
    statsReducer.setJarByClass(this.getClass());
    addJobClasspathDependencies(statsReducer,conf);
    statsReducer.setJobName(getJob2Name());
    statsReducer.setMapperClass(IdentityMapper.class);
    statsReducer.setPartitionerClass(getJob2Partitioner());
    statsReducer.setReducerClass(getJob2Reducer());
    statsReducer.setNumReduceTasks(getJob2NumReducers((kdeCommandLineOptions.getMaxLevel() - kdeCommandLineOptions.getMinLevel()) + 1));
    statsReducer.setMapOutputKeyClass(DoubleWritable.class);
    statsReducer.setMapOutputValueClass(LongWritable.class);
    statsReducer.setOutputKeyClass(getJob2OutputKeyClass());
    statsReducer.setOutputValueClass(getJob2OutputValueClass());
    statsReducer.setInputFormatClass(SequenceFileInputFormat.class);
    statsReducer.setOutputFormatClass(getJob2OutputFormatClass());
    FileInputFormat.setInputPaths(statsReducer,new Path("String_Node_Str" + inputDataStoreOptions.getNamespace() + "String_Node_Str"+ kdeCommandLineOptions.getMinLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getMaxLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getCoverageName()+ "String_Node_Str"));
    setupJob2Output(conf,statsReducer,outputDataStoreOptions.getNamespace());
    job2Success=statsReducer.waitForCompletion(true);
    if (job2Success) {
      postJob2Success=postJob2Actions(conf,outputDataStoreOptions.getNamespace());
    }
  }
 else {
    job2Success=false;
  }
  fs.delete(new Path("String_Node_Str" + inputDataStoreOptions.getNamespace() + "String_Node_Str"+ kdeCommandLineOptions.getMinLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getMaxLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getCoverageName()),true);
  return (job1Success && job2Success && postJob2Success) ? 0 : 1;
}

Fixed version (ground truth):
/** 
 * Main method to execute the MapReduce analytic.
 */
@SuppressWarnings("String_Node_Str") public int runJob() throws Exception {
  Configuration conf=super.getConf();
  if (conf == null) {
    conf=new Configuration();
    setConf(conf);
  }
  GeoWaveConfiguratorBase.setRemoteInvocationParams(kdeCommandLineOptions.getHdfsHostPort(),kdeCommandLineOptions.getJobTrackerOrResourceManHostPort(),conf);
  conf.setInt(MAX_LEVEL_KEY,kdeCommandLineOptions.getMaxLevel());
  conf.setInt(MIN_LEVEL_KEY,kdeCommandLineOptions.getMinLevel());
  conf.set(COVERAGE_NAME_KEY,kdeCommandLineOptions.getCoverageName());
  conf.setInt(TILE_SIZE_KEY,kdeCommandLineOptions.getTileSize());
  if (kdeCommandLineOptions.getCqlFilter() != null) {
    conf.set(GaussianCellMapper.CQL_FILTER_KEY,kdeCommandLineOptions.getCqlFilter());
  }
  preJob1Setup(conf);
  final Job job=new Job(conf);
  job.setJarByClass(this.getClass());
  addJobClasspathDependencies(job,conf);
  job.setJobName(getJob1Name());
  job.setMapperClass(getJob1Mapper());
  job.setCombinerClass(CellSummationCombiner.class);
  job.setReducerClass(getJob1Reducer());
  job.setMapOutputKeyClass(LongWritable.class);
  job.setMapOutputValueClass(DoubleWritable.class);
  job.setOutputKeyClass(DoubleWritable.class);
  job.setOutputValueClass(LongWritable.class);
  job.setInputFormatClass(GeoWaveInputFormat.class);
  job.setOutputFormatClass(SequenceFileOutputFormat.class);
  job.setNumReduceTasks(8);
  job.setSpeculativeExecution(false);
  final AdapterStore adapterStore=inputAdapterStoreOptions.createStore();
  GeoWaveInputFormat.addDataAdapter(job.getConfiguration(),adapterStore.getAdapter(new ByteArrayId(kdeCommandLineOptions.getFeatureType())));
  GeoWaveInputFormat.setMinimumSplitCount(job.getConfiguration(),kdeCommandLineOptions.getMinSplits());
  GeoWaveInputFormat.setMaximumSplitCount(job.getConfiguration(),kdeCommandLineOptions.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());
  if (kdeCommandLineOptions.getCqlFilter() != null) {
    final Filter filter=ECQL.toFilter(kdeCommandLineOptions.getCqlFilter());
    final Geometry bbox=(Geometry)filter.accept(ExtractGeometryFilterVisitor.GEOMETRY_VISITOR,null);
    if ((bbox != null) && !bbox.equals(GeometryUtils.infinity())) {
      GeoWaveInputFormat.setQuery(job.getConfiguration(),new SpatialQuery(bbox));
    }
  }
  final FileSystem fs=FileSystem.get(conf);
  fs.delete(new Path("String_Node_Str" + inputDataStoreOptions.getNamespace() + "String_Node_Str"+ kdeCommandLineOptions.getMinLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getMaxLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getCoverageName()),true);
  FileOutputFormat.setOutputPath(job,new Path("String_Node_Str" + inputDataStoreOptions.getNamespace() + "String_Node_Str"+ kdeCommandLineOptions.getMinLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getMaxLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getCoverageName()+ "String_Node_Str"));
  final boolean job1Success=job.waitForCompletion(true);
  boolean job2Success=false;
  boolean postJob2Success=false;
  if (job1Success) {
    setupEntriesPerLevel(job,conf);
    final Job statsReducer=new Job(conf);
    statsReducer.setJarByClass(this.getClass());
    addJobClasspathDependencies(statsReducer,conf);
    statsReducer.setJobName(getJob2Name());
    statsReducer.setMapperClass(IdentityMapper.class);
    statsReducer.setPartitionerClass(getJob2Partitioner());
    statsReducer.setReducerClass(getJob2Reducer());
    statsReducer.setNumReduceTasks(getJob2NumReducers((kdeCommandLineOptions.getMaxLevel() - kdeCommandLineOptions.getMinLevel()) + 1));
    statsReducer.setMapOutputKeyClass(DoubleWritable.class);
    statsReducer.setMapOutputValueClass(LongWritable.class);
    statsReducer.setOutputKeyClass(getJob2OutputKeyClass());
    statsReducer.setOutputValueClass(getJob2OutputValueClass());
    statsReducer.setInputFormatClass(SequenceFileInputFormat.class);
    statsReducer.setOutputFormatClass(getJob2OutputFormatClass());
    FileInputFormat.setInputPaths(statsReducer,new Path("String_Node_Str" + inputDataStoreOptions.getNamespace() + "String_Node_Str"+ kdeCommandLineOptions.getMinLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getMaxLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getCoverageName()+ "String_Node_Str"));
    setupJob2Output(conf,statsReducer,outputDataStoreOptions.getNamespace());
    job2Success=statsReducer.waitForCompletion(true);
    if (job2Success) {
      postJob2Success=postJob2Actions(conf,outputDataStoreOptions.getNamespace());
    }
  }
 else {
    job2Success=false;
  }
  fs.delete(new Path("String_Node_Str" + inputDataStoreOptions.getNamespace() + "String_Node_Str"+ kdeCommandLineOptions.getMinLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getMaxLevel()+ "String_Node_Str"+ kdeCommandLineOptions.getCoverageName()),true);
  return (job1Success && job2Success && postJob2Success) ? 0 : 1;
}