nus-yam/ex-repair huggingface dataset:
Program: 61498
Project: 61498
Buggy source:
/** 
 * Method that finds all combination of variables mappings Ex: if var 'a' can be mapped to a1 and a2, and var 'b' to b1 and b2, the method return all combinations (a1,b1), (a2,b1), (a1,b2), (a2,b2)
 * @param mappedVars map of variables (out-of-scope) and candidate replacements of
 * @param varsName names of all variables
 * @param indexVar current variable under analysis
 * @param currentCombination current combination of variables
 * @param allCombinations list that store all variable combinations
 */
public static void findAllVarMappingCombination(Map<VarAccessWrapper,List<CtVariable>> mappedVars,List<VarAccessWrapper> varsName,int indexVar,Map<String,CtVariable> currentCombination,List<Map<String,CtVariable>> allCombinations){
  if (varsName.size() == indexVar) {
    allCombinations.add(currentCombination);
    return;
  }
  VarAccessWrapper currentVar=varsName.get(indexVar);
  List<CtVariable> mapped=mappedVars.get(currentVar);
  if (currentCombination.containsKey(currentVar.getVar().getVariable().getSimpleName())) {
    findAllVarMappingCombination(mappedVars,varsName,indexVar + 1,currentCombination,allCombinations);
  }
  for (  CtVariable varFromMap : mapped) {
    Map<String,CtVariable> newCombination=new TreeMap<>(currentCombination);
    newCombination.put(currentVar.getVar().getVariable().getSimpleName(),varFromMap);
    findAllVarMappingCombination(mappedVars,varsName,indexVar + 1,newCombination,allCombinations);
  }
}

Fixed version (ground truth):
/** 
 * Method that finds all combination of variables mappings Ex: if var 'a' can be mapped to a1 and a2, and var 'b' to b1 and b2, the method return all combinations (a1,b1), (a2,b1), (a1,b2), (a2,b2)
 * @param mappedVars map of variables (out-of-scope) and candidate replacements of
 * @param varsNamesToCombine names of all variables (out of scope)
 * @param indexVar current variable under analysis
 * @param currentCombination current combination of variables
 * @param allCombinations list that store all variable combinations
 */
public static void findAllVarMappingCombination(Map<VarAccessWrapper,List<CtVariable>> mappedVars,List<VarAccessWrapper> varsNamesToCombine,int indexVar,Map<String,CtVariable> currentCombination,List<Map<String,CtVariable>> allCombinations){
  if (varsNamesToCombine.size() == indexVar) {
    allCombinations.add(currentCombination);
    return;
  }
  VarAccessWrapper currentVar=varsNamesToCombine.get(indexVar);
  List<CtVariable> mapped=mappedVars.get(currentVar);
  if (currentCombination.containsKey(currentVar.getVar().getVariable().getSimpleName())) {
    findAllVarMappingCombination(mappedVars,varsNamesToCombine,indexVar + 1,currentCombination,allCombinations);
  }
 else {
    for (    CtVariable varFromMap : mapped) {
      Map<String,CtVariable> newCombination=new TreeMap<>(currentCombination);
      newCombination.put(currentVar.getVar().getVariable().getSimpleName(),varFromMap);
      findAllVarMappingCombination(mappedVars,varsNamesToCombine,indexVar + 1,newCombination,allCombinations);
    }
  }
}
Program: 61503
Project: 61503
Buggy source:
@Override public boolean matches(CtExecutable element){
  return element.getParent(CtExecutable.class) == null && !element.isImplicit() && !(element instanceof CtAnonymousExecutable);
}

Fixed version (ground truth):
@Override public boolean matches(CtExecutable element){
  boolean t=element.getParent(CtExecutable.class) == null && !element.isImplicit() && !(element instanceof CtAnonymousExecutable);
  return t;
}
Program: 61505
Project: 61505
Buggy source:
public String[] commandLang1(File out,boolean step){
  String libsdir=new File("String_Node_Str").getAbsolutePath();
  String dep=libsdir + File.separator + "String_Node_Str"+ File.pathSeparator+ libsdir+ File.separator+ "String_Node_Str"+ File.pathSeparator+ File.separator+ libsdir+ "String_Node_Str"+ File.pathSeparator+ File.separator+ libsdir+ "String_Node_Str";
  String[] args=new String[]{"String_Node_Str",dep,"String_Node_Str","String_Node_Str","String_Node_Str",new File("String_Node_Str").getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",out.getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",(step) ? "String_Node_Str" : "String_Node_Str"};
  return args;
}

Fixed version (ground truth):
public String[] commandLang1(File out,boolean step){
  String libsdir=new File("String_Node_Str").getAbsolutePath();
  String dep=libsdir + File.separator + "String_Node_Str"+ File.pathSeparator+ libsdir+ File.separator+ "String_Node_Str"+ File.pathSeparator+ File.separator+ libsdir+ File.separator+ "String_Node_Str"+ File.pathSeparator+ File.separator+ libsdir+ File.separator+ "String_Node_Str";
  String[] args=new String[]{"String_Node_Str",dep,"String_Node_Str","String_Node_Str","String_Node_Str",new File("String_Node_Str").getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",out.getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",(step) ? "String_Node_Str" : "String_Node_Str"};
  return args;
}
Program: 61506
Project: 61506
Buggy source:
public static List<String> findTestCasesForRegression(String classPath,ProjectRepairFacade projectFacade){
  String[] testClassesRegression=new TestClassesFinder().findIn(classpathFrom(classPath),false);
  List<String> tcregression=Arrays.asList(testClassesRegression);
  List<String> refined=refineListofRegressionTestCases(tcregression);
  return refined;
}

