nus-yam/ex-repair huggingface dataset:
Program: 132679
Project: 132679
Buggy source:
private void startFloatRangeLoop(String loopName,Var loopVar,Arg start,Arg end,Arg increment,int splitDegree,int leafDegree,List<PassedVar> passedVars,List<RefCount> perIterIncrs,MultiMap<Var,RefCount> constIncrs){
  assert(start.isImmediateFloat());
  assert(end.isImmediateFloat());
  assert(increment.isImmediateFloat());
  assert(Types.isFloatVal(loopVar));
  Expression startE=argToExpr(start);
  Expression endE=argToExpr(end);
  Expression incrE=argToExpr(increment);
  Value iterLimitVar=new Value(TCLTMP_ITERSTOTAL);
  pointAdd(new SetVariable(iterLimitVar.variable(),new TclExpr(TclExpr.exprFn(TclExpr.INT_CONV,TclExpr.group(TclExpr.exprFn(TclExpr.FLOOR,TclExpr.group(TclExpr.group(endE,TclExpr.MINUS,startE,TclExpr.PLUS,incrE),TclExpr.DIV,incrE)))),TclExpr.MINUS,LiteralInt.ONE)));
  Value dummyLoopVar=new Value(TCLTMP_FLOAT_RANGE_ITER);
  List<PassedVar> passedVars2=PassedVar.mergeLists(passedVars,PassedVar.fromArgs(false,start,increment));
  startIntRangeLoop2(loopName,dummyLoopVar.variable(),LiteralInt.ZERO,iterLimitVar,LiteralInt.ONE,splitDegree,leafDegree,passedVars2,perIterIncrs,constIncrs);
  pointAdd(new SetVariable(prefixVar(loopVar),new TclExpr(startE,TclExpr.PLUS,incrE,TclExpr.TIMES,dummyLoopVar)));
}

Fixed version (ground truth):
private void startFloatRangeLoop(String loopName,Var loopVar,Arg start,Arg end,Arg increment,int splitDegree,int leafDegree,List<PassedVar> passedVars,List<RefCount> perIterIncrs,MultiMap<Var,RefCount> constIncrs){
  assert(start.isImmediateFloat());
  assert(end.isImmediateFloat());
  assert(increment.isImmediateFloat());
  assert(Types.isFloatVal(loopVar));
  Expression startE=argToExpr(start);
  Expression endE=argToExpr(end);
  Expression incrE=argToExpr(increment);
  Value iterLimitVar=new Value(TCLTMP_ITERSTOTAL);
  pointAdd(new SetVariable(iterLimitVar.variable(),new TclExpr(TclExpr.exprFn(TclExpr.INT_CONV,TclExpr.group(TclExpr.exprFn(TclExpr.FLOOR,TclExpr.group(TclExpr.paren(endE,TclExpr.MINUS,startE,TclExpr.PLUS,incrE),TclExpr.DIV,incrE)))),TclExpr.MINUS,LiteralInt.ONE)));
  Value dummyLoopVar=new Value(TCLTMP_FLOAT_RANGE_ITER);
  List<PassedVar> passedVars2=PassedVar.mergeLists(passedVars,PassedVar.fromArgs(false,start,increment));
  startIntRangeLoop2(loopName,dummyLoopVar.variable(),LiteralInt.ZERO,iterLimitVar,LiteralInt.ONE,splitDegree,leafDegree,passedVars2,perIterIncrs,constIncrs);
  pointAdd(new SetVariable(prefixVar(loopVar),new TclExpr(startE,TclExpr.PLUS,incrE,TclExpr.TIMES,dummyLoopVar)));
}
Program: 132681
Project: 132681
Buggy source:
private static TypeMismatchException argumentTypeException(Context context,int argPos,Type expType,Type actType,String errContext){
  new Exception().printStackTrace();
  return new TypeMismatchException(context,"String_Node_Str" + (argPos + 1) + "String_Node_Str"+ expType.typeName()+ "String_Node_Str"+ actType.typeName()+ errContext);
}

Fixed version (ground truth):
private static TypeMismatchException argumentTypeException(Context context,int argPos,Type expType,Type actType,String errContext){
  return new TypeMismatchException(context,"String_Node_Str" + (argPos + 1) + "String_Node_Str"+ expType.typeName()+ "String_Node_Str"+ actType.typeName()+ errContext);
}
Program: 132682
Project: 132682
Buggy source:
/** 
 * Retrieve a reference to a local handle
 * @param dst alias variable to hold handle to referenced data
 * @param src Closed reference
 * @param acquireRead num of read refcounts to acquire
 * @param acquireWrite num of write refcounts to acquire
 * @param decrRead num of read refcounts to decr on input
 * @return
 */
public static Instruction retrieveRef(Var dst,Var src,long acquireRead,long acquireWrite,Arg decrRead){
  assert(Types.isRef(src.type()));
  assert(acquireRead >= 0);
  assert(acquireWrite >= 0);
  assert(decrRead.isImmediateInt());
  if (acquireWrite > 0) {
    assert(Types.isAssignableRefTo(src.type(),dst.type(),true));
  }
 else {
    assert(Types.isAssignableRefTo(src.type(),dst.type()));
  }
  assert(dst.storage() == Alloc.ALIAS);
  return new TurbineOp(Opcode.LOAD_REF,dst,src.asArg(),Arg.createIntLit(acquireRead),Arg.createIntLit(acquireWrite),decrRead);
}

Fixed version (ground truth):
/** 
 * Retrieve a reference to a local handle
 * @param dst alias variable to hold handle to referenced data
 * @param src Closed reference
 * @param acquireRead num of read refcounts to acquire
 * @param acquireWrite num of write refcounts to acquire
 * @param decrRead num of read refcounts to decr on input
 * @return
 */
public static Instruction retrieveRef(Var dst,Var src,long acquireRead,long acquireWrite,Arg decrRead){
}
Program: 132684
Project: 132684
Buggy source:
private static TypeMismatchException argumentTypeException(Context context,int argPos,Type expType,Type actType,String errContext){
  new Exception().printStackTrace();
  return new TypeMismatchException(context,"String_Node_Str" + (argPos + 1) + "String_Node_Str"+ expType.typeName()+ "String_Node_Str"+ actType.typeName()+ errContext);
}

Fixed version (ground truth):
private static TypeMismatchException argumentTypeException(Context context,int argPos,Type expType,Type actType,String errContext){
  return new TypeMismatchException(context,"String_Node_Str" + (argPos + 1) + "String_Node_Str"+ expType.typeName()+ "String_Node_Str"+ actType.typeName()+ errContext);
}
Program: 132685
Project: 132685
Buggy source:
/** 
 * Retrieve a reference to a local handle
 * @param dst alias variable to hold handle to referenced data
 * @param src Closed reference
 * @param acquireRead num of read refcounts to acquire
 * @param acquireWrite num of write refcounts to acquire
 * @param decrRead num of read refcounts to decr on input
 * @return
 */
