nus-yam/ex-repair huggingface dataset:
Program: 61297
Project: 61297
Buggy source:
@Override protected void processLine(String line,FastByIDMap<?> rawData){
  FastByIDMap<Collection<Preference>> data=(FastByIDMap<Collection<Preference>>)rawData;
  String[] jokePrefs=line.split("String_Node_Str");
  int count=Integer.parseInt(jokePrefs[0]);
  Collection<Preference> prefs=new ArrayList<Preference>(count);
  for (int itemID=1; itemID < jokePrefs.length; itemID++) {
    String jokePref=jokePrefs[itemID];
    if (!"String_Node_Str".equals(jokePref)) {
      float jokePrefValue=Float.parseFloat(jokePref);
      prefs.add(new GenericPreference(userBeingRead,itemID,jokePrefValue));
    }
  }
  data.put(userBeingRead,prefs);
  userBeingRead++;
}

Fixed version (ground truth):
@Override protected void processLine(String line,FastByIDMap<?> rawData,boolean fromPriorData){
  FastByIDMap<Collection<Preference>> data=(FastByIDMap<Collection<Preference>>)rawData;
  String[] jokePrefs=line.split("String_Node_Str");
  int count=Integer.parseInt(jokePrefs[0]);
  Collection<Preference> prefs=new ArrayList<Preference>(count);
  for (int itemID=1; itemID < jokePrefs.length; itemID++) {
    String jokePref=jokePrefs[itemID];
    if (!"String_Node_Str".equals(jokePref)) {
      float jokePrefValue=Float.parseFloat(jokePref);
      prefs.add(new GenericPreference(userBeingRead,itemID,jokePrefValue));
    }
  }
  data.put(userBeingRead,prefs);
  userBeingRead++;
}
Program: 61298
Project: 61298
Buggy source:
@Override public void skip(int n){
  delegate.skip((int)(n / samplingRate));
}

Fixed version (ground truth):
@Override public void skip(int n){
  delegate.skip((int)(n / samplingRate));
  if (delegate.hasNext()) {
    next=delegate.next();
  }
 else {
    hasNext=false;
  }
}
Program: 61299
Project: 61299
Buggy source:
private void doNext(){
  int toSkip=0;
  while (SamplingLongPrimitiveIterator.r.nextDouble() >= samplingRate) {
    toSkip++;
  }
  if (toSkip > 0) {
    delegate.skip(toSkip);
  }
  boolean found=false;
  if (delegate.hasNext()) {
    next=delegate.next();
    found=true;
  }
  if (!found) {
    hasNext=false;
  }
}

Fixed version (ground truth):
private void doNext(){
  int toSkip=0;
  while (SamplingLongPrimitiveIterator.r.nextDouble() >= samplingRate) {
    toSkip++;
  }
  if (toSkip > 0) {
    delegate.skip(toSkip);
  }
  if (delegate.hasNext()) {
    next=delegate.next();
  }
 else {
    hasNext=false;
  }
}
Program: 61300
Project: 61300
Buggy source:
@Override public void configure(JobConf job){
  try {
    labelWeightSum.clear();
    Map<String,Double> labelWeightSumTemp=new HashMap<String,Double>();
    DefaultStringifier<Map<String,Double>> mapStringifier=new DefaultStringifier<Map<String,Double>>(job,GenericsUtil.getClass(labelWeightSumTemp));
    String labelWeightSumString=mapStringifier.toString(labelWeightSumTemp);
    labelWeightSumString=job.get("String_Node_Str",labelWeightSumString);
    labelWeightSumTemp=mapStringifier.fromString(labelWeightSumString);
    for (    String key : labelWeightSumTemp.keySet()) {
      this.labelWeightSum.put(key,labelWeightSumTemp.get(key));
    }
    DefaultStringifier<Double> stringifier=new DefaultStringifier<Double>(job,GenericsUtil.getClass(sigmaJSigmaK));
    String sigmaJSigmaKString=stringifier.toString(sigmaJSigmaK);
    sigmaJSigmaKString=job.get("String_Node_Str",sigmaJSigmaKString);
    sigmaJSigmaK=stringifier.fromString(sigmaJSigmaKString);
    String vocabCountString=stringifier.toString(vocabCount);
    vocabCountString=job.get("String_Node_Str",vocabCountString);
    vocabCount=stringifier.fromString(vocabCountString);
    Parameters params=Parameters.fromString(job.get("String_Node_Str","String_Node_Str"));
    alphaI=Double.valueOf(params.get("String_Node_Str","String_Node_Str"));
  }
 catch (  IOException ex) {
    log.warn(ex.toString(),ex);
  }
}

Fixed version (ground truth):
@Override public void configure(JobConf job){
  try {
    labelWeightSum.clear();
    Map<String,Double> labelWeightSumTemp=new HashMap<String,Double>();
    DefaultStringifier<Map<String,Double>> mapStringifier=new DefaultStringifier<Map<String,Double>>(job,GenericsUtil.getClass(labelWeightSumTemp));
    String labelWeightSumString=mapStringifier.toString(labelWeightSumTemp);
    labelWeightSumString=job.get("String_Node_Str",labelWeightSumString);
    labelWeightSumTemp=mapStringifier.fromString(labelWeightSumString);
    for (    Map.Entry<String,Double> stringDoubleEntry : labelWeightSumTemp.entrySet()) {
      this.labelWeightSum.put(stringDoubleEntry.getKey(),stringDoubleEntry.getValue());
    }
    DefaultStringifier<Double> stringifier=new DefaultStringifier<Double>(job,GenericsUtil.getClass(sigmaJSigmaK));
    String sigmaJSigmaKString=stringifier.toString(sigmaJSigmaK);
    sigmaJSigmaKString=job.get("String_Node_Str",sigmaJSigmaKString);
    sigmaJSigmaK=stringifier.fromString(sigmaJSigmaKString);
    String vocabCountString=stringifier.toString(vocabCount);
    vocabCountString=job.get("String_Node_Str",vocabCountString);
    vocabCount=stringifier.fromString(vocabCountString);
    Parameters params=Parameters.fromString(job.get("String_Node_Str","String_Node_Str"));
    alphaI=Double.valueOf(params.get("String_Node_Str","String_Node_Str"));
  }
 catch (  IOException ex) {
    log.warn(ex.toString(),ex);
  }
}
Program: 61301
Project: 61301
Buggy source:
@Override public void configure(JobConf job){
  try {
    labelWeightSum.clear();
    Map<String,Double> labelWeightSumTemp=new HashMap<String,Double>();
    DefaultStringifier<Map<String,Double>> mapStringifier=new DefaultStringifier<Map<String,Double>>(job,GenericsUtil.getClass(labelWeightSumTemp));
    String labelWeightSumString=mapStringifier.toString(labelWeightSumTemp);
    labelWeightSumString=job.get("String_Node_Str",labelWeightSumString);
    labelWeightSumTemp=mapStringifier.fromString(labelWeightSumString);
    for (    String key : labelWeightSumTemp.keySet()) {
      this.labelWeightSum.put(key,labelWeightSumTemp.get(key));
    }
    DefaultStringifier<Double> stringifier=new DefaultStringifier<Double>(job,GenericsUtil.getClass(sigmaJSigmaK));
    String sigmaJSigmaKString=stringifier.toString(sigmaJSigmaK);
    sigmaJSigmaKString=job.get("String_Node_Str",sigmaJSigmaKString);
    sigmaJSigmaK=stringifier.fromString(sigmaJSigmaKString);
    String vocabCountString=stringifier.toString(vocabCount);
    vocabCountString=job.get("String_Node_Str",vocabCountString);
    vocabCount=stringifier.fromString(vocabCountString);
    Parameters params=Parameters.fromString(job.get("String_Node_Str","String_Node_Str"));
    alphaI=Double.valueOf(params.get("String_Node_Str","String_Node_Str"));
  }
 catch (  IOException ex) {
    log.warn(ex.toString(),ex);
  }
}

