nus-yam/ex-repair huggingface dataset:
Program: 187250
Project: 187250
Buggy source:
@Before public void setUp(){
  MockitoAnnotations.initMocks(this);
  rootDescription=Description.createTestDescription(this.getClass(),NAME_ROOT);
  storyDescription=Description.createTestDescription(this.getClass(),NAME_STORY);
  rootDescription.addChild(storyDescription);
  scenarioDescription=Description.createTestDescription(this.getClass(),NAME_SCENARIO);
  storyDescription.addChild(scenarioDescription);
  story=new Story();
  story.namedAs("String_Node_Str" + this.getClass().getName() + "String_Node_Str");
  keywords=new Keywords();
}

Fixed version (ground truth):
@Before public void setUp(){
  MockitoAnnotations.initMocks(this);
  rootDescription=Description.createSuiteDescription(NAME_ROOT);
  storyDescription=Description.createSuiteDescription(NAME_STORY);
  rootDescription.addChild(storyDescription);
  scenarioDescription=Description.createTestDescription(this.getClass(),NAME_SCENARIO);
  storyDescription.addChild(scenarioDescription);
  story=new Story();
  story.namedAs(NAME_STORY);
  keywords=new Keywords();
}
Program: 187251
Project: 187251
Buggy source:
private void initRootDescription(){
  rootDescription=Description.createSuiteDescription(configurableEmbedder.getClass());
  rootDescription.getChildren().addAll(storyDescriptions);
}

Fixed version (ground truth):
private void initRootDescription(){
  rootDescription=Description.createSuiteDescription(configurableEmbedder.getClass());
  for (  Description storyDescription : storyDescriptions) {
    rootDescription.addChild(storyDescription);
  }
}
Program: 187252
Project: 187252
Buggy source:
public static EmbedderControls recommandedControls(Embedder embedder){
  return embedder.embedderControls().doIgnoreFailureInView(true).doIgnoreFailureInStories(true).useThreads(1);
}

Fixed version (ground truth):
/** 
 * @deprecated use {@link #recommendedControls(Embedder)} instead.  
 */
@Deprecated public static EmbedderControls recommandedControls(Embedder embedder){
  return recommendedControls(embedder);
}
Program: 187253
Project: 187253
Buggy source:
public ExampleScenarioJUnitStories(){
  JUnitReportingRunner.recommandedControls(configuredEmbedder());
}

Fixed version (ground truth):
public ExampleScenarioJUnitStories(){
  JUnitReportingRunner.recommendedControls(configuredEmbedder());
}
Program: 187254
Project: 187254
Buggy source:
public ExampleScenarioJUnitStory(){
  JUnitReportingRunner.recommandedControls(configuredEmbedder());
}

Fixed version (ground truth):
public ExampleScenarioJUnitStory(){
  JUnitReportingRunner.recommendedControls(configuredEmbedder());
}
Program: 187255
Project: 187255
Buggy source:
@Test public void shouldPrepareEmbedder(){
  EmbedderControls ec=mock(EmbedderControls.class);
  when(ec.doIgnoreFailureInStories(Mockito.anyBoolean())).thenReturn(ec);
  when(ec.doIgnoreFailureInView(Mockito.anyBoolean())).thenReturn(ec);
  when(ec.useThreads(Mockito.anyInt())).thenReturn(ec);
  Embedder e=mock(Embedder.class);
  when(e.embedderControls()).thenReturn(ec);
  EmbedderControls recommandedControls=JUnitReportingRunner.recommandedControls(e);
  assertThat(recommandedControls,is(ec));
  verify(ec).doIgnoreFailureInView(true);
  verify(ec).doIgnoreFailureInStories(true);
  verify(ec).useThreads(1);
}

Fixed version (ground truth):
@Test public void shouldPrepareEmbedder(){
  EmbedderControls ec=mock(EmbedderControls.class);
  when(ec.doIgnoreFailureInStories(Mockito.anyBoolean())).thenReturn(ec);
  when(ec.doIgnoreFailureInView(Mockito.anyBoolean())).thenReturn(ec);
  when(ec.useThreads(Mockito.anyInt())).thenReturn(ec);
  Embedder e=mock(Embedder.class);
  when(e.embedderControls()).thenReturn(ec);
  EmbedderControls recommandedControls=JUnitReportingRunner.recommendedControls(e);
  assertThat(recommandedControls,is(ec));
  verify(ec).doIgnoreFailureInView(true);
  verify(ec).doIgnoreFailureInStories(true);
  verify(ec).useThreads(1);
}
Program: 187256
Project: 187256
Buggy source:
public MathStories(){
  JUnitReportingRunner.recommandedControls(configuredEmbedder());
}

Fixed version (ground truth):
public MathStories(){
  JUnitReportingRunner.recommendedControls(configuredEmbedder());
}
Program: 187257
Project: 187257
Buggy source:
public StoriesWithAllSortsOfBeforeAndAfter(){
  System.setProperty(Logger.PROP_JJM_LOGLEVEL,"String_Node_Str");
  JUnitReportingRunner.recommandedControls(configuredEmbedder());
  CrossReference crossReference=new CrossReference("String_Node_Str").withJsonOnly().withOutputAfterEachStory(true).excludingStoriesWithNoExecutedScenarios(true);
  StepMonitor stepMonitor=new DelegatingStepMonitor(crossReference.getStepMonitor());
  configuration=new MostUsefulConfiguration().useStepMonitor(stepMonitor).usePendingStepStrategy(new FailingUponPendingStep()).useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats().withFailureTrace(true).withFormats(Format.XML,Format.HTML).withCrossReference(crossReference)).useParameterControls(new ParameterControls("String_Node_Str","String_Node_Str",true));
}