public static Instruction retrieveRef(Var dst,Var src,long acquireRead,long acquireWrite,Arg decrRead){
  assert(Types.isRef(src.type()));
  assert(acquireRead >= 0);
  assert(acquireWrite >= 0);
  assert(decrRead.isImmediateInt());
  if (acquireWrite > 0) {
    assert(Types.isAssignableRefTo(src.type(),dst.type(),true));
  }
 else {
    assert(Types.isAssignableRefTo(src.type(),dst.type()));
  }
  assert(dst.storage() == Alloc.ALIAS);
  return new TurbineOp(Opcode.LOAD_REF,dst,src.asArg(),Arg.createIntLit(acquireRead),Arg.createIntLit(acquireWrite),decrRead);
}

Fixed version (ground truth):
/** 
 * Retrieve a reference to a local handle
 * @param dst alias variable to hold handle to referenced data
 * @param src Closed reference
 * @param acquireRead num of read refcounts to acquire
 * @param acquireWrite num of write refcounts to acquire
 * @param decrRead num of read refcounts to decr on input
 * @return
 */
public static Instruction retrieveRef(Var dst,Var src,long acquireRead,long acquireWrite,Arg decrRead){
}
Program: 132686
Project: 132686
Buggy source:
private UnifiedValues tryUnifyBranches(Program prog,Function fn,ExecContext execCx,Continuation cont,int stmtIndex,Congruences state,Map<Block,Congruences> result,List<BlockingVar> contClosedVars) throws OptUnsafeError {
  Conditional cond=((Conditional)cont);
  Arg condValue=cond.conditionArg();
  if (condValue.isVar()) {
    condValue=state.findValue(condValue.getVar());
  }
  Block predicted=cond.branchPredict(condValue);
  boolean unifyBranches;
  List<Block> branchBlocks;
  if (predicted != null) {
    unifyBranches=true;
    branchBlocks=Collections.singletonList(predicted);
  }
 else {
    unifyBranches=cont.isExhaustiveSyncConditional();
    branchBlocks=cont.getBlocks();
  }
  List<Congruences> branchStates=unifyBranches ? new ArrayList<Congruences>() : null;
  for (  Block contBlock : branchBlocks) {
    Congruences blockState=state.enterContBlock(cont.inheritsParentVars(),stmtIndex);
    if (contClosedVars != null) {
      for (      BlockingVar bv : contClosedVars) {
        blockState.markClosedBlockStart(bv.var,bv.recursive);
      }
    }
    findCongruencesRec(prog,fn,contBlock,cont.childContext(execCx),blockState,result);
    if (unifyBranches) {
      branchStates.add(blockState);
    }
  }
  if (unifyBranches) {
    return UnifiedValues.unify(logger,prog.constants(),fn,reorderingAllowed,stmtIndex,state,cont,branchStates,branchBlocks);
  }
 else {
    return UnifiedValues.EMPTY;
  }
}

Fixed version (ground truth):
private UnifiedValues tryUnifyBranches(Program prog,Function fn,ExecContext execCx,Continuation cont,int stmtIndex,Congruences state,Map<Block,Congruences> result) throws OptUnsafeError {
  Conditional cond=((Conditional)cont);
  Arg condValue=cond.conditionArg();
  if (condValue.isVar()) {
    condValue=state.findValue(condValue.getVar());
  }
  Block predicted=cond.branchPredict(condValue);
  boolean unifyBranches;
  List<Block> branchBlocks;
  if (predicted != null) {
    unifyBranches=true;
    branchBlocks=Collections.singletonList(predicted);
  }
 else {
    unifyBranches=cont.isExhaustiveSyncConditional();
    branchBlocks=cont.getBlocks();
  }
  List<Congruences> branchStates=unifyBranches ? new ArrayList<Congruences>() : null;
  findCongruencesBranchesRec(prog,fn,execCx,cont,stmtIndex,state,result,branchBlocks,branchStates);
  if (unifyBranches) {
    return UnifiedValues.unify(logger,prog.constants(),fn,reorderingAllowed,stmtIndex,state,cont,branchStates,branchBlocks);
  }
 else {
    return UnifiedValues.EMPTY;
  }
}
Program: 132687
Project: 132687
Buggy source:
private UnifiedValues findCongruencesContRec(Program prog,Function fn,ExecContext execCx,Continuation cont,int stmtIndex,Congruences state,Map<Block,Congruences> result) throws OptUnsafeError {
  logger.trace("String_Node_Str" + cont.getType());
  if (finalizedVarEnabled) {
    if (cont.getType() == ContinuationType.FOREACH_LOOP) {
      ForeachLoop foreach=(ForeachLoop)cont;
      Arg arrayVal=state.findRetrieveResult(foreach.getArrayVar(),false);
      logger.trace("String_Node_Str" + arrayVal);
      if (arrayVal != null) {
        foreach.switchToLocalForeach(arrayVal.getVar());
      }
    }
  }
  List<BlockingVar> contClosedVars=null;
  if (finalizedVarEnabled) {
    contClosedVars=cont.closedVars(state.getClosed(stmtIndex),state.getRecursivelyClosed(stmtIndex));
  }
  if (cont.isConditional()) {
    return tryUnifyBranches(prog,fn,execCx,cont,stmtIndex,state,result,contClosedVars);
  }
 else {
    return UnifiedValues.EMPTY;
  }
}