Fixed version (ground truth):
@Override public void configure(JobConf job){
  try {
    labelWeightSum.clear();
    Map<String,Double> labelWeightSumTemp=new HashMap<String,Double>();
    DefaultStringifier<Map<String,Double>> mapStringifier=new DefaultStringifier<Map<String,Double>>(job,GenericsUtil.getClass(labelWeightSumTemp));
    String labelWeightSumString=mapStringifier.toString(labelWeightSumTemp);
    labelWeightSumString=job.get("String_Node_Str",labelWeightSumString);
    labelWeightSumTemp=mapStringifier.fromString(labelWeightSumString);
    for (    Map.Entry<String,Double> stringDoubleEntry : labelWeightSumTemp.entrySet()) {
      this.labelWeightSum.put(stringDoubleEntry.getKey(),stringDoubleEntry.getValue());
    }
    DefaultStringifier<Double> stringifier=new DefaultStringifier<Double>(job,GenericsUtil.getClass(sigmaJSigmaK));
    String sigmaJSigmaKString=stringifier.toString(sigmaJSigmaK);
    sigmaJSigmaKString=job.get("String_Node_Str",sigmaJSigmaKString);
    sigmaJSigmaK=stringifier.fromString(sigmaJSigmaKString);
    String vocabCountString=stringifier.toString(vocabCount);
    vocabCountString=job.get("String_Node_Str",vocabCountString);
    vocabCount=stringifier.fromString(vocabCountString);
    Parameters params=Parameters.fromString(job.get("String_Node_Str","String_Node_Str"));
    alphaI=Double.valueOf(params.get("String_Node_Str","String_Node_Str"));
  }
 catch (  IOException ex) {
    log.warn(ex.toString(),ex);
  }
}
Program: 61302
Project: 61302
Buggy source:
@Override public void configure(JobConf job){
  try {
    this.labelDocumentCounts.clear();
    Map<String,Double> labelDocCountTemp=new HashMap<String,Double>();
    DefaultStringifier<Map<String,Double>> mapStringifier=new DefaultStringifier<Map<String,Double>>(job,GenericsUtil.getClass(labelDocCountTemp));
    String labelDocumentCountString=mapStringifier.toString(labelDocCountTemp);
    labelDocumentCountString=job.get("String_Node_Str",labelDocumentCountString);
    labelDocCountTemp=mapStringifier.fromString(labelDocumentCountString);
    for (    String key : labelDocCountTemp.keySet()) {
      this.labelDocumentCounts.put(key,labelDocCountTemp.get(key));
    }
  }
 catch (  IOException ex) {
    log.warn(ex.toString(),ex);
  }
}

Fixed version (ground truth):
@Override public void configure(JobConf job){
  try {
    this.labelDocumentCounts.clear();
    Map<String,Double> labelDocCountTemp=new HashMap<String,Double>();
    DefaultStringifier<Map<String,Double>> mapStringifier=new DefaultStringifier<Map<String,Double>>(job,GenericsUtil.getClass(labelDocCountTemp));
    String labelDocumentCountString=mapStringifier.toString(labelDocCountTemp);
    labelDocumentCountString=job.get("String_Node_Str",labelDocumentCountString);
    labelDocCountTemp=mapStringifier.fromString(labelDocumentCountString);
    for (    Map.Entry<String,Double> stringDoubleEntry : labelDocCountTemp.entrySet()) {
      this.labelDocumentCounts.put(stringDoubleEntry.getKey(),stringDoubleEntry.getValue());
    }
  }
 catch (  IOException ex) {
    log.warn(ex.toString(),ex);
  }
}
Program: 61303
Project: 61303
Buggy source:
/** 
 * Configure the Canopy and its distance measure
 * @param job the JobConf for this job
 */
public void configure(JobConf job){
  try {
    measure=Class.forName(job.get(MeanShiftCanopyConfigKeys.DISTANCE_MEASURE_KEY)).asSubclass(DistanceMeasure.class).newInstance();
    measure.configure(job);
  }
 catch (  ClassNotFoundException e) {
    throw new IllegalStateException(e);
  }
catch (  IllegalAccessException e) {
    throw new IllegalStateException(e);
  }
catch (  InstantiationException e) {
    throw new IllegalStateException(e);
  }
  nextCanopyId=0;
  t1=Double.parseDouble(job.get(MeanShiftCanopyConfigKeys.T1_KEY));
  t2=Double.parseDouble(job.get(MeanShiftCanopyConfigKeys.T2_KEY));
  convergenceDelta=Double.parseDouble(job.get(MeanShiftCanopyConfigKeys.CLUSTER_CONVERGENCE_KEY));
}

Fixed version (ground truth):
/** 
 * Configure the Canopy and its distance measure
 * @param job the JobConf for this job
 */
public void configure(JobConf job){
  try {
    measure=Class.forName(job.get(MeanShiftCanopyConfigKeys.DISTANCE_MEASURE_KEY)).asSubclass(DistanceMeasure.class).newInstance();
    measure.configure(job);
  }
 catch (  ClassNotFoundException e) {
    throw new IllegalStateException(e);
  }
catch (  IllegalAccessException e) {
    throw new IllegalStateException(e);
  }
catch (  InstantiationException e) {
    throw new IllegalStateException(e);
  }
  t1=Double.parseDouble(job.get(MeanShiftCanopyConfigKeys.T1_KEY));
  t2=Double.parseDouble(job.get(MeanShiftCanopyConfigKeys.T2_KEY));
  convergenceDelta=Double.parseDouble(job.get(MeanShiftCanopyConfigKeys.CLUSTER_CONVERGENCE_KEY));
}
Program: 61304
Project: 61304
Buggy source:
/** 
 * Configure the Canopy for unit tests
 * @param aDelta the convergence criteria
 */
public void config(DistanceMeasure aMeasure,double aT1,double aT2,double aDelta){
  nextCanopyId=100;
  measure=aMeasure;
  t1=aT1;
  t2=aT2;
  convergenceDelta=aDelta;
}

Fixed version (ground truth):
/** 
 * Configure the Canopy for unit tests
 * @param aDelta the convergence criteria
 */
