nus-yam/ex-repair huggingface dataset:
Program: 61556
Project: 61556
Buggy source:
public List<CtClass> reificateEvoSuiteTest(String evoTestpath,String[] classpath){
  logger.debug("String_Node_Str" + evoTestpath + "String_Node_Str"+ Arrays.toString(classpath));
  MutationSupporter mutatorSupporter=MutationSupporter.currentSupporter;
  Factory factory=MutationSupporter.currentSupporter.getFactory();
  String codeLocation=evoTestpath;
  boolean saveOutput=true;
  try {
    mutatorSupporter.buildModel(codeLocation,classpath,saveOutput);
  }
 catch (  Exception e) {
    e.printStackTrace();
    logger.error(e.getMessage());
    mutatorSupporter.getFactory().getEnvironment().setComplianceLevel(ConfigurationProperties.getPropertyInt("String_Node_Str"));
    mutatorSupporter.buildModel(codeLocation,classpath,saveOutput);
  }
  List<CtType<?>> allTypes=mutatorSupporter.getFactory().Type().getAll();
  List<CtClass> ESTestClasses=new ArrayList<>();
  for (  CtType<?> ctType : allTypes) {
    if (ctType.getSimpleName().endsWith(EVOSUITE_SUFFIX) || ctType.getSimpleName().endsWith(EVOSUITE_scaffolding_SUFFIX)) {
      ESTestClasses.add((CtClass)ctType);
    }
  }
  return ESTestClasses;
}

Fixed version (ground truth):
public List<CtClass> reificateEvoSuiteTest(String evoTestpath,String[] classpath){
  logger.debug("String_Node_Str" + evoTestpath + "String_Node_Str"+ Arrays.toString(classpath));
  MutationSupporter mutatorSupporter=MutationSupporter.currentSupporter;
  String codeLocation=evoTestpath;
  boolean saveOutput=false;
  try {
    mutatorSupporter.buildModel(codeLocation,classpath,saveOutput);
  }
 catch (  Exception e) {
    e.printStackTrace();
    logger.error(e.getMessage());
    mutatorSupporter.getFactory().getEnvironment().setComplianceLevel(ConfigurationProperties.getPropertyInt("String_Node_Str"));
    mutatorSupporter.buildModel(codeLocation,classpath,saveOutput);
  }
  List<CtType<?>> allTypes=mutatorSupporter.getFactory().Type().getAll();
  List<CtClass> ESTestClasses=new ArrayList<>();
  for (  CtType<?> ctType : allTypes) {
    if (ctType.getSimpleName().endsWith(EVOSUITE_SUFFIX) || ctType.getSimpleName().endsWith(EVOSUITE_scaffolding_SUFFIX)) {
      ESTestClasses.add((CtClass)ctType);
    }
  }
  return ESTestClasses;
}
Program: 61557
Project: 61557
Buggy source:
/** 
 * New Program Variant Clone
 * @param parentVariant
 * @param id
 * @return
 */
public ProgramVariant createProgramVariantFromAnother(ProgramVariant parentVariant,int id,int generation){
  ProgramVariant childVariant=new ProgramVariant(id);
  childVariant.setGenerationSource(generation);
  childVariant.setParent(parentVariant);
  childVariant.getModificationPoints().addAll(parentVariant.getModificationPoints());
  if (!ConfigurationProperties.getPropertyBool("String_Node_Str"))   childVariant.getOperations().putAll(parentVariant.getOperations());
  childVariant.setLastGenAnalyzed(parentVariant.getLastGenAnalyzed());
  childVariant.getBuiltClasses().putAll(parentVariant.getBuiltClasses());
  childVariant.setFitness(parentVariant.getFitness());
  return childVariant;
}

Fixed version (ground truth):
/** 
 * New Program Variant Clone
 * @param parentVariant
 * @param id
 * @return
 */
public ProgramVariant createProgramVariantFromAnother(ProgramVariant parentVariant,int id,int generation){
  ProgramVariant childVariant=new ProgramVariant(id);
  childVariant.setGenerationSource(generation);
  childVariant.setParent(parentVariant);
  childVariant.addModificationPoints(parentVariant.getModificationPoints());
  if (!ConfigurationProperties.getPropertyBool("String_Node_Str"))   childVariant.getOperations().putAll(parentVariant.getOperations());
  childVariant.setLastGenAnalyzed(parentVariant.getLastGenAnalyzed());
  childVariant.getBuiltClasses().putAll(parentVariant.getBuiltClasses());
  childVariant.setFitness(parentVariant.getFitness());
  return childVariant;
}
Program: 61558
Project: 61558
Buggy source:
/** 
 * A Program instances is created from the list of suspicious. For each suspiciuos a list of modif point is created.
 * @param suspiciousList
 * @param idProgramInstance
 * @return
 */
private ProgramVariant createProgramInstance(List<SuspiciousCode> suspiciousList,int idProgramInstance){
  ProgramVariant progInstance=new ProgramVariant(idProgramInstance);
  log.debug("String_Node_Str" + idProgramInstance);
  if (!suspiciousList.isEmpty()) {
    for (    SuspiciousCode suspiciousCode : suspiciousList) {
      List<SuspiciousModificationPoint> modifPoints=createModificationPoints(suspiciousCode,progInstance);
      if (modifPoints != null)       progInstance.getModificationPoints().addAll(modifPoints);
 else {
        log.info("String_Node_Str" + suspiciousCode);
      }
    }
    log.info("String_Node_Str" + suspiciousList.size() + "String_Node_Str"+ progInstance.getModificationPoints().size());
  }
 else {
    List<SuspiciousModificationPoint> pointsFromAllStatements=createModificationPoints(progInstance);
    progInstance.getModificationPoints().addAll(pointsFromAllStatements);
  }
  log.info("String_Node_Str" + progInstance.getModificationPoints().size());
  return progInstance;
}