Fixed version (ground truth):
private UnifiedValues findCongruencesContRec(Program prog,Function fn,ExecContext execCx,Continuation cont,int stmtIndex,Congruences state,Map<Block,Congruences> result) throws OptUnsafeError {
  logger.trace("String_Node_Str" + cont.getType());
  if (finalizedVarEnabled) {
    if (cont.getType() == ContinuationType.FOREACH_LOOP) {
      ForeachLoop foreach=(ForeachLoop)cont;
      Arg arrayVal=state.findRetrieveResult(foreach.getArrayVar(),false);
      logger.trace("String_Node_Str" + arrayVal);
      if (arrayVal != null) {
        foreach.switchToLocalForeach(arrayVal.getVar());
      }
    }
  }
  if (cont.isConditional()) {
    return tryUnifyBranches(prog,fn,execCx,cont,stmtIndex,state,result);
  }
 else {
    findCongruencesBranchesRec(prog,fn,execCx,cont,stmtIndex,state,result,cont.getBlocks(),null);
    return UnifiedValues.EMPTY;
  }
}
Program: 132688
Project: 132688
Buggy source:
private UnifiedValues tryUnifyBranches(Program prog,Function fn,ExecContext execCx,Continuation cont,int stmtIndex,Congruences state,Map<Block,Congruences> result,List<BlockingVar> contClosedVars) throws OptUnsafeError {
  Conditional cond=((Conditional)cont);
  Arg condValue=cond.conditionArg();
  if (condValue.isVar()) {
    condValue=state.findValue(condValue.getVar());
  }
  Block predicted=cond.branchPredict(condValue);
  boolean unifyBranches;
  List<Block> branchBlocks;
  if (predicted != null) {
    unifyBranches=true;
    branchBlocks=Collections.singletonList(predicted);
  }
 else {
    unifyBranches=cont.isExhaustiveSyncConditional();
    branchBlocks=cont.getBlocks();
  }
  List<Congruences> branchStates=unifyBranches ? new ArrayList<Congruences>() : null;
  for (  Block contBlock : branchBlocks) {
    Congruences blockState=state.enterContBlock(cont.inheritsParentVars(),stmtIndex);
    if (contClosedVars != null) {
      for (      BlockingVar bv : contClosedVars) {
        blockState.markClosedBlockStart(bv.var,bv.recursive);
      }
    }
    findCongruencesRec(prog,fn,contBlock,cont.childContext(execCx),blockState,result);
    if (unifyBranches) {
      branchStates.add(blockState);
    }
  }
  if (unifyBranches) {
    return UnifiedValues.unify(logger,prog.constants(),fn,reorderingAllowed,stmtIndex,state,cont,branchStates,branchBlocks);
  }
 else {
    return UnifiedValues.EMPTY;
  }
}

Fixed version (ground truth):
private UnifiedValues tryUnifyBranches(Program prog,Function fn,ExecContext execCx,Continuation cont,int stmtIndex,Congruences state,Map<Block,Congruences> result) throws OptUnsafeError {
  Conditional cond=((Conditional)cont);
  Arg condValue=cond.conditionArg();
  if (condValue.isVar()) {
    condValue=state.findValue(condValue.getVar());
  }
  Block predicted=cond.branchPredict(condValue);
  boolean unifyBranches;
  List<Block> branchBlocks;
  if (predicted != null) {
    unifyBranches=true;
    branchBlocks=Collections.singletonList(predicted);
  }
 else {
    unifyBranches=cont.isExhaustiveSyncConditional();
    branchBlocks=cont.getBlocks();
  }
  List<Congruences> branchStates=unifyBranches ? new ArrayList<Congruences>() : null;
  findCongruencesBranchesRec(prog,fn,execCx,cont,stmtIndex,state,result,branchBlocks,branchStates);
  if (unifyBranches) {
    return UnifiedValues.unify(logger,prog.constants(),fn,reorderingAllowed,stmtIndex,state,cont,branchStates,branchBlocks);
  }
 else {
    return UnifiedValues.EMPTY;
  }
}
Program: 132689
Project: 132689
Buggy source:
private UnifiedValues findCongruencesContRec(Program prog,Function fn,ExecContext execCx,Continuation cont,int stmtIndex,Congruences state,Map<Block,Congruences> result) throws OptUnsafeError {
  logger.trace("String_Node_Str" + cont.getType());
  if (finalizedVarEnabled) {
    if (cont.getType() == ContinuationType.FOREACH_LOOP) {
      ForeachLoop foreach=(ForeachLoop)cont;
      Arg arrayVal=state.findRetrieveResult(foreach.getArrayVar(),false);
      logger.trace("String_Node_Str" + arrayVal);
      if (arrayVal != null) {
        foreach.switchToLocalForeach(arrayVal.getVar());
      }
    }
  }
  List<BlockingVar> contClosedVars=null;
  if (finalizedVarEnabled) {
    contClosedVars=cont.closedVars(state.getClosed(stmtIndex),state.getRecursivelyClosed(stmtIndex));
  }
  if (cont.isConditional()) {
    return tryUnifyBranches(prog,fn,execCx,cont,stmtIndex,state,result,contClosedVars);
  }
 else {
    return UnifiedValues.EMPTY;
  }
}

Fixed version (ground truth):
private UnifiedValues findCongruencesContRec(Program prog,Function fn,ExecContext execCx,Continuation cont,int stmtIndex,Congruences state,Map<Block,Congruences> result) throws OptUnsafeError {
  logger.trace("String_Node_Str" + cont.getType());
  if (finalizedVarEnabled) {
    if (cont.getType() == ContinuationType.FOREACH_LOOP) {
      ForeachLoop foreach=(ForeachLoop)cont;
      Arg arrayVal=state.findRetrieveResult(foreach.getArrayVar(),false);
      logger.trace("String_Node_Str" + arrayVal);
      if (arrayVal != null) {
        foreach.switchToLocalForeach(arrayVal.getVar());
      }
    }
  }
  if (cont.isConditional()) {
    return tryUnifyBranches(prog,fn,execCx,cont,stmtIndex,state,result);
  }
 else {
    findCongruencesBranchesRec(prog,fn,execCx,cont,stmtIndex,state,result,cont.getBlocks(),null);
    return UnifiedValues.EMPTY;
  }
}
Program: 132692
Project: 132692
Buggy source:
/** 
 * Find computed values that appear in all branches but not parent
 * @param parentState
 * @param congType 
 * @param branchStates
 * @param alreadyAdded ignore these
 * @return
 */
private static List<ArgCV> findAllBranchCVs(Congruences parentState,CongruenceType congType,List<Congruences> branchStates,List<ArgCV> alreadyAdded){
  List<ArgCV> allBranchCVs=new ArrayList<ArgCV>();
  Congruences firstState=branchStates.get(0);
  for (  ArgOrCV val : firstState.availableThisScope(congType)) {
    ArgCV convertedVal=parentState.convertToArgs(val,congType);
    if (convertedVal != null) {
      if (!alreadyAdded.contains(convertedVal) && !parentState.isAvailable(convertedVal,congType)) {
        int nBranches=branchStates.size();
        boolean presentInAll=true;
        for (        Congruences otherState : branchStates.subList(1,nBranches)) {
          if (!otherState.isAvailable(convertedVal,congType)) {
            presentInAll=false;
            break;
          }
        }
        if (presentInAll) {
          allBranchCVs.add(convertedVal);
        }
      }
    }
  }
  return allBranchCVs;
}

Fixed version (ground truth):
/** 
 * Find computed values that appear in all branches but not parent
 * @param parentState
 * @param congType
 * @param branchStates
 * @param alreadyAdded ignore these
 * @return
 */