public void config(DistanceMeasure aMeasure,double aT1,double aT2,double aDelta){
  measure=aMeasure;
  t1=aT1;
  t2=aT2;
  convergenceDelta=aDelta;
}
Program: 61305
Project: 61305
Buggy source:
/** 
 * Extracts the output and processes it
 * @param job
 * @param callback
 * @throws IOException
 */
protected void parseOutput(JobConf job,PredictionCallback callback) throws IOException {
  int numMaps=job.getNumMapTasks();
  int numTrees=Builder.getNbTrees(job);
  int total=0;
  for (int partition=0; partition < numMaps; partition++) {
    total+=Step2Mapper.nbConcerned(numMaps,numTrees,partition);
  }
  int[] firstIds=Step0Output.extractFirstIds(partitions);
  PartialBuilder.processOutput(job,outputPath,firstIds,null,null,callback);
}

Fixed version (ground truth):
/** 
 * Extracts the output and processes it
 * @param job
 * @param callback
 * @throws IOException
 */
protected void parseOutput(JobConf job,PredictionCallback callback) throws IOException {
  int numMaps=job.getNumMapTasks();
  int numTrees=Builder.getNbTrees(job);
  for (int partition=0; partition < numMaps; partition++) {
    Step2Mapper.nbConcerned(numMaps,numTrees,partition);
  }
  int[] firstIds=Step0Output.extractFirstIds(partitions);
  PartialBuilder.processOutput(job,outputPath,firstIds,null,null,callback);
}
Program: 61306
Project: 61306
Buggy source:
protected static Map<String,String> parseArguments(String[] args,Option... extraOpts){
  Option inputOpt=DefaultOptionCreator.inputOption().create();
  Option tempDirOpt=AbstractJob.buildOption("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Option outputOpt=DefaultOptionCreator.outputOption().create();
  Option helpOpt=DefaultOptionCreator.helpOption();
  Option jarFileOpt=AbstractJob.buildOption("String_Node_Str","String_Node_Str","String_Node_Str");
  GroupBuilder gBuilder=new GroupBuilder().withName("String_Node_Str").withOption(inputOpt).withOption(tempDirOpt).withOption(outputOpt).withOption(helpOpt).withOption(jarFileOpt);
  for (  Option opt : extraOpts) {
    gBuilder=gBuilder.withOption(opt);
  }
  Group group=gBuilder.create();
  CommandLine cmdLine;
  try {
    Parser parser=new Parser();
    parser.setGroup(group);
    cmdLine=parser.parse(args);
  }
 catch (  OptionException e) {
    AbstractJob.log.error(e.getMessage());
    CommandLineUtil.printHelp(group);
    return null;
  }
  if (cmdLine.hasOption(helpOpt)) {
    CommandLineUtil.printHelp(group);
    return null;
  }
  Map<String,String> result=new HashMap<String,String>();
  AbstractJob.maybePut(result,cmdLine,inputOpt);
  AbstractJob.maybePut(result,cmdLine,tempDirOpt);
  AbstractJob.maybePut(result,cmdLine,outputOpt);
  AbstractJob.maybePut(result,cmdLine,helpOpt);
  AbstractJob.maybePut(result,cmdLine,jarFileOpt);
  for (  Option opt : extraOpts) {
    AbstractJob.maybePut(result,cmdLine,opt);
  }
  return result;
}

Fixed version (ground truth):
protected static Map<String,String> parseArguments(String[] args,Option... extraOpts){
  Option inputOpt=DefaultOptionCreator.inputOption().create();
  Option tempDirOpt=AbstractJob.buildOption("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Option outputOpt=DefaultOptionCreator.outputOption().create();
  Option helpOpt=DefaultOptionCreator.helpOption();
  Option jarFileOpt=AbstractJob.buildOption("String_Node_Str","String_Node_Str","String_Node_Str");
  GroupBuilder gBuilder=new GroupBuilder().withName("String_Node_Str").withOption(inputOpt).withOption(tempDirOpt).withOption(outputOpt).withOption(helpOpt).withOption(jarFileOpt);
  for (  Option opt : extraOpts) {
    gBuilder=gBuilder.withOption(opt);
  }
  Group group=gBuilder.create();
  CommandLine cmdLine;
  try {
    Parser parser=new Parser();
    parser.setGroup(group);
    cmdLine=parser.parse(args);
  }
 catch (  OptionException e) {
    log.error(e.getMessage());
    CommandLineUtil.printHelp(group);
    return null;
  }
  if (cmdLine.hasOption(helpOpt)) {
    CommandLineUtil.printHelp(group);
    return null;
  }
  Map<String,String> result=new HashMap<String,String>();
  AbstractJob.maybePut(result,cmdLine,inputOpt);
  AbstractJob.maybePut(result,cmdLine,tempDirOpt);
  AbstractJob.maybePut(result,cmdLine,outputOpt);
  AbstractJob.maybePut(result,cmdLine,helpOpt);
  AbstractJob.maybePut(result,cmdLine,jarFileOpt);
  for (  Option opt : extraOpts) {
    AbstractJob.maybePut(result,cmdLine,opt);
  }
  return result;
}
Program: 61307
Project: 61307
Buggy source:
@Override public int run(String[] args) throws IOException {
  if (args.length < 2) {
    ItemBigramGenerator.log.error("String_Node_Str");
    ToolRunner.printGenericCommandUsage(System.out);
    return -1;
  }
  String inputPaths=args[0];
  Path outputPath=new Path(args[1]);
  int reducers=args.length > 2 ? Integer.parseInt(args[2]) : 1;
  JobConf jobConf=prepareJob(inputPaths,outputPath,reducers);
  JobClient.runJob(jobConf);
  return 0;
}

Fixed version (ground truth):
@Override public int run(String[] args) throws IOException {
  if (args.length < 2) {
    log.error("String_Node_Str");
    ToolRunner.printGenericCommandUsage(System.out);
    return -1;
  }
  String inputPaths=args[0];
  Path outputPath=new Path(args[1]);
  int reducers=args.length > 2 ? Integer.parseInt(args[2]) : 1;
  JobConf jobConf=prepareJob(inputPaths,outputPath,reducers);
  JobClient.runJob(jobConf);
  return 0;
}
Program: 61308
Project: 61308
Buggy source:
@Override public void map(LongWritable lineNumber,Text userPrefEntry,OutputCollector<VIntWritable,VIntWritable> output,Reporter reporter) throws IOException {
  String userPrefLine=userPrefEntry.toString();
  String[] prefFields=userPrefLine.split(fieldSeparator);
  if (prefFields.length > 1) {
    try {
      int userId=Integer.parseInt(prefFields[0]);
      int itemId=Integer.parseInt(prefFields[1]);
      user.set(userId);
      item.set(itemId);
      output.collect(user,item);
    }
 catch (    NumberFormatException nfe) {
      reporter.incrCounter(Records.INVALID_IDS,1);
      UserItemMapper.log.warn("String_Node_Str",userPrefLine);
    }
catch (    IllegalArgumentException iae) {
      reporter.incrCounter(Records.INVALID_IDS,1);
      UserItemMapper.log.warn("String_Node_Str",userPrefLine);
    }
  }
 else {
    reporter.incrCounter(Records.INVALID_SCHEMA,1);
    UserItemMapper.log.warn("String_Node_Str",userPrefLine);
  }
}

Fixed version (ground truth):
@Override public void map(LongWritable lineNumber,Text userPrefEntry,OutputCollector<VIntWritable,VIntWritable> output,Reporter reporter) throws IOException {
  String userPrefLine=userPrefEntry.toString();
  String[] prefFields=userPrefLine.split(fieldSeparator);
  if (prefFields.length > 1) {
    try {
      int userId=Integer.parseInt(prefFields[0]);
      int itemId=Integer.parseInt(prefFields[1]);
      user.set(userId);
      item.set(itemId);
      output.collect(user,item);
    }
 catch (    NumberFormatException nfe) {
      reporter.incrCounter(Records.INVALID_IDS,1);
      log.warn("String_Node_Str",userPrefLine);
    }
catch (    IllegalArgumentException iae) {
      reporter.incrCounter(Records.INVALID_IDS,1);
      log.warn("String_Node_Str",userPrefLine);
    }
  }
 else {
    reporter.incrCounter(Records.INVALID_SCHEMA,1);
    log.warn("String_Node_Str",userPrefLine);
  }
}
Program: 61309
Project: 61309
Buggy source:
@Override public void map(VIntWritable item1,VIntWritable item2,OutputCollector<Bigram,Bigram> output,Reporter reporter) throws IOException {
  keyBigram.set(item1.get(),item2.get());
  valueBigram.set(item2.get(),ItemItemMapper.ONE);
  output.collect(keyBigram,valueBigram);
}

Fixed version (ground truth):
@Override public void map(VIntWritable item1,VIntWritable item2,OutputCollector<Bigram,Bigram> output,Reporter reporter) throws IOException {
  keyBigram.set(item1.get(),item2.get());
  valueBigram.set(item2.get(),ONE);
  output.collect(keyBigram,valueBigram);
}
Program: 61310
Project: 61310
Buggy source:
@Override public int run(String[] args) throws IOException {
  if (args.length < 3) {
    UserItemJoiner.log.error("String_Node_Str");
    ToolRunner.printGenericCommandUsage(System.out);
    return -1;
  }
  Path userInputPath=new Path(args[0]);
  Path itemInputPath=new Path(args[1]);
  Path outputPath=new Path(args[2]);
  int reducers=args.length > 3 ? Integer.parseInt(args[3]) : 1;
  JobConf jobConf=prepareJob(userInputPath,itemInputPath,outputPath,reducers);
  JobClient.runJob(jobConf);
  return 0;
}

Fixed version (ground truth):
@Override public int run(String[] args) throws IOException {
  if (args.length < 3) {
    log.error("String_Node_Str");
    ToolRunner.printGenericCommandUsage(System.out);
    return -1;
  }
  Path userInputPath=new Path(args[0]);
  Path itemInputPath=new Path(args[1]);
  Path outputPath=new Path(args[2]);
  int reducers=args.length > 3 ? Integer.parseInt(args[3]) : 1;
  JobConf jobConf=prepareJob(userInputPath,itemInputPath,outputPath,reducers);
  JobClient.runJob(jobConf);
  return 0;
}
Program: 61311
Project: 61311
Buggy source:
@Override public void configure(JobConf jobConf){
  try {
    FileSystem fs=FileSystem.get(jobConf);
    Path cooccurrencePath=new Path(jobConf.get(RecommenderMapper.COOCCURRENCE_PATH)).makeQualified(fs);
    Path itemIDIndexPath=new Path(jobConf.get(RecommenderMapper.ITEMID_INDEX_PATH)).makeQualified(fs);
    recommendationsPerUser=jobConf.getInt(RecommenderMapper.RECOMMENDATIONS_PER_USER,10);
    indexItemIDMap=new MapFilesMap<IntWritable,LongWritable>(fs,itemIDIndexPath,new Configuration());
    cooccurrenceColumnMap=new MapFilesMap<IntWritable,VectorWritable>(fs,cooccurrencePath,new Configuration());
    String usersFilePathString=jobConf.get(RecommenderMapper.USERS_FILE);
    if (usersFilePathString == null) {
      usersToRecommendFor=null;
    }
 else {
      usersToRecommendFor=new FastIDSet();
      Path usersFilePath=new Path(usersFilePathString).makeQualified(fs);
      FSDataInputStream in=fs.open(usersFilePath);
      for (      String line : new FileLineIterable(in)) {
        usersToRecommendFor.add(Long.parseLong(line));
      }
    }
  }
 catch (  IOException ioe) {
    throw new IllegalStateException(ioe);
  }
  cooccurrenceColumnCache=new Cache<IntWritable,Vector>(new CooccurrenceCache(cooccurrenceColumnMap),100);
}

Fixed version (ground truth):
@Override public void configure(JobConf jobConf){
  try {
    FileSystem fs=FileSystem.get(jobConf);
    Path cooccurrencePath=new Path(jobConf.get(COOCCURRENCE_PATH)).makeQualified(fs);
    Path itemIDIndexPath=new Path(jobConf.get(ITEMID_INDEX_PATH)).makeQualified(fs);
    recommendationsPerUser=jobConf.getInt(RECOMMENDATIONS_PER_USER,10);
    indexItemIDMap=new MapFilesMap<IntWritable,LongWritable>(fs,itemIDIndexPath,new Configuration());
    cooccurrenceColumnMap=new MapFilesMap<IntWritable,VectorWritable>(fs,cooccurrencePath,new Configuration());
    String usersFilePathString=jobConf.get(USERS_FILE);
    if (usersFilePathString == null) {
      usersToRecommendFor=null;
    }
 else {
      usersToRecommendFor=new FastIDSet();
      Path usersFilePath=new Path(usersFilePathString).makeQualified(fs);
      FSDataInputStream in=fs.open(usersFilePath);
      for (      String line : new FileLineIterable(in)) {
        usersToRecommendFor.add(Long.parseLong(line));
      }
    }
  }
 catch (  IOException ioe) {
    throw new IllegalStateException(ioe);
  }
  cooccurrenceColumnCache=new Cache<IntWritable,Vector>(new CooccurrenceCache(cooccurrenceColumnMap),100);
}
Program: 61312
Project: 61312
Buggy source:
@Override public void reduce(LongWritable userID,Iterator<ItemPrefWritable> itemPrefs,OutputCollector<LongWritable,VectorWritable> output,Reporter reporter) throws IOException {
  if (itemPrefs.hasNext()) {
    RandomAccessSparseVector userVector=new RandomAccessSparseVector(Integer.MAX_VALUE,100);
    while (itemPrefs.hasNext()) {
      ItemPrefWritable itemPref=itemPrefs.next();
      int index=ItemIDIndexMapper.idToIndex(itemPref.getItemID());
      userVector.set(index,itemPref.getPrefValue());
    }
    if (userVector.getNumNondefaultElements() > ToUserVectorReducer.MAX_PREFS_CONSIDERED) {
      double cutoff=ToUserVectorReducer.findTopNPrefsCutoff(ToUserVectorReducer.MAX_PREFS_CONSIDERED,userVector);
      RandomAccessSparseVector filteredVector=new RandomAccessSparseVector(Integer.MAX_VALUE,ToUserVectorReducer.MAX_PREFS_CONSIDERED);
      Iterator<Vector.Element> it=userVector.iterateNonZero();
      while (it.hasNext()) {
        Vector.Element element=it.next();
        if (element.get() >= cutoff) {
          filteredVector.set(element.index(),element.get());
        }
      }
      userVector=filteredVector;
    }
    vectorWritable.set(userVector);
    output.collect(userID,vectorWritable);
  }
}

Fixed version (ground truth):
@Override public void reduce(LongWritable userID,Iterator<ItemPrefWritable> itemPrefs,OutputCollector<LongWritable,VectorWritable> output,Reporter reporter) throws IOException {
  if (itemPrefs.hasNext()) {
    RandomAccessSparseVector userVector=new RandomAccessSparseVector(Integer.MAX_VALUE,100);
    while (itemPrefs.hasNext()) {
      ItemPrefWritable itemPref=itemPrefs.next();
      int index=ItemIDIndexMapper.idToIndex(itemPref.getItemID());
      userVector.set(index,itemPref.getPrefValue());
    }
    if (userVector.getNumNondefaultElements() > MAX_PREFS_CONSIDERED) {
      double cutoff=findTopNPrefsCutoff(MAX_PREFS_CONSIDERED,userVector);
      RandomAccessSparseVector filteredVector=new RandomAccessSparseVector(Integer.MAX_VALUE,MAX_PREFS_CONSIDERED);
      Iterator<Vector.Element> it=userVector.iterateNonZero();
      while (it.hasNext()) {
        Vector.Element element=it.next();
        if (element.get() >= cutoff) {
          filteredVector.set(element.index(),element.get());
        }
      }
      userVector=filteredVector;
    }
    vectorWritable.set(userVector);
    output.collect(userID,vectorWritable);
  }
}
Program: 61314
Project: 61314
Buggy source:
private void rehash(int newHashSize){
  long[] oldKeys=keys;
  V[] oldValues=values;
  numEntries=0;
  numSlotsUsed=0;
  if (countingAccesses) {
    recentlyAccessed=new BitSet(newHashSize);
  }
  keys=new long[newHashSize];
  Arrays.fill(keys,FastByIDMap.NULL);
  values=(V[])new Object[newHashSize];
  int length=oldKeys.length;
  for (int i=0; i < length; i++) {
    long key=oldKeys[i];
    if ((key != FastByIDMap.NULL) && (key != FastByIDMap.REMOVED)) {
      put(key,oldValues[i]);
    }
  }
}

Fixed version (ground truth):
private void rehash(int newHashSize){
  long[] oldKeys=keys;
  V[] oldValues=values;
  numEntries=0;
  numSlotsUsed=0;
  if (countingAccesses) {
    recentlyAccessed=new BitSet(newHashSize);
  }
  keys=new long[newHashSize];
  Arrays.fill(keys,NULL);
  values=(V[])new Object[newHashSize];
  int length=oldKeys.length;
  for (int i=0; i < length; i++) {
    long key=oldKeys[i];
    if ((key != NULL) && (key != REMOVED)) {
      put(key,oldValues[i]);
    }
  }
}
Program: 61315
Project: 61315
Buggy source:
public V put(long key,V value){
  if ((key == FastByIDMap.NULL) || (key == FastByIDMap.REMOVED)) {
    throw new IllegalArgumentException();
  }
  if (value == null) {
    throw new NullPointerException();
  }
  if (numSlotsUsed * FastByIDMap.ALLOWED_LOAD_FACTOR >= keys.length) {
    if (numEntries * FastByIDMap.ALLOWED_LOAD_FACTOR >= numSlotsUsed) {
      growAndRehash();
    }
 else {
      rehash();
    }
  }
  int index=findForAdd(key);
  long keyIndex=keys[index];
  if (keyIndex == key) {
    V oldValue=values[index];
    values[index]=value;
    return oldValue;
  }
 else {
    if (countingAccesses && (numEntries >= maxSize)) {
      clearStaleEntry(index);
    }
    keys[index]=key;
    values[index]=value;
    numEntries++;
    if (keyIndex == FastByIDMap.NULL) {
      numSlotsUsed++;
    }
    return null;
  }
}

Fixed version (ground truth):
public V put(long key,V value){
  if ((key == NULL) || (key == REMOVED)) {
    throw new IllegalArgumentException();
  }
  if (value == null) {
    throw new NullPointerException();
  }
  if (numSlotsUsed * ALLOWED_LOAD_FACTOR >= keys.length) {
    if (numEntries * ALLOWED_LOAD_FACTOR >= numSlotsUsed) {
      growAndRehash();
    }
 else {
      rehash();
    }
  }
  int index=findForAdd(key);
  long keyIndex=keys[index];
  if (keyIndex == key) {
    V oldValue=values[index];
    values[index]=value;
    return oldValue;
  }
 else {
    if (countingAccesses && (numEntries >= maxSize)) {
      clearStaleEntry(index);
    }
    keys[index]=key;
    values[index]=value;
    numEntries++;
    if (keyIndex == NULL) {
      numSlotsUsed++;
    }
    return null;
  }
}
Program: 61316
Project: 61316
Buggy source:
/** 
 * @see #findForAdd(long)
 */
private int find(long key){
  int theHashCode=(int)key & 0x7FFFFFFF;
  long[] keys=this.keys;
  int hashSize=keys.length;
  int jump=1 + theHashCode % (hashSize - 2);
  int index=theHashCode % hashSize;
  long currentKey=keys[index];
  while ((currentKey != FastByIDMap.NULL) && (key != currentKey)) {
    if (index < jump) {
      index+=hashSize - jump;
    }
 else {
      index-=jump;
    }
    currentKey=keys[index];
  }
  return index;
}

Fixed version (ground truth):
/** 
 * @see #findForAdd(long)
 */
private int find(long key){
  int theHashCode=(int)key & 0x7FFFFFFF;
  long[] keys=this.keys;
  int hashSize=keys.length;
  int jump=1 + theHashCode % (hashSize - 2);
  int index=theHashCode % hashSize;
  long currentKey=keys[index];
  while ((currentKey != NULL) && (key != currentKey)) {
    if (index < jump) {
      index+=hashSize - jump;
    }
 else {
      index-=jump;
    }
    currentKey=keys[index];
  }
  return index;
}
Program: 61317
Project: 61317
Buggy source:
public V get(long key){
  if (key == FastByIDMap.NULL) {
    return null;
  }
  int index=find(key);
  if (countingAccesses) {
    recentlyAccessed.set(index);
  }
  return values[index];
}

Fixed version (ground truth):
public V get(long key){
  if (key == NULL) {
    return null;
  }
  int index=find(key);
  if (countingAccesses) {
    recentlyAccessed.set(index);
  }
  return values[index];
}
Program: 61318
Project: 61318
Buggy source:
void iteratorRemove(int lastNext){
  if (lastNext >= values.length) {
    throw new NoSuchElementException();
  }
  if (lastNext < 0) {
    throw new IllegalStateException();
  }
  values[lastNext]=null;
  keys[lastNext]=FastByIDMap.REMOVED;
  numEntries--;
}

Fixed version (ground truth):
void iteratorRemove(int lastNext){
  if (lastNext >= values.length) {
    throw new NoSuchElementException();
  }
  if (lastNext < 0) {
    throw new IllegalStateException();
  }
  values[lastNext]=null;
  keys[lastNext]=REMOVED;
  numEntries--;
}
Program: 61319
Project: 61319
Buggy source:
private void clearStaleEntry(int index){
  while (true) {
    long currentKey;
    do {
      if (index == 0) {
        index=keys.length - 1;
      }
 else {
        index--;
      }
      currentKey=keys[index];
    }
 while ((currentKey == FastByIDMap.NULL) || (currentKey == FastByIDMap.REMOVED));
    if (recentlyAccessed.get(index)) {
      recentlyAccessed.clear(index);
    }
 else {
      break;
    }
  }
  keys[index]=FastByIDMap.REMOVED;
  numEntries--;
  values[index]=null;
}

Fixed version (ground truth):
private void clearStaleEntry(int index){
  while (true) {
    long currentKey;
    do {
      if (index == 0) {
        index=keys.length - 1;
      }
 else {
        index--;
      }
      currentKey=keys[index];
    }
 while ((currentKey == NULL) || (currentKey == REMOVED));
    if (recentlyAccessed.get(index)) {
      recentlyAccessed.clear(index);
    }
 else {
      break;
    }
  }
  keys[index]=REMOVED;
  numEntries--;
  values[index]=null;
}
Program: 61320
Project: 61320
Buggy source:
public boolean containsKey(long key){
  return (key != FastByIDMap.NULL) && (key != FastByIDMap.REMOVED) && (keys[find(key)] != FastByIDMap.NULL);
}

Fixed version (ground truth):
public boolean containsKey(long key){
  return (key != NULL) && (key != REMOVED) && (keys[find(key)] != NULL);
}
Program: 61321
Project: 61321
Buggy source:
@Override public boolean isEmpty(){
  return FastByIDMap.this.isEmpty();
}

Fixed version (ground truth):
@Override public boolean isEmpty(){
  return this.isEmpty();
}
Program: 61322
Project: 61322
Buggy source:
@Override public void clear(){
  FastByIDMap.this.clear();
}

Fixed version (ground truth):
@Override public void clear(){
  this.clear();
}
Program: 61323
Project: 61323
Buggy source:
/** 
 * Creates a new   {@link FastByIDMap} whose capacity can accommodate the given number of entries withoutrehash.</p>
 * @param size desired capacity
 * @param maxSize max capacity
 * @throws IllegalArgumentException if size is less than 0, maxSize is less than 1, or at least half of {@link RandomUtils#MAX_INT_SMALLER_TWIN_PRIME}
 */
public FastByIDMap(int size,int maxSize){
  if (size < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int max=(int)(RandomUtils.MAX_INT_SMALLER_TWIN_PRIME / FastByIDMap.ALLOWED_LOAD_FACTOR);
  if (size >= max) {
    throw new IllegalArgumentException("String_Node_Str" + max);
  }
  if (maxSize < 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int hashSize=RandomUtils.nextTwinPrime((int)(FastByIDMap.ALLOWED_LOAD_FACTOR * size));
  keys=new long[hashSize];
  Arrays.fill(keys,FastByIDMap.NULL);
  values=(V[])new Object[hashSize];
  this.maxSize=maxSize;
  this.countingAccesses=maxSize != Integer.MAX_VALUE;
  this.recentlyAccessed=countingAccesses ? new BitSet(hashSize) : null;
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link FastByIDMap} whose capacity can accommodate the given number of entries withoutrehash.</p>
 * @param size desired capacity
 * @param maxSize max capacity
 * @throws IllegalArgumentException if size is less than 0, maxSize is less than 1, or at least half of {@link RandomUtils#MAX_INT_SMALLER_TWIN_PRIME}
 */
public FastByIDMap(int size,int maxSize){
  if (size < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int max=(int)(RandomUtils.MAX_INT_SMALLER_TWIN_PRIME / ALLOWED_LOAD_FACTOR);
  if (size >= max) {
    throw new IllegalArgumentException("String_Node_Str" + max);
  }
  if (maxSize < 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int hashSize=RandomUtils.nextTwinPrime((int)(ALLOWED_LOAD_FACTOR * size));
  keys=new long[hashSize];
  Arrays.fill(keys,NULL);
  values=(V[])new Object[hashSize];
  this.maxSize=maxSize;
  this.countingAccesses=maxSize != Integer.MAX_VALUE;
  this.recentlyAccessed=countingAccesses ? new BitSet(hashSize) : null;
}
Program: 61324
Project: 61324
Buggy source:
@Override public int size(){
  return FastByIDMap.this.size();
}

Fixed version (ground truth):
@Override public int size(){
  return this.size();
}
Program: 61325
Project: 61325
Buggy source:
/** 
 * @see #find(long)
 */
private int findForAdd(long key){
  int theHashCode=(int)key & 0x7FFFFFFF;
  long[] keys=this.keys;
  int hashSize=keys.length;
  int jump=1 + theHashCode % (hashSize - 2);
  int index=theHashCode % hashSize;
  long currentKey=keys[index];
  while ((currentKey != FastByIDMap.NULL) && (currentKey != FastByIDMap.REMOVED) && (key != currentKey)) {
    if (index < jump) {
      index+=hashSize - jump;
    }
 else {
      index-=jump;
    }
    currentKey=keys[index];
  }
  return index;
}

Fixed version (ground truth):
/** 
 * @see #find(long)
 */
private int findForAdd(long key){
  int theHashCode=(int)key & 0x7FFFFFFF;
  long[] keys=this.keys;
  int hashSize=keys.length;
  int jump=1 + theHashCode % (hashSize - 2);
  int index=theHashCode % hashSize;
  long currentKey=keys[index];
  while ((currentKey != NULL) && (currentKey != REMOVED) && (key != currentKey)) {
    if (index < jump) {
      index+=hashSize - jump;
    }
 else {
      index-=jump;
    }
    currentKey=keys[index];
  }
  return index;
}
Program: 61326
Project: 61326
Buggy source:
@Override public String toString(){
  if (isEmpty()) {
    return "String_Node_Str";
  }
  StringBuilder result=new StringBuilder();
  result.append('{');
  for (int i=0; i < keys.length; i++) {
    long key=keys[i];
    if ((key != FastByIDMap.NULL) && (key != FastByIDMap.REMOVED)) {
      result.append(key).append('=').append(values[i]).append(',');
    }
  }
  result.setCharAt(result.length() - 1,'}');
  return result.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  if (isEmpty()) {
    return "String_Node_Str";
  }
  StringBuilder result=new StringBuilder();
  result.append('{');
  for (int i=0; i < keys.length; i++) {
    long key=keys[i];
    if ((key != NULL) && (key != REMOVED)) {
      result.append(key).append('=').append(values[i]).append(',');
    }
  }
  result.setCharAt(result.length() - 1,'}');
  return result.toString();
}
Program: 61327
Project: 61327
Buggy source:
private void growAndRehash(){
  if (keys.length * FastByIDMap.ALLOWED_LOAD_FACTOR >= RandomUtils.MAX_INT_SMALLER_TWIN_PRIME) {
    throw new IllegalStateException("String_Node_Str");
  }
  rehash(RandomUtils.nextTwinPrime((int)(FastByIDMap.ALLOWED_LOAD_FACTOR * keys.length)));
}

Fixed version (ground truth):
private void growAndRehash(){
  if (keys.length * ALLOWED_LOAD_FACTOR >= RandomUtils.MAX_INT_SMALLER_TWIN_PRIME) {
    throw new IllegalStateException("String_Node_Str");
  }
  rehash(RandomUtils.nextTwinPrime((int)(ALLOWED_LOAD_FACTOR * keys.length)));
}
Program: 61328
Project: 61328
Buggy source:
/** 
 * Adds the specified   {@link Refreshable} to the given collection of {@link Refreshable}s if it is not already there and immediately refreshes it.
 * @param alreadyRefreshed the collection of  {@link Refreshable}s
 * @param refreshable the  {@link Refreshable} to potentially add and refresh
 */
public static void maybeRefresh(Collection<Refreshable> alreadyRefreshed,Refreshable refreshable){
  if (!alreadyRefreshed.contains(refreshable)) {
    alreadyRefreshed.add(refreshable);
    RefreshHelper.log.info("String_Node_Str",refreshable);
    refreshable.refresh(alreadyRefreshed);
    RefreshHelper.log.info("String_Node_Str",alreadyRefreshed);
  }
}

Fixed version (ground truth):
/** 
 * Adds the specified   {@link Refreshable} to the given collection of {@link Refreshable}s if it is not already there and immediately refreshes it.
 * @param alreadyRefreshed the collection of  {@link Refreshable}s
 * @param refreshable the  {@link Refreshable} to potentially add and refresh
 */
public static void maybeRefresh(Collection<Refreshable> alreadyRefreshed,Refreshable refreshable){
  if (!alreadyRefreshed.contains(refreshable)) {
    alreadyRefreshed.add(refreshable);
    log.info("String_Node_Str",refreshable);
    refreshable.refresh(alreadyRefreshed);
    log.info("String_Node_Str",alreadyRefreshed);
  }
}
Program: 61329
Project: 61329
Buggy source:
/** 
 * Typically this is called in   {@link Refreshable#refresh(java.util.Collection)} and is the entire body ofthat method.
 */
@Override public void refresh(Collection<Refreshable> alreadyRefreshed){
  if (!refreshLock.isLocked()) {
    refreshLock.lock();
    try {
      alreadyRefreshed=RefreshHelper.buildRefreshed(alreadyRefreshed);
      for (      Refreshable dependency : dependencies) {
        RefreshHelper.maybeRefresh(alreadyRefreshed,dependency);
      }
      if (refreshRunnable != null) {
        try {
          refreshRunnable.call();
        }
 catch (        Exception e) {
          RefreshHelper.log.warn("String_Node_Str",e);
        }
      }
    }
  finally {
      refreshLock.unlock();
    }
  }
}

Fixed version (ground truth):
/** 
 * Typically this is called in   {@link Refreshable#refresh(java.util.Collection)} and is the entire body ofthat method.
 */
@Override public void refresh(Collection<Refreshable> alreadyRefreshed){
  if (!refreshLock.isLocked()) {
    refreshLock.lock();
    try {
      alreadyRefreshed=RefreshHelper.buildRefreshed(alreadyRefreshed);
      for (      Refreshable dependency : dependencies) {
        RefreshHelper.maybeRefresh(alreadyRefreshed,dependency);
      }
      if (refreshRunnable != null) {
        try {
          refreshRunnable.call();
        }
 catch (        Exception e) {
          log.warn("String_Node_Str",e);
        }
      }
    }
  finally {
      refreshLock.unlock();
    }
  }
}
Program: 61330
Project: 61330
Buggy source:
protected static void checkNotNullAndLog(String argName,Object[] values){
  if ((values == null) || (values.length == 0)) {
    throw new IllegalArgumentException(argName + "String_Node_Str");
  }
  for (  Object value : values) {
    AbstractJDBCComponent.checkNotNullAndLog(argName,value);
  }
}

Fixed version (ground truth):
protected static void checkNotNullAndLog(String argName,Object[] values){
  if ((values == null) || (values.length == 0)) {
    throw new IllegalArgumentException(argName + "String_Node_Str");
  }
  for (  Object value : values) {
    checkNotNullAndLog(argName,value);
  }
}
Program: 61331
Project: 61331
Buggy source:
/** 
 * <p> Looks up a   {@link DataSource} by name from JNDI. "java:comp/env/" is prepended to the argument beforelooking up the name in JNDI. </p>
 * @param dataSourceName JNDI name where a  {@link DataSource} is bound (e.g. "jdbc/taste")
 * @return {@link DataSource} under that JNDI name
 * @throws TasteException if a JNDI error occurs
 */
protected static DataSource lookupDataSource(String dataSourceName) throws TasteException {
  Context context=null;
  try {
    context=new InitialContext();
    return (DataSource)context.lookup("String_Node_Str" + dataSourceName);
  }
 catch (  NamingException ne) {
    throw new TasteException(ne);
  }
 finally {
    if (context != null) {
      try {
        context.close();
      }
 catch (      NamingException ne) {
        AbstractJDBCComponent.log.warn("String_Node_Str",ne);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * <p> Looks up a   {@link DataSource} by name from JNDI. "java:comp/env/" is prepended to the argument beforelooking up the name in JNDI. </p>
 * @param dataSourceName JNDI name where a  {@link DataSource} is bound (e.g. "jdbc/taste")
 * @return {@link DataSource} under that JNDI name
 * @throws TasteException if a JNDI error occurs
 */
protected static DataSource lookupDataSource(String dataSourceName) throws TasteException {
  Context context=null;
  try {
    context=new InitialContext();
    return (DataSource)context.lookup("String_Node_Str" + dataSourceName);
  }
 catch (  NamingException ne) {
    throw new TasteException(ne);
  }
 finally {
    if (context != null) {
      try {
        context.close();
      }
 catch (      NamingException ne) {
        log.warn("String_Node_Str",ne);
      }
    }
  }
}
Program: 61332
Project: 61332
Buggy source:
protected int getFetchSize(){
  return AbstractJDBCComponent.DEFAULT_FETCH_SIZE;
}

Fixed version (ground truth):
protected int getFetchSize(){
  return DEFAULT_FETCH_SIZE;
}
Program: 61333
Project: 61333
Buggy source:
public static void main(String[] args){
  RandomUtils.useTestSeed();
  generateSamples();
  new DisplayDirichlet();
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException, InvocationTargetException, NoSuchMethodException {
  RandomUtils.useTestSeed();
  generateSamples();
  new DisplayDirichlet();
}
Program: 61335
Project: 61335
Buggy source:
@Override public int run(String[] args) throws IOException {
  Option recommendClassOpt=buildOption("String_Node_Str","String_Node_Str","String_Node_Str");
  Option numReccomendationsOpt=buildOption("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Option usersFileOpt=buildOption("String_Node_Str","String_Node_Str","String_Node_Str",null);
  Map<String,String> parsedArgs=parseArguments(args,recommendClassOpt,numReccomendationsOpt,usersFileOpt);
  String inputFile=parsedArgs.get("String_Node_Str");
  String outputPath=parsedArgs.get("String_Node_Str");
  String jarFile=parsedArgs.get("String_Node_Str");
  String usersFile=parsedArgs.get("String_Node_Str");
  if (usersFile == null) {
    usersFile=inputFile;
  }
  String recommendClassName=parsedArgs.get("String_Node_Str");
  int recommendationsPerUser=Integer.parseInt(parsedArgs.get("String_Node_Str"));
  JobConf jobConf=prepareJobConf(usersFile,outputPath,jarFile,TextInputFormat.class,UserIDsMapper.class,LongWritable.class,NullWritable.class,RecommenderReducer.class,LongWritable.class,RecommendedItemsWritable.class,TextOutputFormat.class);
  jobConf.set(RecommenderReducer.RECOMMENDER_CLASS_NAME,recommendClassName);
  jobConf.setInt(RecommenderReducer.RECOMMENDATIONS_PER_USER,recommendationsPerUser);
  jobConf.set(RecommenderReducer.DATA_MODEL_FILE,inputFile);
  jobConf.set(RecommenderReducer.USERS_FILE,usersFile);
  jobConf.setClass("String_Node_Str",GzipCodec.class,CompressionCodec.class);
  JobClient.runJob(jobConf);
  return 0;
}

Fixed version (ground truth):
@Override public int run(String[] args) throws IOException {
  Option recommendClassOpt=buildOption("String_Node_Str","String_Node_Str","String_Node_Str");
  Option numReccomendationsOpt=buildOption("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Option usersFileOpt=buildOption("String_Node_Str","String_Node_Str","String_Node_Str",null);
  Map<String,String> parsedArgs=parseArguments(args,recommendClassOpt,numReccomendationsOpt,usersFileOpt);
  if (parsedArgs == null) {
    return -1;
  }
  String inputFile=parsedArgs.get("String_Node_Str");
  String outputPath=parsedArgs.get("String_Node_Str");
  String jarFile=parsedArgs.get("String_Node_Str");
  String usersFile=parsedArgs.get("String_Node_Str");
  if (usersFile == null) {
    usersFile=inputFile;
  }
  String recommendClassName=parsedArgs.get("String_Node_Str");
  int recommendationsPerUser=Integer.parseInt(parsedArgs.get("String_Node_Str"));
  JobConf jobConf=prepareJobConf(usersFile,outputPath,jarFile,TextInputFormat.class,UserIDsMapper.class,LongWritable.class,NullWritable.class,RecommenderReducer.class,LongWritable.class,RecommendedItemsWritable.class,TextOutputFormat.class);
  jobConf.set(RecommenderReducer.RECOMMENDER_CLASS_NAME,recommendClassName);
  jobConf.setInt(RecommenderReducer.RECOMMENDATIONS_PER_USER,recommendationsPerUser);
  jobConf.set(RecommenderReducer.DATA_MODEL_FILE,inputFile);
  jobConf.set(RecommenderReducer.USERS_FILE,usersFile);
  jobConf.setClass("String_Node_Str",GzipCodec.class,CompressionCodec.class);
  JobClient.runJob(jobConf);
  return 0;
}
Program: 61336
Project: 61336
Buggy source:
@Override public int run(String[] args) throws IOException {
  Map<String,String> parsedArgs=parseArguments(args);
  String prefsFile=parsedArgs.get("String_Node_Str");
  String outputPath=parsedArgs.get("String_Node_Str");
  String jarFile=parsedArgs.get("String_Node_Str");
  String averagesOutputPath=parsedArgs.get("String_Node_Str");
  JobConf prefsToDiffsJobConf=prepareJobConf(prefsFile,averagesOutputPath,jarFile,TextInputFormat.class,ToItemPrefsMapper.class,LongWritable.class,ItemPrefWritable.class,SlopeOnePrefsToDiffsReducer.class,ItemItemWritable.class,FloatWritable.class,SequenceFileOutputFormat.class);
  JobClient.runJob(prefsToDiffsJobConf);
  JobConf diffsToAveragesJobConf=prepareJobConf(averagesOutputPath,outputPath,jarFile,SequenceFileInputFormat.class,IdentityMapper.class,ItemItemWritable.class,FloatWritable.class,SlopeOneDiffsToAveragesReducer.class,ItemItemWritable.class,FloatWritable.class,TextOutputFormat.class);
  diffsToAveragesJobConf.setClass("String_Node_Str",GzipCodec.class,CompressionCodec.class);
  JobClient.runJob(diffsToAveragesJobConf);
  return 0;
}

Fixed version (ground truth):
@Override public int run(String[] args) throws IOException {
  Map<String,String> parsedArgs=parseArguments(args);
  if (parsedArgs == null) {
    return -1;
  }
  String prefsFile=parsedArgs.get("String_Node_Str");
  String outputPath=parsedArgs.get("String_Node_Str");
  String jarFile=parsedArgs.get("String_Node_Str");
  String averagesOutputPath=parsedArgs.get("String_Node_Str");
  JobConf prefsToDiffsJobConf=prepareJobConf(prefsFile,averagesOutputPath,jarFile,TextInputFormat.class,ToItemPrefsMapper.class,LongWritable.class,ItemPrefWritable.class,SlopeOnePrefsToDiffsReducer.class,ItemItemWritable.class,FloatWritable.class,SequenceFileOutputFormat.class);
  JobClient.runJob(prefsToDiffsJobConf);
  JobConf diffsToAveragesJobConf=prepareJobConf(averagesOutputPath,outputPath,jarFile,SequenceFileInputFormat.class,IdentityMapper.class,ItemItemWritable.class,FloatWritable.class,SlopeOneDiffsToAveragesReducer.class,ItemItemWritable.class,FloatWritable.class,TextOutputFormat.class);
  diffsToAveragesJobConf.setClass("String_Node_Str",GzipCodec.class,CompressionCodec.class);
  JobClient.runJob(diffsToAveragesJobConf);
  return 0;
}