Fixed version (ground truth):
public StoriesWithAllSortsOfBeforeAndAfter(){
  System.setProperty(Logger.PROP_JJM_LOGLEVEL,"String_Node_Str");
  JUnitReportingRunner.recommendedControls(configuredEmbedder());
  CrossReference crossReference=new CrossReference("String_Node_Str").withJsonOnly().withOutputAfterEachStory(true).excludingStoriesWithNoExecutedScenarios(true);
  StepMonitor stepMonitor=new DelegatingStepMonitor(crossReference.getStepMonitor());
  configuration=new MostUsefulConfiguration().useStepMonitor(stepMonitor).usePendingStepStrategy(new FailingUponPendingStep()).useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats().withFailureTrace(true).withFormats(Format.XML,Format.HTML).withCrossReference(crossReference)).useParameterControls(new ParameterControls("String_Node_Str","String_Node_Str",true));
}
Program: 187258
Project: 187258
Buggy source:
public void beforeStory(Story story,boolean isGivenStory){
  logger.info("String_Node_Str",story.getName(),isGivenStory ? "String_Node_Str" : "String_Node_Str");
  if (isGivenStory) {
    notifier.fireTestStarted(currentStep);
    givenStoryContext=true;
  }
 else {
    if (testCounter == 0) {
      notifier.fireTestRunStarted(rootDescription);
    }
    for (    Description storyDescription : storyDescriptions) {
      if (storyDescription.isSuite() && storyDescription.getDisplayName().equals(story.getName())) {
        currentStoryDescription=storyDescription;
        notifier.fireTestStarted(storyDescription);
        scenarioDescriptions=storyDescription.getChildren().iterator();
        if (scenarioDescriptions.hasNext()) {
          currentScenario=scenarioDescriptions.next();
        }
        currentStep=currentStoryDescription;
      }
 else       if (storyDescription.isTest() && storyDescription.getMethodName() != null && storyDescription.getMethodName().equals(story.getName())) {
        currentStoryDescription=storyDescription;
        notifier.fireTestStarted(currentStoryDescription);
        currentStep=currentStoryDescription;
      }
    }
  }
}

Fixed version (ground truth):
public void beforeStory(Story story,boolean isGivenStory){
  logger.info("String_Node_Str",story.getName(),isGivenStory ? "String_Node_Str" : "String_Node_Str");
  if (isGivenStory) {
    notifier.fireTestStarted(currentStep);
    givenStoryContext=true;
  }
 else {
    anyScenarioFailedInCurrentStory=false;
    if (testCounter == 0) {
      notifier.fireTestRunStarted(rootDescription);
    }
    for (    Description storyDescription : storyDescriptions) {
      if (storyDescription.isSuite() && storyDescription.getDisplayName().equals(story.getName())) {
        currentStoryDescription=storyDescription;
        notifier.fireTestStarted(storyDescription);
        scenarioDescriptions=storyDescription.getChildren().iterator();
        if (scenarioDescriptions.hasNext()) {
          currentScenario=scenarioDescriptions.next();
        }
        currentStep=currentStoryDescription;
      }
 else       if (storyDescription.isTest() && storyDescription.getMethodName() != null && storyDescription.getMethodName().equals(story.getName())) {
        currentStoryDescription=storyDescription;
        notifier.fireTestStarted(currentStoryDescription);
        currentStep=currentStoryDescription;
      }
    }
  }
}
Program: 187259
Project: 187259
Buggy source:
public void afterScenario(){
  logger.info("String_Node_Str",currentScenario.getDisplayName());
  if (!givenStoryContext) {
    if (failedSteps.size() == 0) {
      notifier.fireTestFinished(currentScenario);
    }
 else {
      notifier.fireTestFailure(new Failure(currentScenario,new RuntimeException("String_Node_Str")));
    }
    if (scenarioDescriptions.hasNext()) {
      currentScenario=scenarioDescriptions.next();
      logger.debug("String_Node_Str",currentScenario.getDisplayName());
    }
  }
}

Fixed version (ground truth):
public void afterScenario(){
  logger.info("String_Node_Str",currentScenario.getDisplayName());
  if (!givenStoryContext) {
    if (failedSteps.size() == 0) {
      notifier.fireTestFinished(currentScenario);
    }
 else {
      notifier.fireTestFailure(new Failure(currentScenario,new RuntimeException("String_Node_Str")));
      anyScenarioFailedInCurrentStory=true;
      failedSteps.clear();
    }
    if (scenarioDescriptions.hasNext()) {
      currentScenario=scenarioDescriptions.next();
      logger.debug("String_Node_Str",currentScenario.getDisplayName());
    }
  }
}
Program: 187260
Project: 187260
Buggy source:
public void afterStory(boolean isGivenStory){
  logger.info("String_Node_Str",currentStoryDescription.getDisplayName(),isGivenStory ? "String_Node_Str" : "String_Node_Str");
  if (isGivenStory) {
    givenStoryContext=false;
    notifier.fireTestFinished(currentStep);
    prepareNextStep();
  }
 else {
    if (!failedSteps.contains(currentStoryDescription)) {
      if (failedSteps.size() == 0) {
        notifier.fireTestFinished(currentStoryDescription);
      }
 else {
        notifier.fireTestFailure(new Failure(currentStoryDescription,new RuntimeException("String_Node_Str")));
      }
      if (currentStoryDescription.isTest())       testCounter++;
    }
    if (testCounter == totalTests) {
      Result result=new Result();
      notifier.fireTestRunFinished(result);
    }
  }
}

Fixed version (ground truth):
public void afterStory(boolean isGivenStory){
  logger.info("String_Node_Str",currentStoryDescription.getDisplayName(),isGivenStory ? "String_Node_Str" : "String_Node_Str");
  if (isGivenStory) {
    givenStoryContext=false;
    notifier.fireTestFinished(currentStep);
    prepareNextStep();
  }
 else {
    if (!failedSteps.contains(currentStoryDescription)) {
      if (anyScenarioFailedInCurrentStory == false) {
        notifier.fireTestFinished(currentStoryDescription);
      }
 else {
        notifier.fireTestFailure(new Failure(currentStoryDescription,new RuntimeException("String_Node_Str")));
      }
      if (currentStoryDescription.isTest())       testCounter++;
    }
    if (testCounter == totalTests) {
      Result result=new Result();
      notifier.fireTestRunFinished(result);
    }
  }
}
Program: 187261
Project: 187261
Buggy source:
public void beforeStory(Story story,boolean isGivenStory){
  logger.info("String_Node_Str",story.getName(),isGivenStory ? "String_Node_Str" : "String_Node_Str");
  if (isGivenStory) {
    notifier.fireTestStarted(currentStep);
    givenStoryContext=true;
  }
 else {
    if (testCounter == 0) {
      notifier.fireTestRunStarted(rootDescription);
    }
    for (    Description storyDescription : storyDescriptions) {
      if (storyDescription.isSuite() && storyDescription.getDisplayName().equals(story.getName())) {
        currentStoryDescription=storyDescription;
        notifier.fireTestStarted(storyDescription);
        scenarioDescriptions=storyDescription.getChildren().iterator();
        if (scenarioDescriptions.hasNext()) {
          currentScenario=scenarioDescriptions.next();
        }
        currentStep=currentStoryDescription;
      }
 else       if (storyDescription.isTest() && storyDescription.getMethodName().equals(story.getName())) {
        currentStoryDescription=storyDescription;
        notifier.fireTestStarted(currentStoryDescription);
        currentStep=currentStoryDescription;
      }
    }
  }
}