Fixed version (ground truth):
public static List<String> findTestCasesForRegression(String classPath,ProjectRepairFacade projectFacade){
  String cp=projectFacade.getProperties().getDependenciesString();
  classPath+=File.pathSeparator + cp;
  String[] testClassesRegression=new TestClassesFinder().findIn(classpathFrom(classPath),false);
  List<String> tcregression=Arrays.asList(testClassesRegression);
  List<String> refined=refineListofRegressionTestCases(tcregression);
  return refined;
}
Program: 61507
Project: 61507
Buggy source:
@Override public boolean undoChangesInModel(OperatorInstance operation,ProgramVariant p){
  CtStatement fix=(CtStatement)operation.getModified();
  CtBlock<?> parentBlock=operation.getParentBlock();
  int position=operation.getLocationInParent();
  position+=1;
  boolean sucessful=remove(parentBlock,fix,position);
  return sucessful;
}

Fixed version (ground truth):
@Override public boolean undoChangesInModel(OperatorInstance operation,ProgramVariant p){
  CtStatement fix=(CtStatement)operation.getModified();
  CtBlock<?> parentBlock=operation.getParentBlock();
  int position=operation.getLocationInParent();
  position+=1;
  boolean sucessful=remove(parentBlock,fix,position);
  parentBlock.setImplicit(operation.isParentBlockImplicit());
  return sucessful;
}
Program: 61508
Project: 61508
Buggy source:
@Override public boolean undoChangesInModel(OperatorInstance operation,ProgramVariant p){
  CtStatement ctst=(CtStatement)operation.getOriginal();
  CtStatement fix=(CtStatement)operation.getModified();
  CtBlock<?> parentBlock=operation.getParentBlock();
  int position=operation.getLocationInParent();
  remove(parentBlock,fix,position);
  return true;
}

