Program: 40746
Project: 40746
Buggy source:
public static int run(String[] args) throws IOException, CmdLineException, ClassNotFoundException, InterruptedException {
  AdmmOptimizerDriverArguments admmOptimizerDriverArguments=new AdmmOptimizerDriverArguments();
  parseArgs(args,admmOptimizerDriverArguments);
  String signalDataLocation=admmOptimizerDriverArguments.getSignalPath();
  Path finalOutputBasePath=new Path(admmOptimizerDriverArguments.getOutputPath());
  String intermediateHdfsBaseString=finalOutputBasePath.toString() + "String_Node_Str";
  int iterationsMaximum=Optional.fromNullable(admmOptimizerDriverArguments.getIterationsMaximum()).or(DEFAULT_ADMM_ITERATIONS_MAX);
  float regularizationFactor=Optional.fromNullable(admmOptimizerDriverArguments.getRegularizationFactor()).or(DEFAULT_REGULARIZATION_FACTOR);
  boolean addIntercept=Optional.fromNullable(admmOptimizerDriverArguments.getAddIntercept()).or(false);
  boolean regularizeIntercept=Optional.fromNullable(admmOptimizerDriverArguments.getRegularizeIntercept()).or(false);
  int iterationNumber=0;
  boolean isFinalIteration=false;
  Configuration conf=new Configuration();
  conf.set("String_Node_Str","String_Node_Str");
  conf.setInt("String_Node_Str",6000000);
  conf.setInt("String_Node_Str",4096);
  conf.setInt("String_Node_Str",4096);
  FileSystem fs=finalOutputBasePath.getFileSystem(conf);
  HadoopUtil.delete(conf,finalOutputBasePath);
  while (!isFinalIteration) {
    long preStatus=0;
    Path previousHdfsResultsPath=new Path(intermediateHdfsBaseString + ITERATION_FOLDER_NAME + (iterationNumber - 1));
    Path currentHdfsResultsPath=new Path(intermediateHdfsBaseString + ITERATION_FOLDER_NAME + iterationNumber);
    long curStatus=doAdmmIteration(conf,previousHdfsResultsPath,currentHdfsResultsPath,new Path(signalDataLocation),iterationNumber,addIntercept,regularizeIntercept,regularizationFactor);
    isFinalIteration=convergedOrMaxed(curStatus,preStatus,iterationNumber,iterationsMaximum);
    if (isFinalIteration) {
      Path finalOutput=new Path(finalOutputBasePath,ITERATION_FOLDER_NAME_FINAL);
      fs.delete(finalOutput,true);
      fs.rename(currentHdfsResultsPath,finalOutput);
      Path finalOutputBetas=new Path(finalOutputBasePath,BETAS_FOLDER_NAME);
      AdmmResultWriter writer=new AdmmResultWriterBetas();
      writer.write(conf,fs,finalOutput,finalOutputBetas);
    }
    iterationNumber++;
  }
  return 0;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static int run(Path signalData,Path output,Float regularizationFactor,Boolean addIntercept,Boolean regularizeIntercept,Integer iterationsMaximum,Configuration baseConf) throws IOException, ClassNotFoundException, InterruptedException {
  Configuration conf=new Configuration(baseConf);
  float thisRegularizationFactor=null == regularizationFactor ? DEFAULT_REGULARIZATION_FACTOR : regularizationFactor;
  boolean thisAddIntercept=null == addIntercept ? true : addIntercept;
  boolean thisRegularizeIntercept=null == regularizeIntercept ? false : regularizeIntercept;
  int thisIterationsMaximum=null == iterationsMaximum ? DEFAULT_ADMM_ITERATIONS_MAX : iterationsMaximum;
  int iterationNumber=0;
  boolean isFinalIteration=false;
  conf.set("String_Node_Str","String_Node_Str");
  conf.setInt("String_Node_Str",6000000);
  conf.setInt("String_Node_Str",4096);
  conf.setInt("String_Node_Str",4096);
  FileSystem fs=output.getFileSystem(conf);
  HadoopUtil.delete(conf,output);
  String intermediateHdfsBaseString=output.toString() + "String_Node_Str";
  while (!isFinalIteration) {
    long preStatus=0;
    Path previousHdfsResultsPath=new Path(intermediateHdfsBaseString + ITERATION_FOLDER_NAME + (iterationNumber - 1));
    Path currentHdfsResultsPath=new Path(intermediateHdfsBaseString + ITERATION_FOLDER_NAME + iterationNumber);
    long curStatus=doAdmmIteration(conf,previousHdfsResultsPath,currentHdfsResultsPath,signalData,iterationNumber,thisAddIntercept,thisRegularizeIntercept,thisRegularizationFactor);
    isFinalIteration=convergedOrMaxed(curStatus,preStatus,iterationNumber,thisIterationsMaximum);
    if (isFinalIteration) {
      Path finalOutput=new Path(output,ITERATION_FOLDER_NAME_FINAL);
      fs.delete(finalOutput);
      fs.rename(currentHdfsResultsPath,finalOutput);
    }
    iterationNumber++;
  }
  return 0;
}