Fixed version (ground truth):
public void beforeStory(Story story,boolean isGivenStory){
  logger.info("String_Node_Str",story.getName(),isGivenStory ? "String_Node_Str" : "String_Node_Str");
  if (isGivenStory) {
    notifier.fireTestStarted(currentStep);
    givenStoryContext=true;
  }
 else {
    if (testCounter == 0) {
      notifier.fireTestRunStarted(rootDescription);
    }
    for (    Description storyDescription : storyDescriptions) {
      if (storyDescription.isSuite() && storyDescription.getDisplayName().equals(story.getName())) {
        currentStoryDescription=storyDescription;
        notifier.fireTestStarted(storyDescription);
        scenarioDescriptions=storyDescription.getChildren().iterator();
        if (scenarioDescriptions.hasNext()) {
          currentScenario=scenarioDescriptions.next();
        }
        currentStep=currentStoryDescription;
      }
 else       if (storyDescription.isTest() && storyDescription.getMethodName() != null && storyDescription.getMethodName().equals(story.getName())) {
        currentStoryDescription=storyDescription;
        notifier.fireTestStarted(currentStoryDescription);
        currentStep=currentStoryDescription;
      }
    }
  }
}
Program: 187262
Project: 187262
Buggy source:
@Override protected List<String> storyPaths(){
  return Arrays.asList("String_Node_Str");
}

Fixed version (ground truth):
@Override protected List<String> storyPaths(){
  return Arrays.asList("String_Node_Str","String_Node_Str");
}
Program: 187263
Project: 187263
Buggy source:
public void failed(String step,Throwable e){
  if (e instanceof UUIDExceptionWrapper) {
    e=((UUIDExceptionWrapper)e).getCause();
  }
  logger.info("String_Node_Str",step,e.getMessage());
  if (!givenStoryContext) {
    notifier.fireTestFailure(new Failure(currentStep,e));
    prepareNextStep();
  }
}

Fixed version (ground truth):
public void failed(String step,Throwable e){
  if (e instanceof UUIDExceptionWrapper) {
    e=((UUIDExceptionWrapper)e).getCause();
  }
  logger.info("String_Node_Str",step,e.getMessage());
  if (!givenStoryContext) {
    notifier.fireTestFailure(new Failure(currentStep,e));
    failedSteps.add(currentStep);
    prepareNextStep();
  }
}
Program: 187264
Project: 187264
Buggy source:
public void afterStory(boolean isGivenStory){
  logger.info("String_Node_Str",currentStoryDescription.getDisplayName(),isGivenStory ? "String_Node_Str" : "String_Node_Str");
  if (isGivenStory) {
    givenStoryContext=false;
    notifier.fireTestFinished(currentStep);
    prepareNextStep();
  }
 else {
    notifier.fireTestFinished(currentStoryDescription);
    if (currentStoryDescription.isTest())     testCounter++;
    if (testCounter == totalTests) {
      Result result=new Result();
      notifier.fireTestRunFinished(result);
    }
  }
}

Fixed version (ground truth):
public void afterStory(boolean isGivenStory){
  logger.info("String_Node_Str",currentStoryDescription.getDisplayName(),isGivenStory ? "String_Node_Str" : "String_Node_Str");
  if (isGivenStory) {
    givenStoryContext=false;
    notifier.fireTestFinished(currentStep);
    prepareNextStep();
  }
 else {
    if (!failedSteps.contains(currentStoryDescription)) {
      notifier.fireTestFinished(currentStoryDescription);
      if (currentStoryDescription.isTest())       testCounter++;
    }
    if (testCounter == totalTests) {
      Result result=new Result();
      notifier.fireTestRunFinished(result);
    }
  }
}
Program: 187265
Project: 187265
Buggy source:
private void addScenarioSteps(Scenario scenario,Description description){
  for (  String stringStep : scenario.getSteps()) {
    testCases++;
    for (    StepCandidate step : allCandidates) {
      if (step.matches(stringStep)) {
        if (stringStep.indexOf('\n') != -1) {
          stringStep=stringStep.substring(0,stringStep.indexOf('\n'));
        }
        Description testDescription=Description.createTestDescription(step.getStepsInstance().getClass(),getJunitSafeString(stringStep));
        description.addChild(testDescription);
      }
    }
  }
}