private static List<ArgCV> findAllBranchCVs(Congruences parentState,CongruenceType congType,List<Congruences> branchStates,List<ArgCV> alreadyAdded){
  List<ArgCV> allBranchCVs=new ArrayList<ArgCV>();
  Congruences firstState=branchStates.get(0);
  for (  ArgOrCV val : firstState.availableThisScope(congType)) {
    ArgCV convertedVal=parentState.convertToArgs(val,congType);
    if (convertedVal != null) {
      if (!alreadyAdded.contains(convertedVal) && !parentState.isAvailable(convertedVal,congType)) {
        int nBranches=branchStates.size();
        boolean presentInAll=true;
        for (        Congruences otherState : branchStates.subList(1,nBranches)) {
          if (!otherState.isAvailable(convertedVal,congType)) {
            presentInAll=false;
            break;
          }
        }
        if (presentInAll) {
          allBranchCVs.add(convertedVal);
        }
      }
    }
  }
  return allBranchCVs;
}
Program: 132695
Project: 132695
Buggy source:
/** 
 * Find computed values that appear in all branches but not parent
 * @param parentState
 * @param congType 
 * @param branchStates
 * @param alreadyAdded ignore these
 * @return
 */
private static List<ArgCV> findAllBranchCVs(Congruences parentState,CongruenceType congType,List<Congruences> branchStates,List<ArgCV> alreadyAdded){
  List<ArgCV> allBranchCVs=new ArrayList<ArgCV>();
  Congruences firstState=branchStates.get(0);
  for (  ArgOrCV val : firstState.availableThisScope(congType)) {
    ArgCV convertedVal=parentState.convertToArgs(val,congType);
    if (convertedVal != null) {
      if (!alreadyAdded.contains(convertedVal) && !parentState.isAvailable(convertedVal,congType)) {
        int nBranches=branchStates.size();
        boolean presentInAll=true;
        for (        Congruences otherState : branchStates.subList(1,nBranches)) {
          if (!otherState.isAvailable(convertedVal,congType)) {
            presentInAll=false;
            break;
          }
        }
        if (presentInAll) {
          allBranchCVs.add(convertedVal);
        }
      }
    }
  }
  return allBranchCVs;
}

Fixed version (ground truth):
/** 
 * Find computed values that appear in all branches but not parent
 * @param parentState
 * @param congType
 * @param branchStates
 * @param alreadyAdded ignore these
 * @return
 */
private static List<ArgCV> findAllBranchCVs(Congruences parentState,CongruenceType congType,List<Congruences> branchStates,List<ArgCV> alreadyAdded){
  List<ArgCV> allBranchCVs=new ArrayList<ArgCV>();
  Congruences firstState=branchStates.get(0);
  for (  ArgOrCV val : firstState.availableThisScope(congType)) {
    ArgCV convertedVal=parentState.convertToArgs(val,congType);
    if (convertedVal != null) {
      if (!alreadyAdded.contains(convertedVal) && !parentState.isAvailable(convertedVal,congType)) {
        int nBranches=branchStates.size();
        boolean presentInAll=true;
        for (        Congruences otherState : branchStates.subList(1,nBranches)) {
          if (!otherState.isAvailable(convertedVal,congType)) {
            presentInAll=false;
            break;
          }
        }
        if (presentInAll) {
          allBranchCVs.add(convertedVal);
        }
      }
    }
  }
  return allBranchCVs;
}
Program: 132696
Project: 132696
Buggy source:
/** 
 * Finish adding an updated CV obtained by substituting components
 * @param oldComponent original component
 * @param newComponent replaced with
 * @param newCV canonicalized computed value
 * @param canonical existing set that it is a member of
 */