Fixed version (ground truth):
@Override public boolean undoChangesInModel(OperatorInstance operation,ProgramVariant p){
  CtStatement ctst=(CtStatement)operation.getOriginal();
  CtStatement fix=(CtStatement)operation.getModified();
  CtBlock<?> parentBlock=operation.getParentBlock();
  int position=operation.getLocationInParent();
  boolean sucess=remove(parentBlock,fix,position);
  parentBlock.setImplicit(operation.isParentBlockImplicit());
  return sucess;
}
Program: 61509
Project: 61509
Buggy source:
public boolean remove(CtBlock parentBlock,CtStatement fixStatement,int pos){
  CtStatement s=parentBlock.getStatement(pos);
  if (fixStatement.equals(s)) {
    parentBlock.getStatements().remove(pos);
    this.updateBlockImplicitly(parentBlock,false);
    return true;
  }
 else {
    System.out.println("String_Node_Str" + fixStatement + "String_Node_Str"+ (s));
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
public boolean remove(CtBlock parentBlock,CtStatement fixStatement,int pos){
  CtStatement s=parentBlock.getStatement(pos);
  if (fixStatement.equals(s)) {
    parentBlock.getStatements().remove(pos);
    return true;
  }
 else {
    System.out.println("String_Node_Str" + fixStatement + "String_Node_Str"+ (s));
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 61510
Project: 61510
Buggy source:
@Override public boolean undoChangesInModel(OperatorInstance operation,ProgramVariant p){
  CtStatement ctst=(CtStatement)operation.getOriginal();
  CtBlock<?> parentBlock=operation.getParentBlock();
  if (parentBlock != null) {
    if ((parentBlock.getStatements().isEmpty() && operation.getLocationInParent() == 0) || (parentBlock.getStatements().size() >= operation.getLocationInParent())) {
      parentBlock.getStatements().add(operation.getLocationInParent(),ctst);
      this.updateBlockImplicitly(parentBlock,true);
      return true;
    }
 else {
      log.error("String_Node_Str" + ctst + "String_Node_Str"+ operation.getLocationInParent()+ "String_Node_Str"+ parentBlock.getStatements().size());
      throw new IllegalStateException("String_Node_Str");
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean undoChangesInModel(OperatorInstance operation,ProgramVariant p){
  CtStatement ctst=(CtStatement)operation.getOriginal();
  CtBlock<?> parentBlock=operation.getParentBlock();
  if (parentBlock != null) {
    if ((parentBlock.getStatements().isEmpty() && operation.getLocationInParent() == 0) || (parentBlock.getStatements().size() >= operation.getLocationInParent())) {
      parentBlock.getStatements().add(operation.getLocationInParent(),ctst);
      parentBlock.setImplicit(operation.isParentBlockImplicit());
      return true;
    }
 else {
      log.error("String_Node_Str" + ctst + "String_Node_Str"+ operation.getLocationInParent()+ "String_Node_Str"+ parentBlock.getStatements().size());
      throw new IllegalStateException("String_Node_Str");
    }
  }
  return false;
}
Program: 61511
Project: 61511
Buggy source:
public void setParentBlock(CtBlock parentBlock){
  this.parentBlock=parentBlock;
}

Fixed version (ground truth):
public void setParentBlock(CtBlock parentBlock){
  this.parentBlock=parentBlock;
  this.isParentBlockImplicit=parentBlock.isImplicit();
}
Program: 61514
Project: 61514
Buggy source:
public VarMapping(Map<VarWrapper,List<CtVariable>> mapsVariables,List<CtVariableAccess> notMappedVariables){
  super();
  this.mappedVariables=mapsVariables;
  this.notMappedVariables=notMappedVariables;
}

Fixed version (ground truth):
public VarMapping(Map<VarAccessWrapper,List<CtVariable>> mapsVariables,List<CtVariableAccess> notMappedVariables){
  super();
  this.mappedVariables=mapsVariables;
  this.notMappedVariables=notMappedVariables;
}
Program: 61515
Project: 61515
Buggy source:
public void setMappedVariables(Map<VarWrapper,List<CtVariable>> mapsVariables){
  this.mappedVariables=mapsVariables;
}

Fixed version (ground truth):
public void setMappedVariables(Map<VarAccessWrapper,List<CtVariable>> mapsVariables){
  this.mappedVariables=mapsVariables;
}
Program: 61516
Project: 61516
Buggy source:
public Map<VarWrapper,List<CtVariable>> getMappedVariables(){
  return mappedVariables;
}

Fixed version (ground truth):
public Map<VarAccessWrapper,List<CtVariable>> getMappedVariables(){
  return mappedVariables;
}
Program: 61517
Project: 61517
Buggy source:
/** 
 * Adapt the ingredient to the destination according to the mapping. We directly manipulate the variables from the ingredient, which are stored in VarMapping
 * @param varMapping
 * @param destination
 * @return it returns the original variable reference of each convertedvariable
 */
public static Map<CtVariableAccess,CtVariableReference> convertIngredient(VarMapping varMapping,Map<String,CtVariable> mapToFollow){
  Map<CtVariableAccess,CtVariableReference> originalMap=new HashMap<>();
  Map<VarWrapper,List<CtVariable>> mappedVars=varMapping.getMappedVariables();
  for (  VarWrapper var : mappedVars.keySet()) {
    CtVariable varNew=mapToFollow.get(var.getVar().getVariable().getSimpleName());
    originalMap.put(var.getVar(),var.getVar().getVariable());
    var.getVar().setVariable(varNew.getReference());
  }
  return originalMap;
}

Fixed version (ground truth):
/** 
 * Adapt the ingredient to the destination according to the mapping. We directly manipulate the variables from the ingredient, which are stored in VarMapping
 * @param varMapping
 * @param destination
 * @return it returns the original variable reference of each convertedvariable
 */
@SuppressWarnings("String_Node_Str") public static Map<VarAccessWrapper,CtVariableAccess> convertIngredient(VarMapping varMapping,Map<String,CtVariable> mapToFollow){
  Map<VarAccessWrapper,CtVariableAccess> originalMap=new HashMap<>();
  Map<VarAccessWrapper,List<CtVariable>> mappedVars=varMapping.getMappedVariables();
  for (  VarAccessWrapper var : mappedVars.keySet()) {
    CtVariable varNew=mapToFollow.get(var.getVar().getVariable().getSimpleName());
    CtVariableReference newVarReference=varNew.getReference();
    CtVariableAccess originalVarAccessDestination=var.getVar();
    CtVariableAccess newVarAccessDestination=null;
    if (newVarReference instanceof CtLocalVariableReference || newVarReference instanceof CtParameterReference) {
      if (originalVarAccessDestination instanceof CtFieldWrite || originalVarAccessDestination instanceof CtVariableWrite) {
        newVarAccessDestination=MutationSupporter.getFactory().Core().createVariableWrite();
        newVarAccessDestination.setVariable(newVarReference);
      }
 else {
        newVarAccessDestination=MutationSupporter.getFactory().Code().createVariableRead(newVarReference,varNew.hasModifier(ModifierKind.STATIC));
      }
    }
 else     if (newVarReference instanceof CtFieldReference) {
      if (originalVarAccessDestination instanceof CtFieldWrite<?> || originalVarAccessDestination instanceof CtFieldRead<?>) {
        newVarAccessDestination=MutationSupporter.getFactory().Core().createFieldWrite();
      }
 else {
        newVarAccessDestination=MutationSupporter.getFactory().Core().createFieldRead();
      }
      newVarAccessDestination.setVariable(newVarReference);
    }
    if (newVarAccessDestination != null) {
      originalMap.put(new VarAccessWrapper(newVarAccessDestination),originalVarAccessDestination);
      originalVarAccessDestination.replace(newVarAccessDestination);
    }
 else {
      logger.error("String_Node_Str");
    }
  }
  return originalMap;
}
Program: 61518
Project: 61518
Buggy source:
/** 
 * For each modified variable, it resets the variables by putting their original var reference
 * @param varMapping
 * @param original
 */
public static void resetIngredient(VarMapping varMapping,Map<CtVariableAccess,CtVariableReference> original){
  Map<VarWrapper,List<CtVariable>> mappedVars=varMapping.getMappedVariables();
  for (  VarWrapper var : mappedVars.keySet()) {
    CtVariableReference varNew=original.get(var.getVar());
    var.getVar().setVariable(varNew);
  }
}

Fixed version (ground truth):
/** 
 * For each modified variable, it resets the variables by putting their original var reference
 * @param varMapping
 * @param original
 */
public static void resetIngredient(Map<VarAccessWrapper,CtVariableAccess> old){
  for (  VarAccessWrapper newa : old.keySet()) {
    newa.getVar().replace(old.get(newa));
  }
}
Program: 61520
Project: 61520
Buggy source:
/** 
 * Method that finds all combination of variables mappings Ex: if var 'a' can be mapped to a1 and a2, and var 'b' to b1 and b2, the method return all combinations (a1,b1), (a2,b1), (a1,b2), (a2,b2)
 * @param mappedVars map of variables (out-of-scope) and candidate replacements of
 * @param varsName names of all variables
 * @param indexVar current variable under analysis
 * @param currentCombination current combination of variables
 * @param allCombinations list that store all variable combinations
 */
public static void findAllVarMappingCombination(Map<VarWrapper,List<CtVariable>> mappedVars,List<VarWrapper> varsName,int indexVar,Map<String,CtVariable> currentCombination,List<Map<String,CtVariable>> allCombinations){
  if (varsName.size() == indexVar) {
    allCombinations.add(currentCombination);
    return;
  }
  VarWrapper currentVar=varsName.get(indexVar);
  List<CtVariable> mapped=mappedVars.get(currentVar);
  if (currentCombination.containsKey(currentVar.getVar().getVariable().getSimpleName())) {
    findAllVarMappingCombination(mappedVars,varsName,indexVar + 1,currentCombination,allCombinations);
  }
  for (  CtVariable varFromMap : mapped) {
    Map<String,CtVariable> newCombination=new TreeMap<>(currentCombination);
    newCombination.put(currentVar.getVar().getVariable().getSimpleName(),varFromMap);
    findAllVarMappingCombination(mappedVars,varsName,indexVar + 1,newCombination,allCombinations);
  }
}

Fixed version (ground truth):
/** 
 * Method that finds all combination of variables mappings Ex: if var 'a' can be mapped to a1 and a2, and var 'b' to b1 and b2, the method return all combinations (a1,b1), (a2,b1), (a1,b2), (a2,b2)
 * @param mappedVars map of variables (out-of-scope) and candidate replacements of
 * @param varsName names of all variables
 * @param indexVar current variable under analysis
 * @param currentCombination current combination of variables
 * @param allCombinations list that store all variable combinations
 */
public static void findAllVarMappingCombination(Map<VarAccessWrapper,List<CtVariable>> mappedVars,List<VarAccessWrapper> varsName,int indexVar,Map<String,CtVariable> currentCombination,List<Map<String,CtVariable>> allCombinations){
  if (varsName.size() == indexVar) {
    allCombinations.add(currentCombination);
    return;
  }
  VarAccessWrapper currentVar=varsName.get(indexVar);
  List<CtVariable> mapped=mappedVars.get(currentVar);
  if (currentCombination.containsKey(currentVar.getVar().getVariable().getSimpleName())) {
    findAllVarMappingCombination(mappedVars,varsName,indexVar + 1,currentCombination,allCombinations);
  }
  for (  CtVariable varFromMap : mapped) {
    Map<String,CtVariable> newCombination=new TreeMap<>(currentCombination);
    newCombination.put(currentVar.getVar().getVariable().getSimpleName(),varFromMap);
    findAllVarMappingCombination(mappedVars,varsName,indexVar + 1,newCombination,allCombinations);
  }
}
Program: 61521
Project: 61521
Buggy source:
@Test public void testChart1Learning() throws Exception {
  ClassLoader classLoader=getClass().getClassLoader();
  File learningDir=new File(classLoader.getResource("String_Node_Str").getFile());
  File projectLocation=new File("String_Node_Str");
  AstorMain main1=new AstorMain();
  File dirLibs=new File(projectLocation.getAbsolutePath() + File.separator + "String_Node_Str");
  String dep=getDependencies(dirLibs);
  File out=new File(ConfigurationProperties.getProperty("String_Node_Str"));
  String[] args=new String[]{"String_Node_Str",dep,"String_Node_Str","String_Node_Str","String_Node_Str",projectLocation.getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",out.getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",learningDir.getAbsolutePath(),"String_Node_Str",CtPackageIngredientScope.class.getCanonicalName(),"String_Node_Str",CtExecutable.class.getCanonicalName(),"String_Node_Str",CloneIngredientSearchStrategy.class.getCanonicalName(),"String_Node_Str","String_Node_Str",Level.DEBUG.toString()};
  System.out.println(Arrays.toString(args));
  main1.execute(args);
  assertTrue(main1.getEngine().getSolutions().size() > 0);
}

Fixed version (ground truth):
@Test public void testChart1Learning() throws Exception {
  ClassLoader classLoader=getClass().getClassLoader();
  File learningDir=new File(classLoader.getResource("String_Node_Str").getFile());
  File projectLocation=new File("String_Node_Str");
  AstorMain main1=new AstorMain();
  File dirLibs=new File(projectLocation.getAbsolutePath() + File.separator + "String_Node_Str");
  String dep=getDependencies(dirLibs);
  File out=new File(ConfigurationProperties.getProperty("String_Node_Str"));
  String[] args=new String[]{"String_Node_Str",dep,"String_Node_Str","String_Node_Str","String_Node_Str",projectLocation.getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",out.getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",learningDir.getAbsolutePath(),"String_Node_Str",CtPackageIngredientScope.class.getCanonicalName(),"String_Node_Str",CtExecutable.class.getCanonicalName(),"String_Node_Str",CloneIngredientSearchStrategy.class.getCanonicalName(),"String_Node_Str","String_Node_Str",Level.INFO.toString(),"String_Node_Str","String_Node_Str"};
  System.out.println(Arrays.toString(args));
  main1.execute(args);
  assertTrue(main1.getEngine().getSolutions().size() > 0);
}
Program: 61522
Project: 61522
Buggy source:
public void test1(){
  Class1[] sumxx=new Class1[]{};
}

Fixed version (ground truth):
public void test1(){
  Class1[] sumxx=new Class1[]{};
  System.out.println(sumxx);
}
Program: 61525
Project: 61525
Buggy source:
/** 
 * In this case the fitness value is associate to the failures: LESS FITNESS is better.
 */
public double calculateFitnessValue(ProgramVariant variant){
  TestCaseVariantValidationResult result=(TestCaseVariantValidationResult)variant.getValidationResult();
  return result.getFailureCount();
}

Fixed version (ground truth):
/** 
 * In this case the fitness value is associate to the failures: LESS FITNESS is better.
 */
public double calculateFitnessValue(ProgramVariant variant){
  if (variant.getValidationResult() == null)   return this.getWorstMaxFitnessValue();
  TestCaseVariantValidationResult result=(TestCaseVariantValidationResult)variant.getValidationResult();
  return result.getFailureCount();
}
Program: 61526
Project: 61526
Buggy source:
public static void updateRegressionTestCases(ProjectRepairFacade projectConfig){
  List<String> original=projectConfig.getProperties().getRegressionTestCases();
  List<String> refined=refineListofRegressionTestCases(original);
  projectConfig.getProperties().setRegressionCases(refined);
  log.debug("String_Node_Str" + original.size() + "String_Node_Str"+ refined.size());
}

Fixed version (ground truth):
public static void updateRegressionTestCases(ProjectRepairFacade projectConfig){
  List<String> original=projectConfig.getProperties().getRegressionTestCases();
  List<String> refined=refineListofRegressionTestCases(original);
  if (!refined.isEmpty())   projectConfig.getProperties().setRegressionCases(refined);
  log.debug("String_Node_Str" + original.size() + "String_Node_Str"+ refined.size());
}
Program: 61527
Project: 61527
Buggy source:
private static List<String> retriveIgnoreTestCases(){
  String list=ConfigurationProperties.getProperty("String_Node_Str");
  String[] cases=list.split(File.pathSeparator);
  return Arrays.asList(cases);
}

Fixed version (ground truth):
private static List<String> retriveIgnoreTestCases(){
  String list=ConfigurationProperties.getProperty("String_Node_Str");
  log.debug("String_Node_Str" + list);
  String[] cases=list.split(File.pathSeparator);
  return Arrays.asList(cases);
}
Program: 61528
Project: 61528
Buggy source:
public void setDependencies(List<URL> dependencies){
  this.internalProperties.put(ProjectPropertiesEnum.dependencies,dependencies);
}

Fixed version (ground truth):
public void setDependencies(String libPath){
  String[] s=libPath.split(File.pathSeparator);
  for (  String pathcomp : s) {
    this.addLocationToClasspath(pathcomp);
  }
}
Program: 61535
Project: 61535
Buggy source:
/** 
 * Creation of fix space from a CtClass
 * @param root
 */
public void determineScopeOfIngredient(List<CtCodeElement> ingredients){
  for (  CtCodeElement ctCodeElement : ingredients) {
    String key=mapKey(ctCodeElement);
    if (getFixSpace().containsKey(key)) {
      getFixSpace().get(key).add(ctCodeElement);
    }
 else {
      List<CtCodeElement> ingr=new ArrayList<CtCodeElement>();
      ingr.add(ctCodeElement);
      getFixSpace().put(key,ingr);
    }
  }
  recreateTypesStructures();
}

Fixed version (ground truth):
/** 
 * Creation of fix space from a list of ctelements.
 */
public void determineScopeOfIngredient(List<CtCodeElement> ingredients){
  for (  CtCodeElement ctCodeElement : ingredients) {
    String key=mapKey(ctCodeElement);
    List<CtCodeElement> ingredientsKey=getFixSpace().get(key);
    if (!getFixSpace().containsKey(key)) {
      ingredientsKey=new ArrayList<CtCodeElement>();
      getFixSpace().put(key,ingredientsKey);
    }
    if (!discartDuplicates || !ingredientsKey.contains(ctCodeElement)) {
      ingredientsKey.add(ctCodeElement);
    }
  }
  recreateTypesStructures();
}
Program: 61536
Project: 61536
Buggy source:
@Override public boolean wasSuccessful(){
  return (getValidation("String_Node_Str") == null || getValidation("String_Node_Str").wasSuccessful()) && (getValidation("String_Node_Str") == null || getValidation("String_Node_Str").wasSuccessful());
}

Fixed version (ground truth):
@Override public boolean wasSuccessful(){
  return (getValidation("String_Node_Str") == null || getValidation("String_Node_Str").wasSuccessful());
}
Program: 61538
Project: 61538
Buggy source:
/** 
 * It adds to the ignore list all failing TC that were not passed as argument. \ They are probably flaky test.
 * @param failingTestCases
 */
private void addFlakyFailingTestToIgnoredList(List<String> failingTestCases){
  List<String> originalFailing=Arrays.asList(ConfigurationProperties.getProperty("String_Node_Str").split(File.pathSeparator));
  List<String> onlyFailingInFL=new ArrayList<>(failingTestCases);
  onlyFailingInFL.removeAll(originalFailing);
  logger.debug("String_Node_Str" + onlyFailingInFL + "String_Node_Str");
  String ignoredTestCases=ConfigurationProperties.getProperty("String_Node_Str");
  for (  String failingFL : onlyFailingInFL) {
    ignoredTestCases+=File.pathSeparator + failingFL;
  }
  ConfigurationProperties.properties.setProperty("String_Node_Str",ignoredTestCases);
}

Fixed version (ground truth):
/** 
 * It adds to the ignore list all failing TC that were not passed as argument. \ They are probably flaky test.
 * @param failingTestCases
 */
private void addFlakyFailingTestToIgnoredList(List<String> failingTestCases){
  if (ConfigurationProperties.getProperty("String_Node_Str") == null)   return;
  List<String> originalFailing=Arrays.asList(ConfigurationProperties.getProperty("String_Node_Str").split(File.pathSeparator));
  List<String> onlyFailingInFL=new ArrayList<>(failingTestCases);
  onlyFailingInFL.removeAll(originalFailing);
  logger.debug("String_Node_Str" + onlyFailingInFL + "String_Node_Str");
  String ignoredTestCases=ConfigurationProperties.getProperty("String_Node_Str");
  for (  String failingFL : onlyFailingInFL) {
    ignoredTestCases+=File.pathSeparator + failingFL;
  }
  ConfigurationProperties.properties.setProperty("String_Node_Str",ignoredTestCases);
}
Program: 61540
Project: 61540
Buggy source:
/** 
 * Process-based validation Advantage: stability, memory consumption, CG activity Disadvantage: time.
 * @param currentVariant
 * @return
 */
@Override public ProgramVariantValidationResult validate(ProgramVariant currentVariant,ProjectRepairFacade projectFacade){
  try {
    ProcessValidator validator=new ProcessValidator();
    boolean executeAlloriginalValidation=true;
    ProgramVariantValidationResult resultOriginal=validator.validate(currentVariant,projectFacade,executeAlloriginalValidation);
    if (resultOriginal == null || !resultOriginal.wasSuccessful()) {
      return resultOriginal;
    }
    ProgramVariantValidationResult resultEvoExecution=runTestFromEvoSuite(currentVariant,projectFacade,this.isOverOriginal());
    log.info("String_Node_Str" + resultEvoExecution.toString());
    EvoSuiteValidationResult evoResult=new EvoSuiteValidationResult();
    evoResult.setManualTestValidation(resultOriginal);
    evoResult.setEvoValidation(resultEvoExecution);
    return evoResult;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Process-based validation Advantage: stability, memory consumption, CG activity Disadvantage: time.
 * @param currentVariant
 * @return
 */
@Override public ProgramVariantValidationResult validate(ProgramVariant currentVariant,ProjectRepairFacade projectFacade){
  try {
    ProcessValidator validator=new ProcessValidator();
    boolean executeAlloriginalValidation=true;
    ProgramVariantValidationResult resultOriginal=validator.validate(currentVariant,projectFacade,executeAlloriginalValidation);
    if (resultOriginal == null || !resultOriginal.wasSuccessful()) {
      return resultOriginal;
    }
    boolean runESoverOriginalBuggyClass=ConfigurationProperties.getPropertyBool("String_Node_Str");
    ProgramVariantValidationResult resultEvoExecution=runTestFromEvoSuite(currentVariant,projectFacade,runESoverOriginalBuggyClass);
    log.info("String_Node_Str" + resultEvoExecution.toString());
    EvoSuiteValidationResult evoResult=new EvoSuiteValidationResult();
    evoResult.setManualTestValidation(resultOriginal);
    evoResult.setEvoValidation(resultEvoExecution);
    return evoResult;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 61541
Project: 61541
Buggy source:
@Override public ProgramVariantValidationResult validate(ProgramVariant mutatedVariant,ProjectRepairFacade projectFacade){
  try {
    ProgramVariantValidationResult failingValidation=super.runFailing(mutatedVariant,projectFacade);
    log.debug("String_Node_Str" + failingValidation);
    if (failingValidation != null && failingValidation.wasSuccessful()) {
      ProgramVariantValidationResult regressionValidation=super.runRegression(mutatedVariant,projectFacade);
      log.debug("String_Node_Str" + regressionValidation);
      ProgramVariantValidationResult evoSuiteRegressionValidation=evoValidator.runTestFromEvoSuite(mutatedVariant,projectFacade);
      log.debug("String_Node_Str" + evoSuiteRegressionValidation);
      EvoSuiteValidationResult evoResult=new EvoSuiteValidationResult();
      evoResult.setFailingTestValidation(failingValidation);
      evoResult.setEvoValidation(evoSuiteRegressionValidation);
      evoResult.setManualTestValidation(regressionValidation);
      return evoResult;
    }
 else {
      return failingValidation;
    }
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
  return null;
}

Fixed version (ground truth):
@Override public ProgramVariantValidationResult validate(ProgramVariant mutatedVariant,ProjectRepairFacade projectFacade){
  try {
    boolean runESoverOriginalBuggyClass=ConfigurationProperties.getPropertyBool("String_Node_Str");
    ProgramVariantValidationResult failingValidation=super.runFailing(mutatedVariant,projectFacade);
    log.debug("String_Node_Str" + failingValidation);
    if (failingValidation != null && failingValidation.wasSuccessful()) {
      ProgramVariantValidationResult regressionValidation=super.runRegression(mutatedVariant,projectFacade);
      log.debug("String_Node_Str" + regressionValidation);
      ProgramVariantValidationResult evoSuiteRegressionValidation=evoValidator.runTestFromEvoSuite(mutatedVariant,projectFacade,runESoverOriginalBuggyClass);
      log.debug("String_Node_Str" + evoSuiteRegressionValidation);
      EvoSuiteValidationResult evoResult=new EvoSuiteValidationResult();
      evoResult.setFailingTestValidation(failingValidation);
      evoResult.setEvoValidation(evoSuiteRegressionValidation);
      evoResult.setManualTestValidation(regressionValidation);
      return evoResult;
    }
 else {
      return failingValidation;
    }
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
  return null;
}
Program: 61544
Project: 61544
Buggy source:
@Override public int getFailureCount(){
  int count=0;
  for (  ProgramVariantValidationResult pv : this.validations.values()) {
    count+=pv.getFailureCount();
  }
  return count;
}

Fixed version (ground truth):
@Override public int getFailureCount(){
  if (this.validations.isEmpty())   return 0;
  int count=0;
  for (  ProgramVariantValidationResult pv : this.validations.values()) {
    if (pv != null)     count+=pv.getFailureCount();
  }
  return count;
}
Program: 61545
Project: 61545
Buggy source:
/** 
 * It retrieves all variables access which declarations are inside the ingredient.
 * @param ingredientRootElement
 * @param varAccessCollected
 * @return
 */
public static List<CtVariableAccess> collectInductionVariableAccess(CtElement ingredientRootElement,List<CtVariableAccess> varAccessCollected){
  List<CtVariableAccess> induction=new ArrayList();
  for (  CtVariableAccess ctVariableAccess : varAccessCollected) {
    CtVariable var=ctVariableAccess.getVariable().getDeclaration();
    boolean insideIngredient=checkParent(var,ingredientRootElement);
    if (insideIngredient)     induction.add(ctVariableAccess);
  }
  return induction;
}

Fixed version (ground truth):
/** 
 * It retrieves all variables access which declarations are inside the ingredient.
 * @param ingredientRootElement
 * @param varAccessCollected
 * @return
 */
public static List<CtVariableAccess> collectInductionVariableAccess(CtElement ingredientRootElement,List<CtVariableAccess> varAccessCollected){
  List<CtVariableAccess> induction=new ArrayList<>();
  for (  CtVariableAccess ctVariableAccess : varAccessCollected) {
    CtVariableReference varref=ctVariableAccess.getVariable();
    if (!(varref instanceof CtLocalVariableReference))     continue;
    CtVariable var=varref.getDeclaration();
    boolean insideIngredient=checkParent(var,ingredientRootElement);
    if (insideIngredient)     induction.add(ctVariableAccess);
  }
  return induction;
}
Program: 61546
Project: 61546
Buggy source:
public ProgramVariantValidationResult runRegression(ProgramVariant mutatedVariant,ProjectRepairFacade projectFacade){
  try {
    URL[] bc=createClassPath(mutatedVariant,projectFacade);
    JUnitExecutorProcess testProcessRunner=new JUnitIndirectExecutorProcess(false);
    return executeRegressionTesting(mutatedVariant,bc,testProcessRunner,projectFacade);
  }
 catch (  MalformedURLException e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
protected ProgramVariantValidationResult runRegression(ProgramVariant mutatedVariant,ProjectRepairFacade projectFacade,URL[] bc){
  JUnitExecutorProcess testProcessRunner=new JUnitIndirectExecutorProcess(false);
  if (ConfigurationProperties.getPropertyBool("String_Node_Str"))   return executeRegressionTestingOneByOne(mutatedVariant,bc,testProcessRunner,projectFacade);
 else   return executeRegressionTesting(mutatedVariant,bc,testProcessRunner,projectFacade);
}
Program: 61548
Project: 61548
Buggy source:
/** 
 * This methods determines whether all the variable access contained in a CtElement passes as parameter match with a variable from a set of variables given as argument. The argument <code>matchName </code> indicates whether Type and Names are compared (value true), only type (false).
 * @param varContext List of variables to match
 * @param element element to extract the var access to match
 * @return
 */
public static boolean fitInContext(List<CtVariable> varContext,CtElement element,boolean matchName){
  List<CtVariableAccess> varAccessCollected=collectVariableAccess(element);
  Map<CtVariableAccess,List<CtVariable>> matched=matchVars(varContext,varAccessCollected,matchName);
  for (  CtVariableAccess ctVariableAccess : matched.keySet()) {
    List<CtVariable> mapped=matched.get(ctVariableAccess);
    if (mapped.isEmpty()) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * This methods determines whether all the variable access contained in a CtElement passes as parameter match with a variable from a set of variables given as argument. The argument <code>matchName </code> indicates whether Type and Names are compared (value true), only type (false).
 * @param varContext List of variables to match
 * @param ingredientCtElement element to extract the var access to match
 * @return
 */
public static boolean fitInContext(List<CtVariable> varContext,CtElement ingredientCtElement,boolean matchName){
  List<CtVariableAccess> varAccessCollected=collectVariableAccess(ingredientCtElement);
  List<CtVariableAccess> varInductionCollected=collectInductionVariableAccess(ingredientCtElement,varAccessCollected);
  boolean removedInduction=varAccessCollected.removeAll(varInductionCollected);
  if (varInductionCollected.size() > 0 && !removedInduction)   throw new IllegalAccessError("String_Node_Str");
  boolean nameConflict=nameConflict(varContext,varInductionCollected);
  if (nameConflict) {
    logger.debug("String_Node_Str" + varAccessCollected);
    return false;
  }
  List<CtVariableAccess> varStaticAccessCollected=collectStaticVariableAccess(ingredientCtElement,varAccessCollected);
  boolean removedStaticAccess=varAccessCollected.removeAll(varStaticAccessCollected);
  if (varStaticAccessCollected.size() > 0 && !removedStaticAccess)   throw new IllegalAccessError("String_Node_Str");
  Map<CtVariableAccess,List<CtVariable>> matched=matchVars(varContext,varAccessCollected,matchName);
  for (  CtVariableAccess ctVariableAccess : matched.keySet()) {
    List<CtVariable> mapped=matched.get(ctVariableAccess);
    if (mapped.isEmpty()) {
      return false;
    }
  }
  return true;
}
Program: 61549
Project: 61549
Buggy source:
@Override public boolean applyChangesInModel(ModificationInstance operation,ProgramVariant p){
  boolean successful=false;
  CtStatement ctst=(CtStatement)operation.getOriginal();
  CtBlock parentBlock=operation.getParentBlock();
  if (parentBlock != null) {
    try {
      parentBlock.getStatements().remove(ctst);
      successful=true;
      operation.setSuccessfulyApplied(successful);
    }
 catch (    Exception ex) {
      log.error("String_Node_Str" + ex.getMessage());
      operation.setExceptionAtApplied(ex);
      operation.setSuccessfulyApplied(false);
    }
  }
 else {
    log.error("String_Node_Str");
  }
  return successful;
}

Fixed version (ground truth):
@Override public boolean applyChangesInModel(ModificationInstance operation,ProgramVariant p){
  boolean successful=false;
  CtStatement ctst=(CtStatement)operation.getOriginal();
  CtBlock parentBlock=operation.getParentBlock();
  if (parentBlock != null) {
    try {
      parentBlock.getStatements().remove(operation.getLocationInParent());
      successful=true;
      operation.setSuccessfulyApplied(successful);
    }
 catch (    Exception ex) {
      log.error("String_Node_Str" + ex.getMessage());
      operation.setExceptionAtApplied(ex);
      operation.setSuccessfulyApplied(false);
    }
  }
 else {
    log.error("String_Node_Str");
  }
  return successful;
}
Program: 61550
Project: 61550
Buggy source:
@Test public void testMath85_CustomBasicIngredientStrategy() throws Exception {
  AstorMain main1=new AstorMain();
  String dep=new File("String_Node_Str").getAbsolutePath();
  String[] args=new String[]{"String_Node_Str",dep,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",new File("String_Node_Str").getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",CloneIngredientSearchStrategy.class.getCanonicalName()};
  System.out.println(Arrays.toString(args));
  main1.execute(args);
  validatePatchExistence(out + File.separator + "String_Node_Str");
  List<ProgramVariant> solutions=main1.getEngine().getSolutions();
  assertTrue(solutions.size() > 0);
}

Fixed version (ground truth):
@Test public void testMath85_CustomBasicIngredientStrategy() throws Exception {
  AstorMain main1=new AstorMain();
  String dep=new File("String_Node_Str").getAbsolutePath();
  String[] args=new String[]{"String_Node_Str",dep,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",new File("String_Node_Str").getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",EfficientIngredientStrategy.class.getCanonicalName()};
  System.out.println(Arrays.toString(args));
  main1.execute(args);
  validatePatchExistence(out + File.separator + "String_Node_Str");
  List<ProgramVariant> solutions=main1.getEngine().getSolutions();
  assertTrue(solutions.size() > 0);
}
Program: 61551
Project: 61551
Buggy source:
protected String printTestResult(TestResult result){
  return "String_Node_Str" + result.wasSuccessful() + "String_Node_Str"+ result.failures+ "String_Node_Str"+ result.casesExecuted+ "String_Node_Str"+ result.failTest+ "String_Node_Str";
}

Fixed version (ground truth):
protected String printTestResult(TestResult result){
  if (result == null)   return "String_Node_Str";
  return "String_Node_Str" + result.wasSuccessful() + "String_Node_Str"+ result.failures+ "String_Node_Str"+ result.casesExecuted+ "String_Node_Str"+ result.failTest+ "String_Node_Str";
}
Program: 61552
Project: 61552
Buggy source:
public String toString(){
  return "String_Node_Str" + "String_Node_Str" + printTestResult(this.getTestResult()) + "String_Node_Str"+ printTestResult(this.manualTestValidation.getTestResult())+ "String_Node_Str"+ printTestResult(this.evoValidation.getTestResult());
}

Fixed version (ground truth):
public String toString(){
  return "String_Node_Str" + "String_Node_Str" + printTestResult(this.getTestResult()) + ((this.manualTestValidation != null) ? "String_Node_Str" + printTestResult(this.manualTestValidation.getTestResult()) : "String_Node_Str")+ ((this.evoValidation != null) ? "String_Node_Str" + printTestResult(this.evoValidation.getTestResult()) : "String_Node_Str");
}
Program: 61553
Project: 61553
Buggy source:
@Before public void setUp() throws Exception {
  main=new AstorMain();
  Logger.getLogger(StandardEnvironment.class).setLevel(Level.ERROR);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  MutationSupporter.cleanFactory();
  Logger.getLogger(StandardEnvironment.class).setLevel(Level.ERROR);
}
Program: 61554
Project: 61554
Buggy source:
public CompilationResult compileOnMemory(Collection<CtClass> ctClassList,URL[] cp){
  Map<String,String> toCompile=new HashMap<String,String>();
  prettyPrinter=new DefaultJavaPrettyPrinter(getEnvironment());
  dcc=new JavaXToolsCompiler();
  for (  CtClass ctClass : ctClassList) {
    try {
      this.getProcessingManager().process(ctClass);
      toCompile.put(ctClass.getQualifiedName(),sourceForModelledClass(ctClass));
    }
 catch (    Exception e) {
      logger.error("String_Node_Str" + ctClass.getQualifiedName(),e);
    }
  }
  List<String> cps=new ArrayList<>();
  cps.add("String_Node_Str");
  String s="String_Node_Str";
  for (  URL url : cp) {
    s+=((url.getPath()) + File.pathSeparator);
  }
  cps.add(s);
  CompilationResult rbc=dcc.javaBytecodeFor(toCompile,new HashMap<String,byte[]>(),cps);
  return rbc;
}

Fixed version (ground truth):
public CompilationResult compileOnMemory(Collection<CtClass> ctClassList,URL[] cp){
  Map<String,String> toCompile=new HashMap<String,String>();
  prettyPrinter=new DefaultJavaPrettyPrinter(getEnvironment());
  dcc=new JavaXToolsCompiler();
  for (  CtClass ctClass : ctClassList) {
    try {
      this.getProcessingManager().process(ctClass);
      toCompile.put(ctClass.getQualifiedName(),sourceForModelledClass(ctClass));
    }
 catch (    Exception e) {
      logger.error("String_Node_Str" + ctClass.getQualifiedName(),e);
    }
  }
  List<String> cps=new ArrayList<>();
  cps.add("String_Node_Str");
  String path="String_Node_Str";
  for (  URL url : cp) {
    path+=((url.getPath()) + File.pathSeparator);
  }
  cps.add(path);
  String compliance=ConfigurationProperties.getProperty("String_Node_Str");
  cps.add("String_Node_Str");
  cps.add("String_Node_Str" + compliance);
  cps.add("String_Node_Str");
  cps.add("String_Node_Str" + compliance);
  CompilationResult rbc=dcc.javaBytecodeFor(toCompile,new HashMap<String,byte[]>(),cps);
  return rbc;
}
Program: 61555
Project: 61555
Buggy source:
/** 
 * Gets the associated (standard) environment.
 */
public Environment getEnvironment(){
  if (this.environment == null) {
    this.environment=new StandardEnvironment();
  }
  return this.environment;
}

Fixed version (ground truth):
/** 
 * Gets the associated (standard) environment. When we create it, we set the compliance level taken as parameter (if any)
 */
public Environment getEnvironment(){
  if (this.environment == null) {
    this.environment=new StandardEnvironment();
    String compliance=ConfigurationProperties.getProperty("String_Node_Str");
    this.environment.setLevel(compliance);
  }
  return this.environment;
}