Fixed version (ground truth):
/** 
 * A Program instances is created from the list of suspicious. For each suspiciuos a list of modif point is created.
 * @param suspiciousList
 * @param idProgramInstance
 * @return
 */
private ProgramVariant createProgramInstance(List<SuspiciousCode> suspiciousList,int idProgramInstance){
  ProgramVariant progInstance=new ProgramVariant(idProgramInstance);
  log.debug("String_Node_Str" + idProgramInstance);
  if (!suspiciousList.isEmpty()) {
    for (    SuspiciousCode suspiciousCode : suspiciousList) {
      List<SuspiciousModificationPoint> modifPoints=createModificationPoints(suspiciousCode,progInstance);
      if (modifPoints != null)       progInstance.addModificationPoints(modifPoints);
 else {
        log.info("String_Node_Str" + suspiciousCode);
      }
    }
    log.info("String_Node_Str" + suspiciousList.size() + "String_Node_Str"+ progInstance.getModificationPoints().size());
  }
 else {
    List<SuspiciousModificationPoint> pointsFromAllStatements=createModificationPoints(progInstance);
    progInstance.getModificationPoints().addAll(pointsFromAllStatements);
  }
  log.info("String_Node_Str" + progInstance.getModificationPoints().size());
  return progInstance;
}
Program: 61561
Project: 61561
Buggy source:
@Override public void startEvolution() throws Exception {
  dateInitEvolution=new Date();
  generationsExecuted=1;
  int maxMinutes=ConfigurationProperties.getPropertyInt("String_Node_Str");
  for (  ProgramVariant parentVariant : variants) {
    for (    ModificationPoint gen : parentVariant.getModificationPoints()) {
      List<ModificationInstance> genOperations=createOperators((SuspiciousModificationPoint)gen);
      if (genOperations == null || genOperations.isEmpty())       continue;
      for (      ModificationInstance pointOperation : genOperations) {
        try {
          log.info("String_Node_Str" + gen);
          log.info("String_Node_Str" + pointOperation);
        }
 catch (        Exception e) {
        }
        ProgramVariant solutionVariant=variantFactory.createProgramVariantFromAnother(parentVariant,generationsExecuted);
        solutionVariant.getOperations().put(generationsExecuted,Arrays.asList(pointOperation));
        applyNewMutationOperationToSpoonElement(pointOperation);
        boolean solution=processCreatedVariant(solutionVariant,generationsExecuted);
        if (solution) {
          this.solutions.add(solutionVariant);
          if (ConfigurationProperties.getPropertyBool("String_Node_Str"))           return;
        }
        undoOperationToSpoonElement(pointOperation);
        if (!belowMaxTime(dateInitEvolution,maxMinutes)) {
          log.debug("String_Node_Str");
          return;
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void startEvolution() throws Exception {
  dateInitEvolution=new Date();
  generationsExecuted=1;
  int maxMinutes=ConfigurationProperties.getPropertyInt("String_Node_Str");
  for (  ProgramVariant parentVariant : variants) {
    for (    ModificationPoint modifPoint : parentVariant.getModificationPoints()) {
      List<ModificationInstance> genOperations=createOperators((SuspiciousModificationPoint)modifPoint);
      if (genOperations == null || genOperations.isEmpty())       continue;
      for (      ModificationInstance pointOperation : genOperations) {
        try {
          log.info("String_Node_Str" + modifPoint);
          log.info("String_Node_Str" + pointOperation);
        }
 catch (        Exception e) {
        }
        ProgramVariant solutionVariant=variantFactory.createProgramVariantFromAnother(parentVariant,generationsExecuted);
        solutionVariant.getOperations().put(generationsExecuted,Arrays.asList(pointOperation));
        applyNewMutationOperationToSpoonElement(pointOperation);
        boolean solution=processCreatedVariant(solutionVariant,generationsExecuted);
        if (solution) {
          this.solutions.add(solutionVariant);
          if (ConfigurationProperties.getPropertyBool("String_Node_Str"))           return;
        }
        undoOperationToSpoonElement(pointOperation);
        if (!belowMaxTime(dateInitEvolution,maxMinutes)) {
          log.debug("String_Node_Str");
          return;
        }
      }
    }
  }
}
Program: 61562
Project: 61562
Buggy source:
public ExhaustiveSearchEngine(MutationSupporter mutatorExecutor,ProjectRepairFacade projFacade) throws JSAPException {
  super(mutatorExecutor,projFacade);
  this.setRepairActionSpace(new UnparSpace());
}

Fixed version (ground truth):
public ExhaustiveSearchEngine(MutationSupporter mutatorExecutor,ProjectRepairFacade projFacade) throws JSAPException {
  super(mutatorExecutor,projFacade);
}
Program: 61563
Project: 61563
Buggy source:
private void initModel() throws Exception {
  String codeLocation=projectFacade.getInDirWithPrefix(ProgramVariant.DEFAULT_ORIGINAL_VARIANT);
  String classpath=projectFacade.getProperties().getDependenciesString();
  String[] cpArray=classpath.split(File.pathSeparator);
  try {
    mutatorSupporter.buildModel(codeLocation,cpArray);
    log.debug("String_Node_Str" + codeLocation);
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + ConfigurationProperties.getPropertyInt("String_Node_Str"));
    log.error(e.getMessage());
    mutatorSupporter.getFactory().getEnvironment().setComplianceLevel(ConfigurationProperties.getPropertyInt("String_Node_Str"));
    mutatorSupporter.buildModel(codeLocation,cpArray);
  }
  BlockReificationScanner visitor=new BlockReificationScanner();
  for (  CtType c : mutatorSupporter.getFactory().Type().getAll()) {
    c.accept(visitor);
  }
  List<String> testcases=projectFacade.getProperties().getRegressionTestCases();
  List<CtType<?>> types=mutatorSupporter.getFactory().Class().getAll();
  for (  CtType<?> ctType : types) {
    if (!(ctType instanceof CtClass)) {
      continue;
    }
    if (testcases.contains(ctType.getQualifiedName())) {
      mutatorSupporter.getTestClasses().add((CtClass)ctType);
    }
 else {
      mutatorSupporter.getClasses().add((CtClass)ctType);
    }
  }
  FinderTestCases.updateRegressionTestCases(projectFacade);
}

Fixed version (ground truth):
private void initModel() throws Exception {
  String codeLocation=projectFacade.getInDirWithPrefix(ProgramVariant.DEFAULT_ORIGINAL_VARIANT);
  String classpath=projectFacade.getProperties().getDependenciesString();
  String[] cpArray=classpath.split(File.pathSeparator);
  try {
    mutatorSupporter.buildModel(codeLocation,cpArray);
    log.debug("String_Node_Str" + codeLocation);
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + ConfigurationProperties.getPropertyInt("String_Node_Str"));
    log.error(e.getMessage());
    mutatorSupporter.getFactory().getEnvironment().setComplianceLevel(ConfigurationProperties.getPropertyInt("String_Node_Str"));
    mutatorSupporter.buildModel(codeLocation,cpArray);
  }
  BlockReificationScanner visitor=new BlockReificationScanner();
  for (  CtType c : mutatorSupporter.getFactory().Type().getAll()) {
    c.accept(visitor);
  }
  List<String> testcases=projectFacade.getProperties().getRegressionTestCases();
  List<CtType<?>> types=mutatorSupporter.getFactory().Class().getAll();
  for (  CtType<?> ctType : types) {
    if (!(ctType instanceof CtClass)) {
      continue;
    }
    if (testcases.contains(ctType.getQualifiedName())) {
      mutatorSupporter.getTestClasses().add((CtClass)ctType);
    }
 else {
      mutatorSupporter.getClasses().add((CtClass)ctType);
    }
  }
}
Program: 61564
Project: 61564
Buggy source:
/** 
 * This method refine the list of test cases received as parameter. I analyze each model of each test to validate whether is a test or not. 
 */
public static List<String> refineListofRegressionTestCases(List<String> allTest){
  List<String> regressionCases=new ArrayList<String>();
  List<String> ignoreTestcases=retriveIgnoreTestCases();
  for (  String candidateTest : allTest) {
    CtType<?> type=MutationSupporter.getFactory().Type().get(candidateTest);
    if (type != null && (!type.getModifiers().contains(ModifierKind.ABSTRACT)) && !(type instanceof CtInterface) && isValidConstructor(type) && !(isIgnoredTestCase(type.getQualifiedName(),ignoreTestcases))) {
      regressionCases.add(type.getQualifiedName());
    }
  }
  return regressionCases;
}

Fixed version (ground truth):
/** 
 * This method refine the list of test cases received as parameter. I analyze each model of each test to validate whether is a test or not. 
 */
private static List<String> refineListofRegressionTestCases(List<String> allTest){
  List<String> regressionCases=new ArrayList<String>();
  List<String> ignoreTestcases=retriveIgnoreTestCases();
  for (  String candidateTest : allTest) {
    CtType<?> type=MutationSupporter.getFactory().Type().get(candidateTest);
    if (type != null && (!type.getModifiers().contains(ModifierKind.ABSTRACT)) && !(type instanceof CtInterface) && isValidConstructor(type) && !(isIgnoredTestCase(type.getQualifiedName(),ignoreTestcases))) {
      regressionCases.add(type.getQualifiedName());
    }
  }
  return regressionCases;
}
Program: 61565
Project: 61565
Buggy source:
@Override public void process(CtStatement element){
  if (!(element instanceof CtBlock || element instanceof CtClass || element instanceof CtMethod|| element instanceof CtTry|| element instanceof CtCatch) && ((element.getParent() instanceof CtBlock) || (element.getParent() instanceof CtCase) || (element.getParent() instanceof CtIf)|| (element.getParent() instanceof CtWhile))) {
    add(element);
  }
}

Fixed version (ground truth):
@Override public void process(CtStatement element){
  if (!(element instanceof CtBlock || element instanceof CtClass || element instanceof CtMethod|| element instanceof CtTry|| element instanceof CtCatch) && (element.getParent() instanceof CtBlock)) {
    add(element);
  }
}
Program: 61567
Project: 61567
Buggy source:
private boolean isValidConstructor(CtType<?> type){
  if (type instanceof CtClass<?>) {
    CtClass<?> ctClass=((CtClass<?>)type);
    if (ctClass.getSuperclass() == null || !ctClass.getSuperclass().getSimpleName().equals("String_Node_Str")) {
      return true;
    }
    return ((CtClass<?>)type).getConstructor() != null || ((CtClass<?>)type).getConstructor(type.getFactory().Class().createReference(String.class)) != null;
  }
  return false;
}

Fixed version (ground truth):
private static boolean isValidConstructor(CtType<?> type){
  if (type instanceof CtClass<?>) {
    CtClass<?> ctClass=((CtClass<?>)type);
    if (ctClass.getSuperclass() == null || !ctClass.getSuperclass().getSimpleName().equals("String_Node_Str")) {
      return true;
    }
    return ((CtClass<?>)type).getConstructor() != null || ((CtClass<?>)type).getConstructor(type.getFactory().Class().createReference(String.class)) != null;
  }
  return false;
}
Program: 61568
Project: 61568
Buggy source:
private boolean isIgnoredTestCase(String nameTestCase,List<String> ignoredList){
  for (  String ignoreTC : ignoredList) {
    if (nameTestCase.startsWith(ignoreTC)) {
      return true;
    }
    ;
  }
  return false;
}

Fixed version (ground truth):
private static boolean isIgnoredTestCase(String nameTestCase,List<String> ignoredList){
  for (  String ignoreTC : ignoredList) {
    if (nameTestCase.startsWith(ignoreTC)) {
      return true;
    }
    ;
  }
  return false;
}
Program: 61569
Project: 61569
Buggy source:
private List<String> retriveIgnoreTestCases(){
  String list=ConfigurationProperties.getProperty("String_Node_Str");
  String[] cases=list.split("String_Node_Str");
  return Arrays.asList(cases);
}

Fixed version (ground truth):
private static List<String> retriveIgnoreTestCases(){
  String list=ConfigurationProperties.getProperty("String_Node_Str");
  String[] cases=list.split("String_Node_Str");
  return Arrays.asList(cases);
}
Program: 61570
Project: 61570
Buggy source:
public ProgramVariantValidationResult validateVariantSecondPhaseSingle(List<String> failingCases,String testSuiteClassName) throws FileNotFoundException, ClassNotFoundException, InitializationError {
  JUnitTestExecutor muTestEx=new JUnitTestExecutor();
  ProgramVariantValidationResult validation=new ProgramVariantValidationResult();
  logger.info("String_Node_Str");
  Result result=muTestEx.runTest(testSuiteClassName);
  validation.addResultRegressionTest(result);
  validation.setRegressionExecuted(result.wasSuccessful());
  return validation;
}

Fixed version (ground truth):
@Deprecated public ProgramVariantValidationResult validateVariantSecondPhaseSingle(List<String> failingCases,String testSuiteClassName) throws FileNotFoundException, ClassNotFoundException, InitializationError {
  JUnitTestExecutor muTestEx=new JUnitTestExecutor();
  ProgramVariantValidationResult validation=new ProgramVariantValidationResult();
  logger.info("String_Node_Str");
  Result result=muTestEx.runTest(testSuiteClassName);
  validation.addResultRegressionTest(result);
  validation.setRegressionExecuted(result.wasSuccessful());
  return validation;
}
Program: 61571
Project: 61571
Buggy source:
/** 
 * Feed the list of test cases according to the definition POM/build.xml
 * @return 
 */
public List<String> retrieveRegressionTestCases(List<String> allTest){
  List<String> regressionCases=new ArrayList<String>();
  List<String> ignoreTestcases=retriveIgnoreTestCases();
  for (  String candidateTest : allTest) {
    CtType<?> type=MutationSupporter.getFactory().Type().get(candidateTest);
    if (type != null && (!type.getModifiers().contains(ModifierKind.ABSTRACT)) && !(type instanceof CtInterface) && isValidConstructor(type) && !(isIgnoredTestCase(type.getQualifiedName(),ignoreTestcases))) {
      regressionCases.add(type.getQualifiedName());
    }
  }
  return regressionCases;
}

Fixed version (ground truth):
/** 
 * Feed the list of test cases according to the definition POM/build.xml
 * @return 
 */
public static List<String> retrieveRegressionTestCases(List<String> allTest){
  List<String> regressionCases=new ArrayList<String>();
  List<String> ignoreTestcases=retriveIgnoreTestCases();
  for (  String candidateTest : allTest) {
    CtType<?> type=MutationSupporter.getFactory().Type().get(candidateTest);
    if (type != null && (!type.getModifiers().contains(ModifierKind.ABSTRACT)) && !(type instanceof CtInterface) && isValidConstructor(type) && !(isIgnoredTestCase(type.getQualifiedName(),ignoreTestcases))) {
      regressionCases.add(type.getQualifiedName());
    }
  }
  return regressionCases;
}
Program: 61572
Project: 61572
Buggy source:
private void validateReversedOriginalVariant(ProgramVariant variant){
  for (  CtType st : variant.getAffectedClasses()) {
    String original=originalModel.get(st.getQualifiedName());
    boolean idem=original.equals(st.toString());
    if (!idem) {
      log.error("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void validateReversedOriginalVariant(ProgramVariant variant){
  for (  CtType st : variant.getAffectedClasses()) {
    String original=originalModel.get(st.getQualifiedName());
    if (original != null) {
      boolean idem=original.equals(st.toString());
      if (!idem) {
        log.error("String_Node_Str");
      }
    }
  }
}
Program: 61573
Project: 61573
Buggy source:
private void saveOriginalVariant(ProgramVariant variant){
  originalModel.clear();
  for (  CtType st : variant.getAffectedClasses()) {
    originalModel.put(st.getQualifiedName(),st.toString());
  }
}

Fixed version (ground truth):
private void saveOriginalVariant(ProgramVariant variant){
  originalModel.clear();
  for (  CtType st : variant.getAffectedClasses()) {
    try {
      originalModel.put(st.getQualifiedName(),st.toString());
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + st.getQualifiedName());
    }
  }
}
Program: 61574
Project: 61574
Buggy source:
private void saveModifVariant(ProgramVariant variant){
  modifModel.clear();
  for (  CtType st : variant.getAffectedClasses()) {
    modifModel.put(st.getQualifiedName(),st.toString());
  }
}

Fixed version (ground truth):
private void saveModifVariant(ProgramVariant variant){
  modifModel.clear();
  for (  CtType st : variant.getAffectedClasses()) {
    try {
      modifModel.put(st.getQualifiedName(),st.toString());
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + st.getQualifiedName());
    }
  }
}
Program: 61575
Project: 61575
Buggy source:
public CompilationResult compileOnMemory(Collection<CtClass> ctClassList,URL[] cp){
  Map<String,String> toCompile=new HashMap<String,String>();
  prettyPrinter=new DefaultJavaPrettyPrinter(getEnvironment());
  try {
    for (    CtClass ctClass : ctClassList) {
      this.getProcessingManager().process(ctClass);
      String[] tmp=ctClass.getQualifiedName().split("String_Node_Str");
      char[][] pack=new char[tmp.length - 1][];
      toCompile.put(ctClass.getQualifiedName(),sourceForModelledClass(ctClass));
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    List<String> errors=new ArrayList<String>();
    errors.add(e.getMessage());
    CompilationResult rbc=new CompilationResult(null,errors);
    return rbc;
  }
  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());
  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;
}
Program: 61576
Project: 61576
Buggy source:
protected synchronized String sourceForModelledClass(CtType<?> modelledClass){
  prettyPrinter.scan(modelledClass);
  String sourceCode="String_Node_Str" + modelledClass.getPackage().toString() + "String_Node_Str"+ System.getProperty("String_Node_Str")+ prettyPrinter.toString();
  prettyPrinter.reset();
  return sourceCode;
}

Fixed version (ground truth):
protected synchronized String sourceForModelledClass(CtType<?> modelledClass){
  prettyPrinter.reset();
  prettyPrinter.scan(modelledClass);
  String sourceCode="String_Node_Str" + modelledClass.getPackage().toString() + "String_Node_Str"+ System.getProperty("String_Node_Str")+ prettyPrinter.toString();
  prettyPrinter.reset();
  return sourceCode;
}
Program: 61577
Project: 61577
Buggy source:
public void saveSourceCode(CtClass element){
  if (javaPrinter == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!element.isTopLevel()) {
    return;
  }
  units.clear();
  javaPrinter.getCreatedFiles().clear();
  javaPrinter.process(element);
}

Fixed version (ground truth):
public void saveSourceCode(CtClass element){
  if (javaPrinter == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!element.isTopLevel()) {
    return;
  }
  try {
    units.clear();
    javaPrinter.getCreatedFiles().clear();
    javaPrinter.process(element);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + element.getQualifiedName());
  }
}
Program: 61578
Project: 61578
Buggy source:
public static boolean matchVariable(List<CtVariable> varContext,CtVariableAccess vartofind){
  CtTypeReference typeToFind=vartofind.getType();
  List<CtVariable> types=compatiblesSubType(varContext,typeToFind);
  for (  CtVariable ctVariableWithTypes : types) {
    boolean match=ctVariableWithTypes.getSimpleName().equals(vartofind.getVariable().getSimpleName());
    if (match) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean matchVariable(List<CtVariable> varContext,CtVariableAccess vartofind){
  try {
    CtTypeReference typeToFind=vartofind.getType();
    List<CtVariable> types=compatiblesSubType(varContext,typeToFind);
    for (    CtVariable ctVariableWithTypes : types) {
      boolean match=ctVariableWithTypes.getSimpleName().equals(vartofind.getVariable().getSimpleName());
      if (match) {
        return true;
      }
    }
  }
 catch (  Exception ex) {
    logger.error("String_Node_Str",ex);
  }
  return false;
}
Program: 61579
Project: 61579
Buggy source:
@Override public void startEvolution() throws Exception {
  dateInitEvolution=new Date();
  final int generation=1;
  for (  ProgramVariant parentVariant : variants) {
    for (    Gen gen : parentVariant.getGenList()) {
      List<GenOperationInstance> genOperations=createOperators((GenSuspicious)gen);
      if (genOperations == null || genOperations.isEmpty())       continue;
      for (      GenOperationInstance genOperation : genOperations) {
        try {
          log.info("String_Node_Str" + ((GenSuspicious)gen).getSuspicious());
          log.info("String_Node_Str" + genOperation);
        }
 catch (        Exception e) {
        }
        ProgramVariant solutionVariant=variantFactory.createProgramVariantFromAnother(parentVariant,generation);
        solutionVariant.getOperations().put(generation,Arrays.asList(genOperation));
        applyNewMutationOperationToSpoonElement(genOperation);
        boolean solution=processCreatedVariant(solutionVariant,generation);
        if (solution) {
          this.solutions.add(solutionVariant);
        }
        undoOperationToSpoonElement(genOperation);
      }
    }
  }
  showResults(generation);
}

Fixed version (ground truth):
@Override public void startEvolution() throws Exception {
  dateInitEvolution=new Date();
  final int generation=1;
  outerloop:   for (  ProgramVariant parentVariant : variants) {
    for (    Gen gen : parentVariant.getGenList()) {
      List<GenOperationInstance> genOperations=createOperators((GenSuspicious)gen);
      if (genOperations == null || genOperations.isEmpty())       continue;
      for (      GenOperationInstance genOperation : genOperations) {
        try {
          log.info("String_Node_Str" + ((GenSuspicious)gen).getSuspicious());
          log.info("String_Node_Str" + genOperation);
        }
 catch (        Exception e) {
        }
        ProgramVariant solutionVariant=variantFactory.createProgramVariantFromAnother(parentVariant,generation);
        solutionVariant.getOperations().put(generation,Arrays.asList(genOperation));
        applyNewMutationOperationToSpoonElement(genOperation);
        boolean solution=processCreatedVariant(solutionVariant,generation);
        if (solution) {
          this.solutions.add(solutionVariant);
          if (ConfigurationProperties.getPropertyBool("String_Node_Str"))           break;
        }
        undoOperationToSpoonElement(genOperation);
      }
    }
  }
  showResults(generation);
}
Program: 61580
Project: 61580
Buggy source:
/** 
 * By default, it initializes the spoon model. It should not be created before. Otherwise, an exception occurs.
 * @param suspicious
 * @throws Exception
 */
public void initPopulation(List<SuspiciousCode> suspicious) throws Exception {
  if (MutationSupporter.getFactory().Type().getAll().isEmpty()) {
    initModel();
  }
  log.info("String_Node_Str" + suspicious.size());
  initializePopulation(suspicious);
  if (originalVariant == null) {
    log.error("String_Node_Str");
    return;
  }
  if (originalVariant.getGenList().isEmpty()) {
    log.error("String_Node_Str");
    return;
  }
  if (getFixSpace() != null) {
    List<?> classesForIngredients=retrieveClassesForIngredients();
    getFixSpace().defineSpace(classesForIngredients);
  }
  boolean validInstance=validateInstance(originalVariant);
  assert(validInstance);
  for (  ProgramVariant initvariant : variants) {
    initvariant.setFitness(originalVariant.getFitness());
  }
}

Fixed version (ground truth):
/** 
 * By default, it initializes the spoon model. It should not be created before. Otherwise, an exception occurs.
 * @param suspicious
 * @throws Exception
 */
public void initPopulation(List<SuspiciousCode> suspicious) throws Exception {
  if (MutationSupporter.getFactory().Type().getAll().isEmpty()) {
    initModel();
  }
  log.info("String_Node_Str" + suspicious.size());
  initializePopulation(suspicious);
  if (originalVariant == null) {
    log.error("String_Node_Str");
    return;
  }
  if (originalVariant.getGenList().isEmpty()) {
    log.error("String_Node_Str");
    return;
  }
  if (getFixSpace() != null) {
    List<?> classesForIngredients=retrieveClassesForIngredients();
    getFixSpace().defineSpace(classesForIngredients);
  }
  boolean validInstance=validateInstance(originalVariant);
  if (validInstance) {
    throw new IllegalStateException("String_Node_Str");
  }
  for (  ProgramVariant initvariant : variants) {
    initvariant.setFitness(originalVariant.getFitness());
  }
}
Program: 61581
Project: 61581
Buggy source:
/** 
 * The fix is a replacement of an return statement
 * @throws Exception
 */
public void testMath85issue280() 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"};
  System.out.println(Arrays.toString(args));
  main1.main(args);
  validatePatchExistence(out + File.separator + "String_Node_Str",5);
}

Fixed version (ground truth):
/** 
 * The fix is a replacement of an return statement
 * @throws Exception
 */
@Test public void testMath85issue280() 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"};
  System.out.println(Arrays.toString(args));
  main1.main(args);
  validatePatchExistence(out + File.separator + "String_Node_Str");
}
Program: 61582
Project: 61582
Buggy source:
protected GenOperationInstance createOperationForGen(Gen gen,MutantCtElement fix) throws IllegalAccessException {
  Gen genSusp=gen;
  GenProgMutationOperation operationType=GenProgMutationOperation.REPLACE;
  if (!(genSusp.getCodeElement() instanceof CtIf)) {
    return null;
  }
  CtIf targetIF=(CtIf)genSusp.getCodeElement();
  CtElement cpar=targetIF.getParent();
  if ((cpar == null)) {
    return null;
  }
  GenOperationInstance operation=new GenOperationInstance();
  operation.setOriginal(targetIF.getCondition());
  operation.setOperationApplied(operationType);
  operation.setGen(genSusp);
  List<MutantCtElement> mutations=getMutants(targetIF);
  log.debug("String_Node_Str" + mutations.size() + "String_Node_Str"+ mutations);
  if (mutations == null || mutations.size() == 0) {
    return null;
  }
  operation.setModified(fix.getElement());
  return operation;
}

Fixed version (ground truth):
protected GenOperationInstance createOperationForGen(Gen gen,MutantCtElement fix) throws IllegalAccessException {
  Gen genSusp=gen;
  MutationOperation operationType=MutationExpression.REPLACE;
  if (!(genSusp.getCodeElement() instanceof CtIf)) {
    return null;
  }
  CtIf targetIF=(CtIf)genSusp.getCodeElement();
  CtElement cpar=targetIF.getParent();
  if ((cpar == null)) {
    return null;
  }
  GenOperationInstance operation=new GenOperationInstance();
  operation.setOriginal(targetIF.getCondition());
  operation.setOperationApplied(operationType);
  operation.setGen(genSusp);
  List<MutantCtElement> mutations=getMutants(targetIF);
  log.debug("String_Node_Str" + mutations.size() + "String_Node_Str"+ mutations);
  if (mutations == null || mutations.size() == 0) {
    return null;
  }
  operation.setModified(fix.getElement());
  return operation;
}
Program: 61583
Project: 61583
Buggy source:
/** 
 * Create a Gen Mutation for a given CtElement
 * @param ctElementPointed
 * @param className
 * @param suspValue
 * @return
 * @throws IllegalAccessException
 */
@Override protected GenOperationInstance createOperationForGen(Gen gen) throws IllegalAccessException {
  Gen genSusp=gen;
  GenProgMutationOperation operationType=GenProgMutationOperation.REPLACE;
  if (!(genSusp.getCodeElement() instanceof CtIf)) {
    return null;
  }
  CtIf targetIF=(CtIf)genSusp.getCodeElement();
  CtElement cpar=targetIF.getParent();
  if ((cpar == null)) {
    return null;
  }
  GenOperationInstance operation=new GenOperationInstance();
  operation.setOriginal(targetIF.getCondition());
  operation.setOperationApplied(operationType);
  operation.setGen(genSusp);
  List<MutantCtElement> mutations=getMutants(targetIF);
  log.debug("String_Node_Str" + mutations.size() + "String_Node_Str"+ mutations);
  if (mutations == null || mutations.size() == 0) {
    return null;
  }
  CtElement fix=null;
  int max=0;
  boolean continueSearching=true;
  while (continueSearching && max < mutations.size()) {
    fix=getFixMutation(mutations);
    continueSearching=alreadyApplied(gen,fix,operationType);
    max++;
  }
  if (continueSearching) {
    log.debug("String_Node_Str");
    return null;
  }
  operation.setModified(fix);
  return operation;
}

Fixed version (ground truth):
/** 
 * Create a Gen Mutation for a given CtElement
 * @param ctElementPointed
 * @param className
 * @param suspValue
 * @return
 * @throws IllegalAccessException
 */
@Override protected GenOperationInstance createOperationForGen(Gen gen) throws IllegalAccessException {
  Gen genSusp=gen;
  MutationOperation operationType=MutationExpression.REPLACE;
  if (!(genSusp.getCodeElement() instanceof CtIf)) {
    return null;
  }
  CtIf targetIF=(CtIf)genSusp.getCodeElement();
  CtElement cpar=targetIF.getParent();
  if ((cpar == null)) {
    return null;
  }
  GenOperationInstance operation=new GenOperationInstance();
  operation.setOriginal(targetIF.getCondition());
  operation.setOperationApplied(operationType);
  operation.setGen(genSusp);
  List<MutantCtElement> mutations=getMutants(targetIF);
  log.debug("String_Node_Str" + mutations.size() + "String_Node_Str"+ mutations);
  if (mutations == null || mutations.size() == 0) {
    return null;
  }
  CtElement fix=null;
  int max=0;
  boolean continueSearching=true;
  while (continueSearching && max < mutations.size()) {
    fix=getFixMutation(mutations);
    continueSearching=alreadyApplied(gen,fix,operationType);
    max++;
  }
  if (continueSearching) {
    log.debug("String_Node_Str");
    return null;
  }
  operation.setModified(fix);
  return operation;
}
Program: 61584
Project: 61584
Buggy source:
@Override public void transform(GenOperationInstance operation) throws Exception {
  Factory factory=MutationSupporter.getFactory();
  CtExpression rightTerm=null, leftTerm=null;
  try {
    boolean successful=false;
    CtExpression ctst=(CtExpression)operation.getOriginal();
    CtExpression fix=(CtExpression)operation.getModified();
    if (operation.getOperationApplied() == GenProgMutationOperation.REPLACE) {
      ctst.replace((CtExpression)fix);
      successful=true;
      operation.setSuccessfulyApplied((successful));
    }
    log.debug("String_Node_Str" + ctst.getParent().getSignature());
  }
 catch (  Exception ex) {
    log.error("String_Node_Str" + ex.getMessage());
    operation.setExceptionAtApplied(ex);
    operation.setSuccessfulyApplied(false);
  }
}

Fixed version (ground truth):
@Override public void transform(GenOperationInstance operation) throws Exception {
  Factory factory=MutationSupporter.getFactory();
  CtExpression rightTerm=null, leftTerm=null;
  try {
    boolean successful=false;
    CtExpression ctst=(CtExpression)operation.getOriginal();
    CtExpression fix=(CtExpression)operation.getModified();
    if (operation.getOperationApplied() == GenProgMutationOperation.REPLACE || operation.getOperationApplied() == MutationExpression.REPLACE) {
      ctst.replace((CtExpression)fix);
      successful=true;
      operation.setSuccessfulyApplied((successful));
    }
    log.debug("String_Node_Str" + ctst.getParent().getSignature());
  }
 catch (  Exception ex) {
    log.error("String_Node_Str" + ex.getMessage());
    operation.setExceptionAtApplied(ex);
    operation.setSuccessfulyApplied(false);
  }
}
Program: 61585
Project: 61585
Buggy source:
protected static int numberSolutions(String dir){
  File out=new File(dir + File.separator + "String_Node_Str");
  assertTrue(out.listFiles().length > 1);
  int cantSol=0;
  for (  File sol : out.listFiles()) {
    cantSol+=(sol.getName().startsWith("String_Node_Str")) ? 1 : 0;
  }
  return cantSol;
}

Fixed version (ground truth):
protected static int numberSolutions(String dir){
  File out=new File(dir + File.separator + "String_Node_Str");
  int cantSol=0;
  for (  File sol : out.listFiles()) {
    cantSol+=(sol.getName().startsWith("String_Node_Str")) ? 1 : 0;
  }
  return cantSol;
}
Program: 61586
Project: 61586
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void testMath2ExampleRemoveModeManySolutions() throws Exception {
  AstorMain main1=new AstorMain();
  String[] args=(new String[]{"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"});
  main1.main(args);
  int numberSolution=numberSolutions(out + File.separator + "String_Node_Str");
  assertTrue(numberSolution > 1);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void testMath2ExampleRemoveModeManySolutions() throws Exception {
  AstorMain main1=new AstorMain();
  String[] args=(new String[]{"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"});
  main1.main(args);
  int numberSolution=numberSolutions(out + File.separator + "String_Node_Str");
  assertTrue(numberSolution > 1);
}
Program: 61587
Project: 61587
Buggy source:
/** 
 * This method analyze the output of the junit executor (i.e.,  {@link JUnitTestExecutor}) and return an entity called TestResult with the result of the test execution
 * @param p
 * @return
 */
private TestResult getTestResult(Process p){
  TestResult tr=new TestResult();
  boolean success=false;
  String out="String_Node_Str";
  try {
    BufferedReader in=new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line;
    while ((line=in.readLine()) != null) {
      out+=line + "String_Node_Str";
      if (line.startsWith(JUnitTestExecutor.OUTSEP)) {
        String[] s=line.split(JUnitTestExecutor.OUTSEP);
        int nrtc=Integer.valueOf(s[1]);
        tr.casesExecuted=nrtc;
        int failing=Integer.valueOf(s[2]);
        tr.failures=failing;
        if (!"String_Node_Str".equals(s[3])) {
          String[] falinglist=s[3].replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").split("String_Node_Str");
          for (          String string : falinglist) {
            if (!string.trim().isEmpty())             tr.failTest.add(string.trim());
          }
        }
        success=true;
      }
    }
    in.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (success)   return tr;
 else {
    log.error("String_Node_Str" + getProcessError(p.getInputStream()) + "String_Node_Str"+ getProcessError(p.getErrorStream()));
    return null;
  }
}

Fixed version (ground truth):
/** 
 * This method analyze the output of the junit executor (i.e.,  {@link JUnitTestExecutor}) and return an entity called TestResult with the result of the test execution
 * @param p
 * @return
 */
private TestResult getTestResult(Process p){
  TestResult tr=new TestResult();
  boolean success=false;
  String out="String_Node_Str";
  try {
    BufferedReader in=new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line;
    while ((line=in.readLine()) != null) {
      out+=line + "String_Node_Str";
      if (line.startsWith(JUnitTestExecutor.OUTSEP)) {
        String[] s=line.split(JUnitTestExecutor.OUTSEP);
        int nrtc=Integer.valueOf(s[1]);
        tr.casesExecuted=nrtc;
        int failing=Integer.valueOf(s[2]);
        tr.failures=failing;
        if (!"String_Node_Str".equals(s[3])) {
          String[] falinglist=s[3].replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").split("String_Node_Str");
          for (          String string : falinglist) {
            if (!string.trim().isEmpty())             tr.failTest.add(string.trim());
          }
        }
        success=true;
      }
    }
    in.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (success)   return tr;
 else {
    log.error("String_Node_Str" + out + "String_Node_Str"+ getProcessError(p.getErrorStream()));
    return null;
  }
}
Program: 61588
Project: 61588
Buggy source:
@Test public void testSeedExampleKaliAddReturnVoid() throws Exception {
  this.testSeedExampleKali("String_Node_Str");
  validatePatchExistence(ConfigurationProperties.getProperty("String_Node_Str") + File.separator + "String_Node_Str",3);
}

Fixed version (ground truth):
@Test public void testSeedExampleKaliAddReturnVoid() throws Exception {
  this.testSeedExampleKali("String_Node_Str");
  validatePatchExistence(ConfigurationProperties.getProperty("String_Node_Str") + File.separator + "String_Node_Str");
}
Program: 61590
Project: 61590
Buggy source:
protected List retrieveClassesForIngredients(){
  if (getFixSpace().strategy().equals(IngredientSpaceStrategy.LOCAL))   return originalVariant.getAffectedClasses();
  if (getFixSpace().strategy().equals(IngredientSpaceStrategy.GLOBAL) || getFixSpace().strategy().equals(IngredientSpaceStrategy.PACKAGE))   return this.mutatorSupporter.getFactory().Type().getAll();
  return null;
}

Fixed version (ground truth):
protected List retrieveClassesForIngredients(){
  if (getFixSpace().strategy().equals(IngredientSpaceStrategy.LOCAL) || getFixSpace().strategy().equals(IngredientSpaceStrategy.PACKAGE))   return originalVariant.getAffectedClasses();
  if (getFixSpace().strategy().equals(IngredientSpaceStrategy.GLOBAL))   return this.mutatorSupporter.getFactory().Type().getAll();
  return null;
}
Program: 61592
Project: 61592
Buggy source:
@Override public void process(CtStatement element){
  if (!(element instanceof CtBlock || element instanceof CtClass || element instanceof CtMethod|| element instanceof CtTry|| element instanceof CtCatch) && (element.getParent() instanceof CtBlock)) {
    add(element);
  }
}

Fixed version (ground truth):
@Override public void process(CtStatement element){
  if (!(element instanceof CtBlock || element instanceof CtClass || element instanceof CtMethod|| element instanceof CtTry|| element instanceof CtCatch) && ((element.getParent() instanceof CtBlock) || (element.getParent() instanceof CtCase) || (element.getParent() instanceof CtIf)|| (element.getParent() instanceof CtWhile))) {
    add(element);
  }
}
Program: 61595
Project: 61595
Buggy source:
protected List<Gen> getWeightGenList(List<Gen> genList){
  List<Gen> remaining=new ArrayList<Gen>(genList);
  List<Gen> solution=new ArrayList<Gen>();
  for (int i=0; i < genList.size(); i++) {
    List<WeightCtElement> we=new ArrayList<WeightCtElement>();
    double sum=0;
    for (    Gen gen : remaining) {
      double susp=((GenSuspicious)gen).getSuspicious().getSuspiciousValue();
      sum+=susp;
      WeightCtElement w=new WeightCtElement(gen,0);
      w.weight=susp;
      we.add(w);
    }
    for (    WeightCtElement weightCtElement : we) {
      weightCtElement.weight=weightCtElement.weight / sum;
    }
    WeightCtElement.feedAccumulative(we);
    WeightCtElement selected=WeightCtElement.selectElementWeightBalanced(we);
    Gen selectedg=(Gen)selected.element;
    remaining.remove(selectedg);
    solution.add(selectedg);
  }
  return solution;
}

Fixed version (ground truth):
protected List<Gen> getWeightGenList(List<Gen> genList){
  List<Gen> remaining=new ArrayList<Gen>(genList);
  List<Gen> solution=new ArrayList<Gen>();
  for (int i=0; i < genList.size(); i++) {
    List<WeightCtElement> we=new ArrayList<WeightCtElement>();
    double sum=0;
    for (    Gen gen : remaining) {
      double susp=((GenSuspicious)gen).getSuspicious().getSuspiciousValue();
      sum+=susp;
      WeightCtElement w=new WeightCtElement(gen,0);
      w.weight=susp;
      we.add(w);
    }
    if (sum != 0) {
      for (      WeightCtElement weightCtElement : we) {
        weightCtElement.weight=weightCtElement.weight / sum;
      }
      WeightCtElement.feedAccumulative(we);
      WeightCtElement selected=WeightCtElement.selectElementWeightBalanced(we);
      Gen selectedg=(Gen)selected.element;
      remaining.remove(selectedg);
      solution.add(selectedg);
    }
 else {
      solution.addAll(remaining);
      break;
    }
  }
  return solution;
}
Program: 61596
Project: 61596
Buggy source:
@Deprecated private boolean isValidConstructor(CtSimpleType<?> type){
  if (type instanceof CtClass<?>) {
    return ((CtClass<?>)type).getConstructor() != null || ((CtClass<?>)type).getConstructor(type.getFactory().Class().createReference(String.class)) != null;
  }
  return false;
}

Fixed version (ground truth):
private boolean isValidConstructor(CtSimpleType<?> type){
  if (type instanceof CtClass<?>) {
    CtClass<?> ctClass=((CtClass<?>)type);
    if (ctClass.getSuperclass() == null || !ctClass.getSuperclass().getSimpleName().equals("String_Node_Str")) {
      return true;
    }
    return ((CtClass<?>)type).getConstructor() != null || ((CtClass<?>)type).getConstructor(type.getFactory().Class().createReference(String.class)) != null;
  }
  return false;
}