private void addUpdatedCV(Arg oldComponent,Arg newComponent,ArgOrCV newCV,Arg canonical){
  Arg newCanonical=findCanonicalInternal(newCV);
  if (newCanonical != null) {
    if (newCanonical.equals(canonical)) {
      addSetEntry(newCV,canonical);
    }
 else {
      mergeQueue.add(new ToMerge(canonical,newCanonical));
      if (logger.isTraceEnabled()) {
        if (newComponent != null) {
          logger.trace("String_Node_Str" + oldComponent + "String_Node_Str"+ newComponent+ "String_Node_Str"+ canonical+ "String_Node_Str"+ newCanonical);
        }
 else {
          logger.trace("String_Node_Str" + oldComponent + "String_Node_Str"+ canonical+ "String_Node_Str"+ newCanonical);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Finish adding an updated CV obtained by substituting components
 * @param oldComponent original component
 * @param newComponent replaced with
 * @param newCV canonicalized computed value
 * @param canonical existing set that it is a member of
 */
private void addUpdatedCV(Arg oldComponent,Arg newComponent,ArgOrCV newCV,Arg canonical){
  Arg newCanonical=findCanonicalInternal(newCV);
  if (newCanonical == null || newCanonical.equals(canonical)) {
    addSetEntry(newCV,canonical);
  }
 else {
    mergeQueue.add(new ToMerge(canonical,newCanonical));
    if (logger.isTraceEnabled()) {
      if (newComponent != null) {
        logger.trace("String_Node_Str" + oldComponent + "String_Node_Str"+ newComponent+ "String_Node_Str"+ canonical+ "String_Node_Str"+ newCanonical);
      }
 else {
        logger.trace("String_Node_Str" + oldComponent + "String_Node_Str"+ canonical+ "String_Node_Str"+ newCanonical);
      }
    }
  }
}
Program: 132698
Project: 132698
Buggy source:
/** 
 * Finish adding an updated CV obtained by substituting components
 * @param oldComponent original component
 * @param newComponent replaced with
 * @param newCV canonicalized computed value
 * @param canonical existing set that it is a member of
 */
private void addUpdatedCV(Arg oldComponent,Arg newComponent,ArgOrCV newCV,Arg canonical){
  Arg newCanonical=findCanonicalInternal(newCV);
  if (newCanonical != null) {
    if (newCanonical.equals(canonical)) {
      addSetEntry(newCV,canonical);
    }
 else {
      mergeQueue.add(new ToMerge(canonical,newCanonical));
      if (logger.isTraceEnabled()) {
        if (newComponent != null) {
          logger.trace("String_Node_Str" + oldComponent + "String_Node_Str"+ newComponent+ "String_Node_Str"+ canonical+ "String_Node_Str"+ newCanonical);
        }
 else {
          logger.trace("String_Node_Str" + oldComponent + "String_Node_Str"+ canonical+ "String_Node_Str"+ newCanonical);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Finish adding an updated CV obtained by substituting components
 * @param oldComponent original component
 * @param newComponent replaced with
 * @param newCV canonicalized computed value
 * @param canonical existing set that it is a member of
 */
private void addUpdatedCV(Arg oldComponent,Arg newComponent,ArgOrCV newCV,Arg canonical){
  Arg newCanonical=findCanonicalInternal(newCV);
  if (newCanonical == null || newCanonical.equals(canonical)) {
    addSetEntry(newCV,canonical);
  }
 else {
    mergeQueue.add(new ToMerge(canonical,newCanonical));
    if (logger.isTraceEnabled()) {
      if (newComponent != null) {
        logger.trace("String_Node_Str" + oldComponent + "String_Node_Str"+ newComponent+ "String_Node_Str"+ canonical+ "String_Node_Str"+ newCanonical);
      }
 else {
        logger.trace("String_Node_Str" + oldComponent + "String_Node_Str"+ canonical+ "String_Node_Str"+ newCanonical);
      }
    }
  }
}
Program: 132701
Project: 132701
Buggy source:
private boolean compatibleLocPar(Arg location1,Arg location2,Arg par1,Arg par2){
  if (location1 != null && location2 != null) {
    if (!location1.equals(location2)) {
      return false;
    }
  }
 else   if (location1 != null || location2 != null) {
    return false;
  }
  if (par1 != null || par2 != null) {
    if (!par1.equals(par2)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean compatibleLocPar(Arg location1,Arg location2,Arg par1,Arg par2){
  Logger logger=Logging.getSTCLogger();
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str" + location1 + "String_Node_Str"+ location2+ "String_Node_Str"+ par1+ "String_Node_Str"+ par2+ "String_Node_Str");
  }
  if (location1 != null && location2 != null) {
    if (!location1.equals(location2)) {
      return false;
    }
  }
 else   if (location1 != null || location2 != null) {
    return false;
  }
  if (par1 != null || par2 != null) {
    if (!par1.equals(par2)) {
      return false;
    }
  }
  return true;
}
Program: 132702
Project: 132702
Buggy source:
public Arg targetLocation(){
  return props.get(TaskPropKey.LOCATION);
}

Fixed version (ground truth):
/** 
 * @return target location.  Non-null.
 */
public Arg targetLocation(){
  return props.getWithDefault(TaskPropKey.LOCATION);
}
Program: 132703
Project: 132703
Buggy source:
private void callTclFunction(String function,TclFunRef tclf,List<Arg> inputs,List<Var> outputs,TaskProps props){
  assert(props != null);
  props.assertInternalTypesValid();
  TclList iList=TclUtil.tclListOfArgs(inputs);
  TclList oList=TclUtil.tclListOfVariables(outputs);
  if (tclf == null) {
    throw new STCRuntimeError("String_Node_Str" + function);
  }
  Arg priority=props.get(TaskPropKey.PRIORITY);
  TclTarget target=TclTarget.fromArg(props.get(TaskPropKey.LOCATION));
  Expression parExpr=TclUtil.argToExpr(props.get(TaskPropKey.PARALLELISM),true);
  setPriority(priority);
  Token tclFunction=new Token(tclf.pkg + "String_Node_Str" + tclf.symbol);
  List<Expression> funcArgs=new ArrayList<Expression>();
  funcArgs.add(oList);
  funcArgs.add(iList);
  funcArgs.addAll(Turbine.ruleKeywordArgs(target,parExpr));
  Command c=new Command(tclFunction,funcArgs);
  pointAdd(c);
  clearPriority(priority);
}

Fixed version (ground truth):
private void callTclFunction(String function,TclFunRef tclf,List<Arg> inputs,List<Var> outputs,TaskProps props){
  assert(props != null);
  props.assertInternalTypesValid();
  TclList iList=TclUtil.tclListOfArgs(inputs);
  TclList oList=TclUtil.tclListOfVariables(outputs);
  if (tclf == null) {
    throw new STCRuntimeError("String_Node_Str" + function);
  }
  Arg priority=props.get(TaskPropKey.PRIORITY);
  TclTarget target=TclTarget.fromArg(props.getWithDefault(TaskPropKey.LOCATION));
  Expression parExpr=TclUtil.argToExpr(props.get(TaskPropKey.PARALLELISM),true);
  setPriority(priority);
  Token tclFunction=new Token(tclf.pkg + "String_Node_Str" + tclf.symbol);
  List<Expression> funcArgs=new ArrayList<Expression>();
  funcArgs.add(oList);
  funcArgs.add(iList);
  funcArgs.addAll(Turbine.ruleKeywordArgs(target,parExpr));
  Command c=new Command(tclFunction,funcArgs);
  pointAdd(c);
  clearPriority(priority);
}
Program: 132704
Project: 132704
Buggy source:
private RuleProps buildRuleProps(TaskProps props){
  Expression priority=TclUtil.argToExpr(props.get(TaskPropKey.PRIORITY),true);
  TclTarget target=TclTarget.fromArg(props.get(TaskPropKey.LOCATION));
  Expression parallelism=TclUtil.argToExpr(props.get(TaskPropKey.PARALLELISM),true);
  RuleProps ruleProps=new RuleProps(target,parallelism,priority);
  return ruleProps;
}

Fixed version (ground truth):
private RuleProps buildRuleProps(TaskProps props){
  Expression priority=TclUtil.argToExpr(props.get(TaskPropKey.PRIORITY),true);
  TclTarget target=TclTarget.fromArg(props.getWithDefault(TaskPropKey.LOCATION));
  Expression parallelism=TclUtil.argToExpr(props.get(TaskPropKey.PARALLELISM),true);
  RuleProps ruleProps=new RuleProps(target,parallelism,priority);
  return ruleProps;
}
Program: 132705
Project: 132705
Buggy source:
public static TclTarget fromArg(Arg arg){
  if (arg == null) {
    return RANK_ANY;
  }
 else   if (arg.equals(Location.ANY_LOCATION)) {
    return RANK_ANY;
  }
 else {
    return TclTarget.rank(TclUtil.argToExpr(arg));
  }
}

Fixed version (ground truth):
public static TclTarget fromArg(Arg arg){
  assert(arg != null);
  if (Location.isAnyLocation(arg,true)) {
    return RANK_ANY;
  }
 else {
    return TclTarget.rank(TclUtil.argToExpr(arg));
  }
}
Program: 132707
Project: 132707
Buggy source:
private boolean compatibleLocPar(Arg location1,Arg location2,Arg par1,Arg par2){
  if (location1 != null && location2 != null) {
    if (!location1.equals(location2)) {
      return false;
    }
  }
 else   if (location1 != null || location2 != null) {
    return false;
  }
  if (par1 != null || par2 != null) {
    if (!par1.equals(par2)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean compatibleLocPar(Arg location1,Arg location2,Arg par1,Arg par2){
  Logger logger=Logging.getSTCLogger();
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str" + location1 + "String_Node_Str"+ location2+ "String_Node_Str"+ par1+ "String_Node_Str"+ par2+ "String_Node_Str");
  }
  if (location1 != null && location2 != null) {
    if (!location1.equals(location2)) {
      return false;
    }
  }
 else   if (location1 != null || location2 != null) {
    return false;
  }
  if (par1 != null || par2 != null) {
    if (!par1.equals(par2)) {
      return false;
    }
  }
  return true;
}
Program: 132708
Project: 132708
Buggy source:
public Arg targetLocation(){
  return props.get(TaskPropKey.LOCATION);
}

Fixed version (ground truth):
/** 
 * @return target location.  Non-null.
 */
public Arg targetLocation(){
  return props.getWithDefault(TaskPropKey.LOCATION);
}
Program: 132709
Project: 132709
Buggy source:
private void callTclFunction(String function,TclFunRef tclf,List<Arg> inputs,List<Var> outputs,TaskProps props){
  assert(props != null);
  props.assertInternalTypesValid();
  TclList iList=TclUtil.tclListOfArgs(inputs);
  TclList oList=TclUtil.tclListOfVariables(outputs);
  if (tclf == null) {
    throw new STCRuntimeError("String_Node_Str" + function);
  }
  Arg priority=props.get(TaskPropKey.PRIORITY);
  TclTarget target=TclTarget.fromArg(props.get(TaskPropKey.LOCATION));
  Expression parExpr=TclUtil.argToExpr(props.get(TaskPropKey.PARALLELISM),true);
  setPriority(priority);
  Token tclFunction=new Token(tclf.pkg + "String_Node_Str" + tclf.symbol);
  List<Expression> funcArgs=new ArrayList<Expression>();
  funcArgs.add(oList);
  funcArgs.add(iList);
  funcArgs.addAll(Turbine.ruleKeywordArgs(target,parExpr));
  Command c=new Command(tclFunction,funcArgs);
  pointAdd(c);
  clearPriority(priority);
}

Fixed version (ground truth):
private void callTclFunction(String function,TclFunRef tclf,List<Arg> inputs,List<Var> outputs,TaskProps props){
  assert(props != null);
  props.assertInternalTypesValid();
  TclList iList=TclUtil.tclListOfArgs(inputs);
  TclList oList=TclUtil.tclListOfVariables(outputs);
  if (tclf == null) {
    throw new STCRuntimeError("String_Node_Str" + function);
  }
  Arg priority=props.get(TaskPropKey.PRIORITY);
  TclTarget target=TclTarget.fromArg(props.getWithDefault(TaskPropKey.LOCATION));
  Expression parExpr=TclUtil.argToExpr(props.get(TaskPropKey.PARALLELISM),true);
  setPriority(priority);
  Token tclFunction=new Token(tclf.pkg + "String_Node_Str" + tclf.symbol);
  List<Expression> funcArgs=new ArrayList<Expression>();
  funcArgs.add(oList);
  funcArgs.add(iList);
  funcArgs.addAll(Turbine.ruleKeywordArgs(target,parExpr));
  Command c=new Command(tclFunction,funcArgs);
  pointAdd(c);
  clearPriority(priority);
}
Program: 132710
Project: 132710
Buggy source:
private RuleProps buildRuleProps(TaskProps props){
  Expression priority=TclUtil.argToExpr(props.get(TaskPropKey.PRIORITY),true);
  TclTarget target=TclTarget.fromArg(props.get(TaskPropKey.LOCATION));
  Expression parallelism=TclUtil.argToExpr(props.get(TaskPropKey.PARALLELISM),true);
  RuleProps ruleProps=new RuleProps(target,parallelism,priority);
  return ruleProps;
}

Fixed version (ground truth):
private RuleProps buildRuleProps(TaskProps props){
  Expression priority=TclUtil.argToExpr(props.get(TaskPropKey.PRIORITY),true);
  TclTarget target=TclTarget.fromArg(props.getWithDefault(TaskPropKey.LOCATION));
  Expression parallelism=TclUtil.argToExpr(props.get(TaskPropKey.PARALLELISM),true);
  RuleProps ruleProps=new RuleProps(target,parallelism,priority);
  return ruleProps;
}
Program: 132711
Project: 132711
Buggy source:
public static TclTarget fromArg(Arg arg){
  if (arg == null) {
    return RANK_ANY;
  }
 else   if (arg.equals(Location.ANY_LOCATION)) {
    return RANK_ANY;
  }
 else {
    return TclTarget.rank(TclUtil.argToExpr(arg));
  }
}

Fixed version (ground truth):
public static TclTarget fromArg(Arg arg){
  assert(arg != null);
  if (Location.isAnyLocation(arg,true)) {
    return RANK_ANY;
  }
 else {
    return TclTarget.rank(TclUtil.argToExpr(arg));
  }
}
Program: 132712
Project: 132712
Buggy source:
private static void fuseNonRecursive(Block block){
  Iterator<Continuation> it=block.continuationIterator();
  assert(block.getContinuations().size() > 1);
  LinkedList<Continuation> mergeCands=new LinkedList<Continuation>(block.getContinuations());
  mergeCands.removeFirst();
  while (it.hasNext()) {
    if (mergeCands.isEmpty()) {
      break;
    }
    Continuation c=it.next();
switch (c.getType()) {
case IF_STATEMENT:
      fuseIfStatement(it,mergeCands,(IfStatement)c);
    break;
case FOREACH_LOOP:
  fuseForeachLoop(it,mergeCands,(ForeachLoop)c);
break;
case RANGE_LOOP:
fuseRangeLoop(it,mergeCands,(RangeLoop)c);
break;
default :
break;
}
mergeCands.removeFirst();
}
}

Fixed version (ground truth):
private static void fuseNonRecursive(String function,Block block){
  Iterator<Continuation> it=block.continuationIterator();
  assert(block.getContinuations().size() > 1);
  LinkedList<Continuation> mergeCands=new LinkedList<Continuation>(block.getContinuations());
  mergeCands.removeFirst();
  while (it.hasNext()) {
    if (mergeCands.isEmpty()) {
      break;
    }
    Continuation c=it.next();
switch (c.getType()) {
case IF_STATEMENT:
      fuseIfStatement(it,mergeCands,(IfStatement)c);
    break;
case FOREACH_LOOP:
  fuseForeachLoop(function,it,mergeCands,(ForeachLoop)c);
break;
case RANGE_LOOP:
fuseRangeLoop(function,it,mergeCands,(RangeLoop)c);
break;
default :
break;
}
mergeCands.removeFirst();
}
}
Program: 132713
Project: 132713
Buggy source:
private static void fuseRecursive(Logger logger,Function f,Block block){
  if (block.getContinuations().size() > 1) {
    fuseNonRecursive(block);
  }
  for (  Continuation c : block.allComplexStatements()) {
    for (    Block child : c.getBlocks()) {
      fuseRecursive(logger,f,child);
    }
  }
}

Fixed version (ground truth):
private static void fuseRecursive(Logger logger,Function f,Block block){
  if (block.getContinuations().size() > 1) {
    fuseNonRecursive(f.getName(),block);
  }
  for (  Continuation c : block.allComplexStatements()) {
    for (    Block child : c.getBlocks()) {
      fuseRecursive(logger,f,child);
    }
  }
}
Program: 132714
Project: 132714
Buggy source:
/** 
 * Try and merge if1 into one of statements in mergeCands If successful, call it.remove()
 * @param it
 * @param mergeCands
 * @param loop1
 */
private static void fuseForeachLoop(Iterator<Continuation> it,LinkedList<Continuation> mergeCands,ForeachLoop loop1){
  for (  Continuation c2 : mergeCands) {
    if (c2.getType() == ContinuationType.FOREACH_LOOP) {
      ForeachLoop loop2=(ForeachLoop)c2;
      if (loop2.fuseable(loop1)) {
        loop2.fuseInto(loop1,true);
        it.remove();
        return;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Try and merge if1 into one of statements in mergeCands If successful, call it.remove()
 * @param it
 * @param mergeCands
 * @param loop1
 */
private static void fuseForeachLoop(String function,Iterator<Continuation> it,LinkedList<Continuation> mergeCands,ForeachLoop loop1){
  for (  Continuation c2 : mergeCands) {
    if (c2.getType() == ContinuationType.FOREACH_LOOP) {
      ForeachLoop loop2=(ForeachLoop)c2;
      if (loop2.fuseable(loop1)) {
        loop2.fuseInto(function,loop1,true);
        it.remove();
        return;
      }
    }
  }
}
Program: 132715
Project: 132715
Buggy source:
/** 
 * Try and merge if1 into one of statements in mergeCands If successful, call it.remove()
 * @param it
 * @param mergeCands
 * @param loop1
 */
private static void fuseRangeLoop(Iterator<Continuation> it,LinkedList<Continuation> mergeCands,RangeLoop loop1){
  for (  Continuation c2 : mergeCands) {
    if (c2.getType() == ContinuationType.RANGE_LOOP) {
      RangeLoop loop2=(RangeLoop)c2;
      if (loop2.fuseable(loop1)) {
        assert(loop2 != loop1);
        loop2.fuseInto(loop1,true);
        it.remove();
        return;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Try and merge if1 into one of statements in mergeCands If successful, call it.remove()
 * @param it
 * @param mergeCands
 * @param loop1
 */
private static void fuseRangeLoop(String function,Iterator<Continuation> it,LinkedList<Continuation> mergeCands,RangeLoop loop1){
  for (  Continuation c2 : mergeCands) {
    if (c2.getType() == ContinuationType.RANGE_LOOP) {
      RangeLoop loop2=(RangeLoop)c2;
      if (loop2.fuseable(loop1)) {
        assert(loop2 != loop1);
        loop2.fuseInto(function,loop1,true);
        it.remove();
        return;
      }
    }
  }
}
Program: 132718
Project: 132718
Buggy source:
private static boolean unrollLoops(Logger logger,Program prog,Function f,Block block){
  boolean unrolled=false;
  ListIterator<Continuation> it=block.continuationIterator();
  while (it.hasNext()) {
    Continuation c=it.next();
    for (    Block b : c.getBlocks()) {
      boolean res=unrollLoops(logger,prog,f,b);
      unrolled=unrolled || res;
    }
    Pair<Boolean,List<Continuation>> cRes=c.tryUnroll(logger,block);
    if (cRes.val1) {
      unrolled=true;
      for (      Continuation newC : cRes.val2) {
        it.add(newC);
      }
    }
  }
  return unrolled;
}

Fixed version (ground truth):
private static boolean unrollLoops(Logger logger,Program prog,Function f,Block block){
  boolean unrolled=false;
  ListIterator<Continuation> it=block.continuationIterator();
  while (it.hasNext()) {
    Continuation c=it.next();
    for (    Block b : c.getBlocks()) {
      boolean res=unrollLoops(logger,prog,f,b);
      unrolled=unrolled || res;
    }
    Pair<Boolean,List<Continuation>> cRes;
    cRes=c.tryUnroll(logger,f.getName(),block);
    if (cRes.val1) {
      unrolled=true;
      for (      Continuation newC : cRes.val2) {
        it.add(newC);
      }
    }
  }
  return unrolled;
}
Program: 132719
Project: 132719
Buggy source:
public static void fixupImmChange(Block srcBlock,Block targetBlock,Instruction oldInst,MakeImmChange change,List<Statement> instBuffer,List<Var> newOutVars,List<MakeImmVar> oldOutVars){
  instBuffer.addAll(Arrays.asList(change.newInsts));
  Logger logger=Logging.getSTCLogger();
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str" + oldInst + "String_Node_Str"+ Arrays.asList(change.newInsts));
  }
  if (!change.isOutVarSame()) {
    Var newOut=change.newOut;
    Var oldOut=change.oldOut;
    boolean initOutput=false;
    for (    Pair<Var,InitType> init : oldInst.getInitialized()) {
      if (init.val2 == InitType.FULL && init.val1.equals(oldOut)) {
        initOutput=true;
        break;
      }
    }
    replaceInstOutput(srcBlock,targetBlock,instBuffer,newOut,oldOut,initOutput);
  }
  if (change.storeOutputVals) {
    setLocalOutputs(targetBlock,oldOutVars,newOutVars,instBuffer);
  }
}

Fixed version (ground truth):
public static void fixupImmChange(String function,Block srcBlock,Block targetBlock,Instruction oldInst,MakeImmChange change,List<Statement> instBuffer,List<Var> newOutVars,List<MakeImmVar> oldOutVars){
  instBuffer.addAll(Arrays.asList(change.newInsts));
  Logger logger=Logging.getSTCLogger();
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str" + oldInst + "String_Node_Str"+ Arrays.asList(change.newInsts));
  }
  if (!change.isOutVarSame()) {
    Var newOut=change.newOut;
    Var oldOut=change.oldOut;
    boolean initOutput=false;
    for (    Pair<Var,InitType> init : oldInst.getInitialized()) {
      if (init.val2 == InitType.FULL && init.val1.equals(oldOut)) {
        initOutput=true;
        break;
      }
    }
    replaceInstOutput(function,srcBlock,targetBlock,instBuffer,newOut,oldOut,initOutput);
  }
  if (change.storeOutputVals) {
    setLocalOutputs(targetBlock,oldOutVars,newOutVars,instBuffer);
  }
}
Program: 132720
Project: 132720
Buggy source:
/** 
 * Do the manipulation necessary to allow an old instruction output variable to be replaced with a new one. Assume that newOut is a value type of oldOut
 * @param srcBlock source block for instruction 
 * @param targetBlock target block for instruction
 * @param instBuffer append any fixup instructions here
 * @param newOut
 * @param oldOut
 * @param recursive if it's to be fetched recursively
 */
public static void replaceInstOutput(Block srcBlock,Block targetBlock,List<Statement> instBuffer,Var newOut,Var oldOut,boolean initialisesOutput){
  boolean isDerefResult=Types.retrievedType(oldOut).assignableTo(newOut.type());
  if (isDerefResult) {
    Var oldOutReplacement;
    if (oldOut.storage() == Alloc.ALIAS && initialisesOutput) {
      oldOutReplacement=new Var(oldOut.type(),oldOut.name(),Alloc.TEMP,oldOut.defType(),oldOut.provenance(),oldOut.mappedDecl());
      replaceVarDeclaration(srcBlock,oldOut,oldOutReplacement);
      Map<Var,Arg> renames=Collections.singletonMap(oldOut,Arg.createVar(oldOutReplacement));
      for (      Statement inst : instBuffer) {
        inst.renameVars(renames,RenameMode.REPLACE_VAR);
      }
    }
 else {
      oldOutReplacement=oldOut;
    }
    WrapUtil.assignOutput(targetBlock,instBuffer,false,oldOutReplacement,newOut,false);
  }
 else {
    throw new STCRuntimeError("String_Node_Str" + "String_Node_Str" + oldOut + "String_Node_Str"+ newOut+ "String_Node_Str"+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Do the manipulation necessary to allow an old instruction output variable to be replaced with a new one. Assume that newOut is a value type of oldOut
 * @param function
 * @param srcBlock source block for instruction 
 * @param targetBlock target block for instruction
 * @param instBuffer append any fixup instructions here
 * @param newOut
 * @param oldOut
 * @param recursive if it's to be fetched recursively
 */
public static void replaceInstOutput(String function,Block srcBlock,Block targetBlock,List<Statement> instBuffer,Var newOut,Var oldOut,boolean initialisesOutput){
  boolean isDerefResult=Types.retrievedType(oldOut).assignableTo(newOut.type());
  if (isDerefResult) {
    Var oldOutReplacement;
    if (oldOut.storage() == Alloc.ALIAS && initialisesOutput) {
      oldOutReplacement=new Var(oldOut.type(),oldOut.name(),Alloc.TEMP,oldOut.defType(),oldOut.provenance(),oldOut.mappedDecl());
      replaceVarDeclaration(srcBlock,oldOut,oldOutReplacement);
      Map<Var,Arg> renames=Collections.singletonMap(oldOut,Arg.createVar(oldOutReplacement));
      for (      Statement inst : instBuffer) {
        inst.renameVars(function,renames,RenameMode.REPLACE_VAR);
      }
    }
 else {
      oldOutReplacement=oldOut;
    }
    WrapUtil.assignOutput(targetBlock,instBuffer,false,oldOutReplacement,newOut,false);
  }
 else {
    throw new STCRuntimeError("String_Node_Str" + "String_Node_Str" + oldOut + "String_Node_Str"+ newOut+ "String_Node_Str"+ "String_Node_Str");
  }
}
Program: 132721
Project: 132721
Buggy source:
private static void replaceCongruentNonRec(Continuation cont,Congruences congruent,InitState init){
  for (  RenameMode mode : RENAME_MODES) {
    cont.renameVars(congruent.replacements(mode,init),mode,false);
  }
}

Fixed version (ground truth):
private static void replaceCongruentNonRec(String function,Continuation cont,Congruences congruent,InitState init){
  for (  RenameMode mode : RENAME_MODES) {
    cont.renameVars(function,congruent.replacements(mode,init),mode,false);
  }
}
Program: 132722
Project: 132722
Buggy source:
private void runPass(Program prog,Function f){
  logger.trace("String_Node_Str" + f.getName());
  try {
    Map<Block,Congruences> congMap;
    congMap=findCongruences(prog,f,ExecContext.CONTROL);
    replaceVals(prog.constants(),f.mainBlock(),congMap,InitState.enterFunction(f));
    inlinePass(prog.constants(),f.mainBlock(),congMap);
  }
 catch (  OptUnsafeError e) {
    logger.debug("String_Node_Str" + f.getName());
  }
}

Fixed version (ground truth):
private void runPass(Program prog,Function f){
  logger.trace("String_Node_Str" + f.getName());
  try {
    Map<Block,Congruences> congMap;
    congMap=findCongruences(prog,f,ExecContext.CONTROL);
    replaceVals(prog.constants(),f.getName(),f.mainBlock(),congMap,InitState.enterFunction(f));
    inlinePass(prog.constants(),f.mainBlock(),congMap);
  }
 catch (  OptUnsafeError e) {
    logger.debug("String_Node_Str" + f.getName());
  }
}
Program: 132724
Project: 132724
Buggy source:
private void replaceCongruent(Instruction inst,Congruences congruent,InitState init){
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str" + inst);
  }
  for (  RenameMode mode : RENAME_MODES) {
    inst.renameVars(congruent.replacements(mode,init),mode);
  }
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str" + inst);
  }
}

Fixed version (ground truth):
private void replaceCongruent(String function,Instruction inst,Congruences congruent,InitState init){
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str" + inst);
  }
  for (  RenameMode mode : RENAME_MODES) {
    inst.renameVars(function,congruent.replacements(mode,init),mode);
  }
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str" + inst);
  }
}
Program: 132726
Project: 132726
Buggy source:
private static void replaceCleanupCongruent(Block block,Congruences congruent,InitState init){
  for (  RenameMode mode : RENAME_MODES) {
    block.renameCleanupActions(congruent.replacements(mode,init),mode);
  }
}

Fixed version (ground truth):
private static void replaceCleanupCongruent(String function,Block block,Congruences congruent,InitState init){
  for (  RenameMode mode : RENAME_MODES) {
    block.renameCleanupActions(function,congruent.replacements(mode,init),mode);
  }
}
Program: 132727
Project: 132727
Buggy source:
private void replaceValsRec(GlobalConstants consts,Continuation cont,Map<Block,Congruences> congruences,InitState init){
  InitState contInit=init.enterContinuation(cont);
  List<InitState> branchInits=new ArrayList<InitState>();
  for (  Block contBlock : cont.getBlocks()) {
    InitState branchInit=contInit.enterBlock(contBlock);
    replaceVals(consts,contBlock,congruences,branchInit);
    branchInits.add(branchInit);
  }
  if (InitState.canUnifyBranches(cont)) {
    init.unifyBranches(cont,branchInits);
  }
}

Fixed version (ground truth):
private void replaceValsRec(GlobalConstants consts,String function,Continuation cont,Map<Block,Congruences> congruences,InitState init){
  InitState contInit=init.enterContinuation(cont);
  List<InitState> branchInits=new ArrayList<InitState>();
  for (  Block contBlock : cont.getBlocks()) {
    InitState branchInit=contInit.enterBlock(contBlock);
    replaceVals(consts,function,contBlock,congruences,branchInit);
    branchInits.add(branchInit);
  }
  if (InitState.canUnifyBranches(cont)) {
    init.unifyBranches(cont,branchInits);
  }
}