Fixed version (ground truth):
private void addScenarioSteps(Scenario scenario,Description description){
  for (  String stringStep : scenario.getSteps()) {
    for (    StepCandidate step : allCandidates) {
      if (step.matches(stringStep)) {
        testCases++;
        if (stringStep.indexOf('\n') != -1) {
          stringStep=stringStep.substring(0,stringStep.indexOf('\n'));
        }
        Description testDescription=Description.createTestDescription(step.getStepsInstance().getClass(),getJunitSafeString(stringStep));
        description.addChild(testDescription);
      }
    }
  }
}
Program: 187266
Project: 187266
Buggy source:
public String getJunitSafeString(String string){
  return uniq.getUniqueDescription(string.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public String getJunitSafeString(String string){
  return uniq.getUniqueDescription(string.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str"));
}
Program: 187267
Project: 187267
Buggy source:
private void addPendingStep(Description description,String stringStep){
  testCases++;
  Description testDescription=Description.createSuiteDescription(getJunitSafeString(stringStep) + "String_Node_Str");
  description.addChild(testDescription);
}

Fixed version (ground truth):
private void addPendingStep(Description description,String stringStep){
  testCases++;
  Description testDescription=Description.createSuiteDescription(getJunitSafeString("String_Node_Str" + stringStep));
  description.addChild(testDescription);
}
Program: 187268
Project: 187268
Buggy source:
private void addSteps(Description description,List<String> steps){
  previousNonAndStep=null;
  for (  String stringStep : steps) {
    String stringStepOneLine=stripLinebreaks(stringStep);
    StepCandidate matchingStep=findMatchingStep(stringStep);
    if (matchingStep == null) {
      try {
        StepType stepType=configuration.keywords().stepTypeFor(stringStep);
        if (stepType == StepType.IGNORABLE) {
        }
 else {
          addPendingStep(description,stringStepOneLine);
        }
      }
 catch (      StartingWordNotFound e) {
      }
    }
 else {
      if (matchingStep.isComposite()) {
        addCompositeSteps(description,stringStepOneLine,matchingStep);
      }
 else {
        addRegularStep(description,stringStepOneLine,matchingStep);
      }
    }
  }
}

Fixed version (ground truth):
private void addSteps(Description description,List<String> steps){
  previousNonAndStep=null;
  for (  String stringStep : steps) {
    String stringStepOneLine=stripLinebreaks(stringStep);
    StepCandidate matchingStep=findMatchingStep(stringStep);
    if (matchingStep == null) {
      try {
        StepType stepType=configuration.keywords().stepTypeFor(stringStep);
        if (stepType == StepType.IGNORABLE) {
          stringStep=addIgnorableStep(description,stringStepOneLine);
        }
 else {
          addPendingStep(description,stringStepOneLine);
        }
      }
 catch (      StartingWordNotFound e) {
      }
    }
 else {
      if (matchingStep.isComposite()) {
        addCompositeSteps(description,stringStepOneLine,matchingStep);
      }
 else {
        addRegularStep(description,stringStepOneLine,matchingStep);
      }
    }
  }
}
Program: 187269
Project: 187269
Buggy source:
public void pending(String arg0){
  logger.info("String_Node_Str",arg0);
}

Fixed version (ground truth):
public void pending(String arg0){
  logger.info("String_Node_Str",arg0);
  if (!givenStoryContext) {
    notifier.fireTestIgnored(currentStep);
    prepareNextStep();
  }
}
Program: 187270
Project: 187270
Buggy source:
public void notPerformed(String arg0){
  logger.info("String_Node_Str",arg0);
}

Fixed version (ground truth):
public void notPerformed(String arg0){
  logger.info("String_Node_Str",arg0);
  if (!givenStoryContext) {
    notifier.fireTestIgnored(currentStep);
    prepareNextStep();
  }
}
Program: 187271
Project: 187271
Buggy source:
public void failed(String step,Throwable e){
  if (e instanceof UUIDExceptionWrapper) {
    e=((UUIDExceptionWrapper)e).getCause();
  }
  logger.info("String_Node_Str",step,e.getMessage());
  if (!givenStoryContext) {
    notifier.fireTestFailure(new Failure(currentStep,e));
    testCounter++;
  }
}

Fixed version (ground truth):
public void failed(String step,Throwable e){
  if (e instanceof UUIDExceptionWrapper) {
    e=((UUIDExceptionWrapper)e).getCause();
  }
  logger.info("String_Node_Str",step,e.getMessage());
  if (!givenStoryContext) {
    notifier.fireTestFailure(new Failure(currentStep,e));
    prepareNextStep();
  }
}
Program: 187272
Project: 187272
Buggy source:
public void ignorable(String arg0){
  logger.info("String_Node_Str",arg0);
}

Fixed version (ground truth):
public void ignorable(String arg0){
  logger.info("String_Node_Str",arg0);
  if (!givenStoryContext) {
    notifier.fireTestIgnored(currentStep);
    testCounter++;
    prepareNextStep();
  }
}
Program: 187273
Project: 187273
Buggy source:
@SuppressWarnings("String_Node_Str") public JUnitReportingRunner(Class<? extends JUnitStories> testClass) throws Throwable {
  junitStories=testClass.newInstance();
  configuredEmbedder=junitStories.configuredEmbedder();
  configuration=configuredEmbedder.configuration();
  Method method;
  try {
    method=testClass.getDeclaredMethod("String_Node_Str",(Class[])null);
  }
 catch (  NoSuchMethodException e) {
    method=testClass.getMethod("String_Node_Str",(Class[])null);
  }
  method.setAccessible(true);
  storyPaths=((List<String>)method.invoke(junitStories,(Object[])null));
  storyDescriptions=buildDescriptionFromStories();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public JUnitReportingRunner(Class<? extends ConfigurableEmbedder> testClass) throws Throwable {
  embedder=testClass.newInstance();
  if (embedder instanceof JUnitStories) {
    JUnitStories junitStories=(JUnitStories)embedder;
    configuredEmbedder=junitStories.configuredEmbedder();
    Method method;
    try {
      method=testClass.getDeclaredMethod("String_Node_Str",(Class[])null);
    }
 catch (    NoSuchMethodException e) {
      method=testClass.getMethod("String_Node_Str",(Class[])null);
    }
    method.setAccessible(true);
    storyPaths=((List<String>)method.invoke(junitStories,(Object[])null));
  }
 else   if (embedder instanceof JUnitStory) {
    JUnitStory junitStory=(JUnitStory)embedder;
    configuredEmbedder=junitStory.configuredEmbedder();
    StoryPathResolver resolver=configuredEmbedder.configuration().storyPathResolver();
    storyPaths=Arrays.asList(resolver.resolve(junitStory.getClass()));
  }
  configuration=configuredEmbedder.configuration();
  candidateSteps=embedder.stepsFactory().createCandidateSteps();
  storyDescriptions=buildDescriptionFromStories();
}
Program: 187274
Project: 187274
Buggy source:
@Override public void run(RunNotifier notifier){
  JUnitScenarioReporter reporter=new JUnitScenarioReporter(notifier,numberOfTestCases,rootDescription);
  StoryReporterBuilder reporterBuilder=new StoryReporterBuilder().withReporters(reporter);
  Configuration junitReportingConfiguration=junitStories.configuration().useStoryReporterBuilder(reporterBuilder);
  configuredEmbedder.useConfiguration(junitReportingConfiguration);
  try {
    configuredEmbedder.runStoriesAsPaths(storyPaths);
  }
 catch (  Throwable e) {
    throw new RuntimeException(e);
  }
 finally {
    configuredEmbedder.generateCrossReference();
  }
}

Fixed version (ground truth):
@Override public void run(RunNotifier notifier){
  JUnitScenarioReporter reporter=new JUnitScenarioReporter(notifier,numberOfTestCases,rootDescription);
  StoryReporterBuilder reporterBuilder=new StoryReporterBuilder().withReporters(reporter);
  Configuration junitReportingConfiguration=configuration.useStoryReporterBuilder(reporterBuilder);
  configuredEmbedder.useConfiguration(junitReportingConfiguration);
  try {
    configuredEmbedder.runStoriesAsPaths(storyPaths);
  }
 catch (  Throwable e) {
    throw new RuntimeException(e);
  }
 finally {
    configuredEmbedder.generateCrossReference();
  }
}
Program: 187275
Project: 187275
Buggy source:
private List<Description> buildDescriptionFromStories(){
  JUnitDescriptionGenerator gen=new JUnitDescriptionGenerator(junitStories.stepsFactory().createCandidateSteps());
  StoryRunner storyRunner=new StoryRunner();
  List<Description> storyDescriptions=new ArrayList<Description>();
  storyDescriptions.add(Description.createTestDescription(Object.class,"String_Node_Str"));
  numberOfTestCases++;
  for (  String storyPath : storyPaths) {
    Story parseStory=storyRunner.storyOfPath(configuration,storyPath);
    Description descr=gen.createDescriptionFrom(parseStory);
    storyDescriptions.add(descr);
  }
  storyDescriptions.add(Description.createTestDescription(Object.class,"String_Node_Str"));
  numberOfTestCases++;
  numberOfTestCases+=gen.getTestCases();
  return storyDescriptions;
}

Fixed version (ground truth):
private List<Description> buildDescriptionFromStories(){
  JUnitDescriptionGenerator gen=new JUnitDescriptionGenerator(candidateSteps);
  StoryRunner storyRunner=new StoryRunner();
  List<Description> storyDescriptions=new ArrayList<Description>();
  storyDescriptions.add(Description.createTestDescription(Object.class,"String_Node_Str"));
  numberOfTestCases++;
  for (  String storyPath : storyPaths) {
    Story parseStory=storyRunner.storyOfPath(configuration,storyPath);
    Description descr=gen.createDescriptionFrom(parseStory);
    storyDescriptions.add(descr);
  }
  storyDescriptions.add(Description.createTestDescription(Object.class,"String_Node_Str"));
  numberOfTestCases++;
  numberOfTestCases+=gen.getTestCases();
  return storyDescriptions;
}
Program: 187276
Project: 187276
Buggy source:
@Override public Description getDescription(){
  rootDescription=Description.createSuiteDescription(junitStories.getClass());
  rootDescription.getChildren().addAll(storyDescriptions);
  return rootDescription;
}

Fixed version (ground truth):
@Override public Description getDescription(){
  rootDescription=Description.createSuiteDescription(embedder.getClass());
  rootDescription.getChildren().addAll(storyDescriptions);
  return rootDescription;
}
Program: 187277
Project: 187277
Buggy source:
@Test public void storyDescriptionsForExample(){
  assertThat(getFirstStory().getDisplayName(),equalTo("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void storyDescriptionsForExample(){
  assertThat(getFirstStory().getDisplayName(),equalTo(expectedFirstStoryName));
}
Program: 187278
Project: 187278
Buggy source:
@Before public void setUp() throws Throwable {
  MockitoAnnotations.initMocks(this);
  runner=new JUnitReportingRunner(ExampleScenario.class);
  description=runner.getDescription();
}

Fixed version (ground truth):
@Before public void setUp() throws Throwable {
  MockitoAnnotations.initMocks(this);
  description=runner.getDescription();
}
Program: 187279
Project: 187279
Buggy source:
@Test public void topLevelDescriptionForExample(){
  assertThat(description.getDisplayName(),equalTo("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void topLevelDescriptionForExample(){
  assertThat(description.getDisplayName(),equalTo(expectedDisplayName));
}
Program: 187280
Project: 187280
Buggy source:
private void insertGivenStories(Scenario scenario,Description scenarioDescription){
  for (  String path : scenario.getGivenStories().getPaths()) {
    String name=path.substring(path.lastIndexOf("String_Node_Str") + 1,path.length());
    scenarioDescription.addChild(Description.createSuiteDescription(name));
    testCases++;
  }
}

Fixed version (ground truth):
private void insertGivenStories(Scenario scenario,Description scenarioDescription){
  for (  String path : scenario.getGivenStories().getPaths()) {
    String name=path.substring(path.lastIndexOf("String_Node_Str") + 1,path.length());
    scenarioDescription.addChild(Description.createSuiteDescription(getJunitSafeString(name)));
    testCases++;
  }
}
Program: 187281
Project: 187281
Buggy source:
@Override protected List<String> storyPaths(){
  return Arrays.asList("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Override protected List<String> storyPaths(){
  return Arrays.asList("String_Node_Str");
}
Program: 187282
Project: 187282
Buggy source:
/** 
 * @return true if given graph is Eulerian
 */
public static boolean isEulerian(GraphModel graph){
  int cc=graph.getVerticesCount();
  if (cc == 0)   return false;
  if (cc < 2)   return true;
  if (!AlgorithmUtils.isConnected(graph))   return false;
  ArrayList<Integer> degrees=AlgorithmUtils.getDegreesList(graph);
  for (  int d : degrees) {
    if (d % 2 != 0)     return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @return true if given graph is Eulerian
 */
public static boolean isEulerian(GraphModel graph){
  int cc=graph.getVerticesCount();
  if (cc == 0)   return false;
  if (cc < 2)   return true;
  System.out.println("String_Node_Str" + AlgorithmUtils.isConnected(graph));
  if (!AlgorithmUtils.isConnected(graph))   return false;
  ArrayList<Integer> degrees=AlgorithmUtils.getDegreesList(graph);
  for (  int d : degrees) {
    if (d % 2 != 0)     return false;
  }
  return true;
}
Program: 187283
Project: 187283
Buggy source:
/** 
 * determines wether g is connected or not
 */
public static <VertexType extends BaseVertex,EdgeType extends BaseEdge<VertexType>>boolean isConnected(BaseGraph<VertexType,EdgeType> g){
  ArrayList vs=new ArrayList();
  int[] parent=new int[g.getVerticesCount()];
  parent[0]=-1;
  parent[1]=-1;
  parent[2]=-1;
  dfs(g,0,vs,parent);
  return Arrays.stream(vs.toArray()).distinct().toArray().length == g.getVerticesCount();
}

Fixed version (ground truth):
/** 
 * determines wether g is connected or not
 */
public static <VertexType extends BaseVertex,EdgeType extends BaseEdge<VertexType>>boolean isConnected(BaseGraph<VertexType,EdgeType> g){
  ArrayList vs=new ArrayList();
  int[] parent=new int[g.getVerticesCount()];
  for (int i=0; i < g.getVerticesCount(); i++)   parent[i]=-1;
  dfs(g,0,vs,parent);
  return Arrays.stream(vs.toArray()).distinct().toArray().length == g.getVerticesCount();
}
Program: 187285
Project: 187285
Buggy source:
public About(UI ui){
  panel=new JPanel(new FlowLayout());
  panel.setBorder(BorderFactory.createEmptyBorder(8,8,8,8));
  frame=new JFrame();
  frame.setVisible(true);
  frame.setSize(500,300);
  frame.setLocationRelativeTo(ui);
  text=new JLabel();
}

Fixed version (ground truth):
public About(UI ui){
  panel=new JPanel(new FlowLayout());
  panel.setBorder(BorderFactory.createEmptyBorder(8,8,8,8));
  frame=new JFrame();
  frame.addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent e){
      frame.dispose();
    }
  }
);
  frame.setVisible(true);
  frame.setSize(500,300);
  frame.setLocationRelativeTo(ui);
  text=new JLabel();
}
Program: 187286
Project: 187286
Buggy source:
public Find(JTextArea text){
  this.txt=text;
  lab1=new JLabel("String_Node_Str");
  lab2=new JLabel("String_Node_Str");
  textF=new JTextField(30);
  textR=new JTextField(30);
  findBtn=new JButton("String_Node_Str");
  findNext=new JButton("String_Node_Str");
  replace=new JButton("String_Node_Str");
  replaceAll=new JButton("String_Node_Str");
  cancel=new JButton("String_Node_Str");
  setLayout(null);
  int labWidth=80;
  int labHeight=20;
  lab1.setBounds(10,10,labWidth,labHeight);
  add(lab1);
  textF.setBounds(10 + labWidth,10,120,20);
  add(textF);
  lab2.setBounds(10,10 + labHeight + 10,labWidth,labHeight);
  add(lab2);
  textR.setBounds(10 + labWidth,10 + labHeight + 10,120,20);
  add(textR);
  findBtn.setBounds(225,6,115,20);
  add(findBtn);
  findBtn.addActionListener(this);
  findNext.setBounds(225,28,115,20);
  add(findNext);
  findNext.addActionListener(this);
  replace.setBounds(225,50,115,20);
  add(replace);
  replace.addActionListener(this);
  replaceAll.setBounds(225,72,115,20);
  add(replaceAll);
  replaceAll.addActionListener(this);
  cancel.setBounds(225,94,115,20);
  add(cancel);
  cancel.addActionListener(this);
  int width=360;
  int height=160;
  setSize(width,height);
  Point center=GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint();
  setLocation(center.x - width / 2,center.y - height / 2);
  setVisible(true);
  setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
}

Fixed version (ground truth):
public Find(JTextArea text){
  this.txt=text;
  lab1=new JLabel("String_Node_Str");
  lab2=new JLabel("String_Node_Str");
  textF=new JTextField(30);
  textR=new JTextField(30);
  findBtn=new JButton("String_Node_Str");
  findNext=new JButton("String_Node_Str");
  replace=new JButton("String_Node_Str");
  replaceAll=new JButton("String_Node_Str");
  cancel=new JButton("String_Node_Str");
  setLayout(null);
  int labWidth=80;
  int labHeight=20;
  lab1.setBounds(10,10,labWidth,labHeight);
  add(lab1);
  textF.setBounds(10 + labWidth,10,120,20);
  add(textF);
  lab2.setBounds(10,10 + labHeight + 10,labWidth,labHeight);
  add(lab2);
  textR.setBounds(10 + labWidth,10 + labHeight + 10,120,20);
  add(textR);
  findBtn.setBounds(225,6,115,20);
  add(findBtn);
  findBtn.addActionListener(this);
  findNext.setBounds(225,28,115,20);
  add(findNext);
  findNext.addActionListener(this);
  replace.setBounds(225,50,115,20);
  add(replace);
  replace.addActionListener(this);
  replaceAll.setBounds(225,72,115,20);
  add(replaceAll);
  replaceAll.addActionListener(this);
  cancel.setBounds(225,94,115,20);
  add(cancel);
  cancel.addActionListener(this);
  int width=360;
  int height=160;
  setSize(width,height);
  setLocationRelativeTo(txt);
  setVisible(true);
  setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
Program: 187287
Project: 187287
Buggy source:
public void find(){
  int select_start=txt.getText().toLowerCase().indexOf(textF.getText().toLowerCase());
  if (select_start == -1) {
    startIndex=0;
    JOptionPane.showMessageDialog(null,"String_Node_Str" + textF.getText() + "String_Node_Str");
    return;
  }
  if (select_start == txt.getText().toLowerCase().lastIndexOf(textF.getText().toLowerCase())) {
    startIndex=0;
  }
  int select_end=select_start + textF.getText().length();
  txt.select(select_start,select_end);
}

Fixed version (ground truth):
public void find(){
  select_start=txt.getText().toLowerCase().indexOf(textF.getText().toLowerCase());
  if (select_start == -1) {
    startIndex=0;
    JOptionPane.showMessageDialog(null,"String_Node_Str" + textF.getText() + "String_Node_Str");
    return;
  }
  if (select_start == txt.getText().toLowerCase().lastIndexOf(textF.getText().toLowerCase())) {
    startIndex=0;
  }
  int select_end=select_start + textF.getText().length();
  txt.select(select_start,select_end);
}
Program: 187288
Project: 187288
Buggy source:
public void replace(){
  try {
    find();
    txt.replaceSelection(textR.getText());
  }
 catch (  NullPointerException e) {
    System.out.print("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
public void replace(){
  try {
    find();
    if (select_start != -1)     txt.replaceSelection(textR.getText());
  }
 catch (  NullPointerException e) {
    System.out.print("String_Node_Str" + e);
  }
}
Program: 187289
Project: 187289
Buggy source:
/** 
 * Extracts the various runtime classes to the directory specified as the first argument. This allows the generated library to be more portable, and mimics the behavior in versions <= 0.3
 */
public static void main(String[] args){
  if (args.length != 1) {
    throw new RuntimeException("String_Node_Str");
  }
  writeRequiredSources(args[0]);
}

Fixed version (ground truth):
/** 
 * Extracts the various runtime classes to the directory specified as the first argument. This allows the generated library to be more portable, and mimics the behavior in versions &lt;= 0.3
 */
public static void main(String[] args){
  if (args.length != 1) {
    throw new RuntimeException("String_Node_Str");
  }
  writeRequiredSources(args[0]);
}
Program: 187291
Project: 187291
Buggy source:
private Set<MethodOutline> computeNextMethods(Set<MethodOutline> allMethods,Set<MethodOutline> triggeredMethods,MethodOutline method){
  if (method.isTerminal()) {
    return new TreeSet<MethodOutline>();
  }
  Set<MethodOutline> nextMethods=new TreeSet<MethodOutline>(allMethods);
  nextMethods.remove(method);
  final MethodOutline next;
  if (method.getMaxOccurrences() == 1) {
    next=null;
  }
 else   if (method.getMaxOccurrences() < 1) {
    MethodOutline copy=method.copy();
    nextMethods.add(copy);
    next=copy;
  }
 else {
    MethodOutline m=method.copy();
    m.setMaxOccurrences(m.getMaxOccurrences() - 1);
    nextMethods.add(m);
    next=m;
  }
  Integer currentGroup=method.getGroup();
  if (currentGroup != null) {
    for (    MethodOutline otherMethod : new TreeSet<MethodOutline>(nextMethods)) {
      if (otherMethod == next) {
        continue;
      }
      if (currentGroup.equals(otherMethod.getGroup())) {
        nextMethods.remove(otherMethod);
      }
    }
    for (    MethodOutline triggeredMethod : triggeredMethods) {
      if (currentGroup.equals(triggeredMethod.getTrigger())) {
        if (next != null) {
          next.setTriggered();
        }
        if (!method.didTrigger()) {
          nextMethods.add(triggeredMethod.copy());
        }
      }
    }
  }
  return nextMethods;
}

Fixed version (ground truth):
private Set<MethodOutline> computeNextMethods(Set<MethodOutline> allMethods,Set<MethodOutline> triggeredMethods,MethodOutline method){
  if (method.isTerminal()) {
    return new TreeSet<MethodOutline>();
  }
  Set<MethodOutline> nextMethods=new TreeSet<MethodOutline>(allMethods);
  nextMethods.remove(method);
  final MethodOutline next;
  if (method.getMaxOccurrences() == 1) {
    next=null;
  }
 else   if (method.getMaxOccurrences() < 1) {
    MethodOutline copy=method.copy();
    nextMethods.add(copy);
    next=copy;
  }
 else {
    MethodOutline m=method.copy();
    m.setMaxOccurrences(m.getMaxOccurrences() - 1);
    nextMethods.add(m);
    next=m;
  }
  Integer currentGroup=method.getGroup();
  if (currentGroup != null) {
    for (    MethodOutline otherMethod : new TreeSet<MethodOutline>(nextMethods)) {
      if (otherMethod == next) {
        continue;
      }
      if (currentGroup.equals(otherMethod.getGroup())) {
        nextMethods.remove(otherMethod);
      }
    }
    for (    MethodOutline triggeredMethod : triggeredMethods) {
      if (currentGroup.equals(triggeredMethod.getTrigger())) {
        if (next != null) {
          next.setTriggered();
        }
        if (!method.didTrigger()) {
          nextMethods.add(triggeredMethod.copy());
        }
      }
    }
  }
  if (nextMethods.size() == 1) {
    MethodOutline nextMethod=nextMethods.iterator().next();
    if (!nextMethod.isTerminal() && !nextMethod.isRequired()) {
      MethodOutline copy=nextMethod.copy();
      copy.isImplicit(true);
      copy.isTerminal(true);
      nextMethods=new TreeSet<MethodOutline>();
      nextMethods.add(copy);
    }
  }
  return nextMethods;
}
Program: 187292
Project: 187292
Buggy source:
private StateClass getStateFromBlockAndMethods(BlockOutline block,Set<MethodOutline> allMethods){
  TreeSet<String> names=new TreeSet<String>();
  for (  MethodOutline method : allMethods) {
    names.add(method.keyString() + "String_Node_Str" + method.getMaxOccurrences());
  }
  StringBuilder sb=new StringBuilder();
  sb.append(block.getName());
  for (  String name : names) {
    sb.append(name);
  }
  String key=sb.toString();
  if (states.containsKey(key)) {
    return states.get(key);
  }
  StateClass state=new StateClass(block.getHelperClass());
  state.setName(block.getName());
  states.put(key,state);
  return state;
}

Fixed version (ground truth):
private StateClass getStateFromBlockAndMethods(BlockOutline block,Set<MethodOutline> allMethods){
  StringBuilder sb=new StringBuilder();
  sb.append(block.getName());
  TreeSet<String> names=new TreeSet<String>();
  for (  MethodOutline method : allMethods) {
    names.add(method.keyString() + "String_Node_Str" + method.getMaxOccurrences());
  }
  for (  String name : names) {
    sb.append(name);
  }
  String key=sb.toString();
  if (states.containsKey(key)) {
    return states.get(key);
  }
  StateClass state=new StateClass(block.getHelperClass());
  state.setName(block.getName());
  states.put(key,state);
  return state;
}
Program: 187293
Project: 187293
Buggy source:
private Set<MethodOutline> addTransition(StateClass state,BlockOutline block,Set<MethodOutline> combination,Set<MethodOutline> triggered,MethodOutline method){
  Transition transition;
  Set<MethodOutline> nextMethods=computeNextMethods(combination,triggered,method);
  StateClass next=getStateFromBlockAndMethods(block,nextMethods);
  boolean implicitTerminalWorthy=nextMethods.isEmpty();
  if (method.isTerminal() || implicitTerminalWorthy) {
    if (method.getReturnType() != null) {
      TerminalTransition terminal=new TerminalTransition();
      terminal.setReturnType(method.getReturnType());
      transition=terminal;
    }
 else     if (block.getReturnType() != null) {
      TerminalTransition terminal=new TerminalTransition();
      terminal.setReturnType(block.getReturnType());
      transition=terminal;
    }
 else {
      transition=new AscendingTransition(!method.isRequired());
    }
  }
 else   if (state == next) {
    transition=new RecursiveTransition();
  }
 else {
    LateralTransition lateral=new LateralTransition();
    lateral.setSibling(next);
    transition=lateral;
  }
  transition.setMethodInfo(((MethodInfo)method).copy());
  state.addTransitions(transition);
  for (  BlockOutline chain : method.getBlockChain()) {
    StateClass chainClass=convertBlock(chain);
    transition.getStateChain().add(chainClass);
  }
  return nextMethods;
}

Fixed version (ground truth):
private Set<MethodOutline> addTransition(StateClass state,BlockOutline block,Set<MethodOutline> combination,Set<MethodOutline> triggered,MethodOutline method){
  final Set<MethodOutline> nextMethods=computeNextMethods(combination,triggered,method);
  final StateClass next=getStateFromBlockAndMethods(block,nextMethods);
  final Transition transition;
  if (method.isTerminal()) {
    if (method.getReturnType() != null) {
      TerminalTransition terminal=new TerminalTransition();
      terminal.setReturnType(method.getReturnType());
      transition=terminal;
    }
 else     if (block.getReturnType() != null) {
      TerminalTransition terminal=new TerminalTransition();
      terminal.setReturnType(block.getReturnType());
      transition=terminal;
    }
 else {
      transition=new AscendingTransition(!method.isRequired());
    }
  }
 else   if (state == next) {
    transition=new RecursiveTransition();
  }
 else {
    LateralTransition lateral=new LateralTransition();
    lateral.setSibling(next);
    transition=lateral;
  }
  transition.setMethodInfo(((MethodInfo)method).copy());
  state.addTransitions(transition);
  for (  BlockOutline chain : method.getBlockChain()) {
    StateClass chainClass=convertBlock(chain);
    transition.getStateChain().add(chainClass);
  }
  return nextMethods;
}
Program: 187294
Project: 187294
Buggy source:
public @Override void visit(TerminalTransition transition){
  String clazz=transition.getReturnType() == null ? Void.class.getName() : transition.getReturnType();
  if (!clazz.equals(Void.class.getName())) {
    helperReturnType.set(ctx.model.ref(clazz));
  }
}

Fixed version (ground truth):
public @Override void visit(TerminalTransition transition){
  String clazz=transition.getReturnType() == null || transition.info().isImplicit() ? Void.class.getName() : transition.getReturnType();
  if (!clazz.equals(Void.class.getName())) {
    helperReturnType.set(ctx.model.ref(clazz));
  }
}
Program: 187295
Project: 187295
Buggy source:
private void addHelperCall(Transition transition){
  if (ctx.helperMethods.seen(transition)) {
    return;
  }
  final AtomicReference<JType> helperReturnType=new AtomicReference<JType>();
  transition.accept(new TransitionVisitor.$(){
    public @Override void visit(    TerminalTransition transition){
      String clazz=transition.getReturnType() == null ? Void.class.getName() : transition.getReturnType();
      if (!clazz.equals(Void.class.getName())) {
        helperReturnType.set(ctx.model.ref(clazz));
      }
    }
  }
);
  JType helperReturnType1=helperReturnType.get();
  JDefinedClass iHelper=HELPER_INTERFACE_STRATEGY.createStrongType(ctx,transition.getOwner());
  JType methodCallType=helperReturnType1 == null ? ctx.model.VOID : helperReturnType1;
  JMethod _method=addHelperMethod(iHelper,methodCallType,JMod.NONE,transition);
  for (int i=0; i < transition.getStateChain().size(); ++i) {
    JClass type=HELPER_INTERFACE_STRATEGY.createWeakType(ctx,transition.getStateChain().get(i));
    _method.param(ref(AtomicReference.class).narrow(type),Constants.HELPER_VALUE_NAME + (i + 1));
  }
}

Fixed version (ground truth):
private void addHelperCall(Transition transition){
  if (ctx.helperMethods.seen(transition)) {
    return;
  }
  final AtomicReference<JType> helperReturnType=new AtomicReference<JType>();
  transition.accept(new TransitionVisitor.$(){
    public @Override void visit(    TerminalTransition transition){
      String clazz=transition.getReturnType() == null || transition.info().isImplicit() ? Void.class.getName() : transition.getReturnType();
      if (!clazz.equals(Void.class.getName())) {
        helperReturnType.set(ctx.model.ref(clazz));
      }
    }
  }
);
  JType helperReturnType1=helperReturnType.get();
  JDefinedClass iHelper=HELPER_INTERFACE_STRATEGY.createStrongType(ctx,transition.getOwner());
  JType methodCallType=helperReturnType1 == null ? ctx.model.VOID : helperReturnType1;
  JMethod _method=addHelperMethod(iHelper,methodCallType,JMod.NONE,transition);
  for (int i=0; i < transition.getStateChain().size(); ++i) {
    JClass type=HELPER_INTERFACE_STRATEGY.createWeakType(ctx,transition.getStateChain().get(i));
    _method.param(ref(AtomicReference.class).narrow(type),Constants.HELPER_VALUE_NAME + (i + 1));
  }
}
Program: 187296
Project: 187296
Buggy source:
public String keyString(){
  StringBuilder sb=new StringBuilder();
  MethodParser parser=new MethodParser(methodSignature);
  sb.append(parser.methodName).append("String_Node_Str");
  boolean first=true;
  for (  Pair<MethodParser.JavaType,String> param : parser.params) {
    if (!first) {
      sb.append("String_Node_Str");
    }
 else {
      first=false;
    }
    sb.append(param.first.typeName).append("String_Node_Str").append(param.second);
  }
  sb.append("String_Node_Str").append(didTrigger ? "String_Node_Str" : "String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public String keyString(){
  StringBuilder sb=new StringBuilder();
  MethodParser parser=new MethodParser(methodSignature);
  sb.append(parser.methodName).append("String_Node_Str");
  boolean first=true;
  for (  Pair<MethodParser.JavaType,String> param : parser.params) {
    if (!first) {
      sb.append("String_Node_Str");
    }
 else {
      first=false;
    }
    sb.append(param.first.typeName).append("String_Node_Str").append(param.second);
  }
  if (didTrigger) {
    sb.append("String_Node_Str");
  }
  if (isImplicit) {
    sb.append("String_Node_Str");
  }
  return sb.toString();
}
Program: 187297
Project: 187297
Buggy source:
protected void copy(MethodInfo other){
  other.minOccurrences=minOccurrences;
  other.maxOccurrences=maxOccurrences;
  other.methodSignature=methodSignature;
  other.documentation=documentation;
  other.isDeprecated=isDeprecated;
  other.deprecationReason=deprecationReason;
  other.didTrigger=didTrigger;
  other.annotations.putAll(annotations);
}

Fixed version (ground truth):
protected void copy(MethodInfo other){
  other.minOccurrences=minOccurrences;
  other.maxOccurrences=maxOccurrences;
  other.methodSignature=methodSignature;
  other.documentation=documentation;
  other.isDeprecated=isDeprecated;
  other.deprecationReason=deprecationReason;
  other.didTrigger=didTrigger;
  other.isImplicit=isImplicit;
  other.annotations.putAll(annotations);
}