nus-yam/ex-repair huggingface dataset:
Program: 29817
Project: 29817
Buggy source:
private static List<TestScenario> setupTestScenarios(){
  List<TestScenario> result=Lists.newArrayList();
  addTestScenario(result,"String_Node_Str").numberOfSteps(2).failingStep(1);
  addTestScenario(result,"String_Node_Str").numberOfSteps(3).failingStep(1);
  addTestScenario(result,"String_Node_Str").numberOfSteps(2).failingStep(2);
  addTestScenario(result,"String_Node_Str").numberOfSteps(2).numberOfFailingStages(2).failingStep(1);
  addTestScenario(result,"String_Node_Str").numberOfSteps(2).numberOfFailingStages(2).stageWithFailingAfterStageMethod(2).failingStep(1);
  addTestScenario(result,"String_Node_Str").notImplementedYet().numberOfSteps(2).failingStep(1);
  addTestScenario(result,"String_Node_Str").notImplementedYet();
  addTestScenario(result,"String_Node_Str").notImplementedYet().failIfPassed();
  addTestScenario(result,"String_Node_Str").notImplementedYet().failIfPassed().failingStep(1);
  addTestScenario(result,"String_Node_Str").notImplementedYet().executeSteps().failingStep(1);
  addTestScenario(result,"String_Node_Str").tagAnnotation();
  return result;
}

Fixed version (ground truth):
private static List<TestScenario> setupTestScenarios(){
  List<TestScenario> result=Lists.newArrayList();
  addTestScenario(result,"String_Node_Str").numberOfSteps(2).failingStep(1);
  addTestScenario(result,"String_Node_Str").numberOfSteps(3).failingStep(1);
  addTestScenario(result,"String_Node_Str").numberOfSteps(2).failingStep(2);
  addTestScenario(result,"String_Node_Str").numberOfSteps(2).numberOfFailingStages(2).failingStep(1);
  addTestScenario(result,"String_Node_Str").numberOfSteps(2).numberOfFailingStages(2).stageWithFailingAfterStageMethod(2).failingStep(1);
  addTestScenario(result,"String_Node_Str").notImplementedYet().numberOfSteps(2).failingStep(1);
  addTestScenario(result,"String_Node_Str").notImplementedYet();
  addTestScenario(result,"String_Node_Str").notImplementedYet().failIfPassed();
  addTestScenario(result,"String_Node_Str").notImplementedYet().failIfPassed().failingStep(1);
  addTestScenario(result,"String_Node_Str").notImplementedYet().executeSteps().failingStep(1);
  addTestScenario(result,"String_Node_Str").tagAnnotation();
  addTestScenario(result,TestClassWithParameterizedRunner.class).parameterizedRunner().numberOfParameters(2);
  addTestScenario(result,TestClassWithDescription.class,"String_Node_Str").testClassDescription(TestClassWithDescription.class.getAnnotation(Description.class).value());
  return result;
}
Program: 29818
Project: 29818
Buggy source:
@AfterStage public void findScenario(){
  testScenario=TestScenarioRepository.findScenario(criteria);
}

Fixed version (ground truth):
@AfterStage public void findScenario(){
  if (testScenario == null) {
    testScenario=TestScenarioRepository.findScenario(criteria);
  }
}
Program: 29819
Project: 29819
Buggy source:
private void executeAfterStageMethods(Object stage) throws Throwable {
  StageState stageState=getStageState(stage);
  if (stageState.afterStageCalled)   return;
  stageState.afterStageCalled=true;
  executeAnnotatedMethods(stage,AfterStage.class);
}

Fixed version (ground truth):
private void executeAfterStageMethods(Object stage) throws Throwable {
  StageState stageState=getStageState(stage);
  if (stageState.afterStageCalled) {
    return;
  }
  stageState.afterStageCalled=true;
  executeAnnotatedMethods(stage,AfterStage.class);
}
Program: 29820
Project: 29820
Buggy source:
@Override public void handleThrowable(Throwable t) throws Throwable {
  failed(t);
}

Fixed version (ground truth):
@Override public void handleThrowable(Throwable t) throws Throwable {
  listener.stepMethodFailed(t);
  failed(t);
}
Program: 29822
Project: 29822
Buggy source:
@SuppressWarnings("String_Node_Str") public <T>T addStage(Class<T> stepsClass){
  if (stages.containsKey(stepsClass))   return (T)stages.get(stepsClass).instance;
  T result=setupCglibProxy(stepsClass);
  stages.put(stepsClass,new StageState(result));
  gatherRules(result);
  injectSteps(result);
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T>T addStage(Class<T> stepsClass){
  if (stages.containsKey(stepsClass)) {
    return (T)stages.get(stepsClass).instance;
  }
  T result=setupCglibProxy(stepsClass);
  stages.put(stepsClass,new StageState(result));
  gatherRules(result);
  injectSteps(result);
  return result;
}
Program: 29823
Project: 29823
Buggy source:
@Override public void handleMethod(Object stageInstance,Method paramMethod,Object[] arguments,InvocationMode mode) throws Throwable {
  if (paramMethod.isSynthetic())   return;
  if (paramMethod.isAnnotationPresent(AfterStage.class) || paramMethod.isAnnotationPresent(BeforeStage.class) || paramMethod.isAnnotationPresent(BeforeScenario.class)|| paramMethod.isAnnotationPresent(AfterScenario.class)|| paramMethod.isAnnotationPresent(Hidden.class))   return;
  update(stageInstance);
  if (paramMethod.isAnnotationPresent(IntroWord.class)) {
    listener.introWordAdded(paramMethod.getName());
  }
 else {
    listener.stepMethodInvoked(paramMethod,Arrays.asList(arguments),mode);
  }
}

Fixed version (ground truth):
@Override public void handleMethod(Object stageInstance,Method paramMethod,Object[] arguments,InvocationMode mode) throws Throwable {
  if (paramMethod.isSynthetic()) {
    return;
  }
  if (paramMethod.isAnnotationPresent(AfterStage.class) || paramMethod.isAnnotationPresent(BeforeStage.class) || paramMethod.isAnnotationPresent(BeforeScenario.class)|| paramMethod.isAnnotationPresent(AfterScenario.class)|| paramMethod.isAnnotationPresent(Hidden.class)) {
    return;
  }
  update(stageInstance);
  if (paramMethod.isAnnotationPresent(IntroWord.class)) {
    listener.introWordAdded(paramMethod.getName());
  }
 else {
    listener.stepMethodInvoked(paramMethod,Arrays.asList(arguments),mode);
  }
}
Program: 29824
Project: 29824
Buggy source:
private void ensureBeforeStepsAreExecuted() throws Throwable {
  if (state != State.INIT)   return;
  state=State.STARTED;
  methodInterceptor.enableMethodHandling(false);
  try {
    for (    Object rule : scenarioRules) {
      invokeRuleMethod(rule,"String_Node_Str");
    }
    beforeStepsWereExecuted=true;
    for (    StageState stage : stages.values()) {
      executeBeforeScenarioSteps(stage.instance);
    }
  }
 catch (  Throwable e) {
    failed(e);
    finished();
    throw e;
  }
  methodInterceptor.enableMethodHandling(true);
}

Fixed version (ground truth):
private void ensureBeforeStepsAreExecuted() throws Throwable {
  if (state != State.INIT) {
    return;
  }
  state=State.STARTED;
  methodInterceptor.enableMethodHandling(false);
  try {
    for (    Object rule : scenarioRules) {
      invokeRuleMethod(rule,"String_Node_Str");
    }
    beforeStepsWereExecuted=true;
    for (    StageState stage : stages.values()) {
      executeBeforeScenarioSteps(stage.instance);
    }
  }
 catch (  Throwable e) {
    failed(e);
    finished();
    throw e;
  }
  methodInterceptor.enableMethodHandling(true);
}
Program: 29825
Project: 29825
Buggy source:
private void printArg(Word word){
  String value=word.getArgumentInfo().isCaseArg() ? formatCaseArgument(word) : word.value;
  value=escapeToHtml(value);
  String multiLine=value.contains("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
  String caseClass=word.getArgumentInfo().isCaseArg() ? "String_Node_Str" : "String_Node_Str";
  writer.print(format("String_Node_Str",caseClass,multiLine,value));
}

Fixed version (ground truth):
private void printArg(Word word){
  String value=word.getArgumentInfo().isCaseArg() ? formatCaseArgument(word) : HtmlEscapers.htmlEscaper().escape(word.value);
  value=escapeToHtml(value);
  String multiLine=value.contains("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
  String caseClass=word.getArgumentInfo().isCaseArg() ? "String_Node_Str" : "String_Node_Str";
  writer.print(format("String_Node_Str",caseClass,multiLine,value));
}
Program: 29826
Project: 29826
Buggy source:
String formatCaseArgument(Word word){
  return word.value;
}

Fixed version (ground truth):
String formatCaseArgument(Word word){
  return HtmlEscapers.htmlEscaper().escape(word.value);
}
Program: 29827
Project: 29827
Buggy source:
@Override public void visit(StepModel stepModel){
  writer.print("String_Node_Str");
  boolean firstWord=true;
  for (  Word word : stepModel.words) {
    if (!firstWord) {
      writer.print(' ');
    }
    String text=word.value;
    if (firstWord && word.isIntroWord) {
      writer.print(format("String_Node_Str",WordUtil.capitalize(text)));
    }
 else     if (word.isArg()) {
      printArg(word);
    }
 else {
      writer.print(text);
    }
    firstWord=false;
  }
  StepStatus status=stepModel.getStatus();
  if (status != StepStatus.PASSED) {
    String lowerCase=status.toString().toLowerCase();
    writer.print(format("String_Node_Str",WordUtil.camelCase(lowerCase),lowerCase.replace('_',' ')));
  }
  writer.println("String_Node_Str");
}

Fixed version (ground truth):
@Override public void visit(StepModel stepModel){
  writer.print("String_Node_Str");
  boolean firstWord=true;
  for (  Word word : stepModel.words) {
    if (!firstWord) {
      writer.print(' ');
    }
    String text=HtmlEscapers.htmlEscaper().escape(word.value);
    if (firstWord && word.isIntroWord) {
      writer.print(format("String_Node_Str",WordUtil.capitalize(text)));
    }
 else     if (word.isArg()) {
      printArg(word);
    }
 else {
      writer.print(text);
    }
    firstWord=false;
  }
  StepStatus status=stepModel.getStatus();
  if (status != StepStatus.PASSED) {
    String lowerCase=status.toString().toLowerCase();
    writer.print(format("String_Node_Str",WordUtil.camelCase(lowerCase),lowerCase.replace('_',' ')));
  }
  writer.println("String_Node_Str");
}
Program: 29828
Project: 29828
Buggy source:
@Override public void scenarioFailed(Throwable e){
  if (!currentScenarioCase.steps.isEmpty()) {
    currentScenarioCase.steps.get(currentScenarioCase.steps.size() - 1).setStatus(StepStatus.FAILED);
  }
  setSuccess(false);
  setErrorMessage(e.getMessage());
}

Fixed version (ground truth):
@Override public void scenarioFailed(Throwable e){
  setSuccess(false);
  setErrorMessage(e.getMessage());
}
Program: 29829
Project: 29829
Buggy source:
public boolean isStepMethod(Method paramMethod){
  if (!Modifier.isPublic(paramMethod.getModifiers()))   return false;
  return true;
}

Fixed version (ground truth):
public boolean isStepMethod(Method paramMethod){
  if (!Modifier.isPublic(paramMethod.getModifiers())) {
    return false;
  }
  return true;
}
Program: 29830
Project: 29830
Buggy source:
@Override public void stepMethodInvoked(Method paramMethod,List<Object> arguments,InvocationMode mode){
  if (!isStepMethod(paramMethod))   return;
  addStepMethod(paramMethod,arguments,mode);
}

Fixed version (ground truth):
@Override public void stepMethodInvoked(Method paramMethod,List<Object> arguments,InvocationMode mode){
  if (!isStepMethod(paramMethod)) {
    return;
  }
  addStepMethod(paramMethod,arguments,mode);
}
Program: 29831
Project: 29831
Buggy source:
@Override public Statement apply(final Statement base,final FrameworkMethod method,final Object target){
  return new Statement(){
    @Override public void evaluate() throws Throwable {
      starting(base,method,target);
      try {
        base.evaluate();
        succeeded();
      }
 catch (      AssumptionViolatedException e) {
        throw e;
      }
catch (      Throwable t) {
        failed(t);
      }
    }
  }
;
}

Fixed version (ground truth):
@Override public Statement apply(final Statement base,final FrameworkMethod method,final Object target){
  return new Statement(){
    @Override public void evaluate() throws Throwable {
      starting(base,method,target);
      try {
        base.evaluate();
        succeeded();
      }
 catch (      AssumptionViolatedException e) {
        throw e;
      }
catch (      Throwable t) {
        failed(t);
        throw t;
      }
    }
  }
;
}
Program: 29832
Project: 29832
Buggy source:
@Override public void evaluate() throws Throwable {
  starting(base,method,target);
  try {
    base.evaluate();
    succeeded();
  }
 catch (  AssumptionViolatedException e) {
    throw e;
  }
catch (  Throwable t) {
    failed(t);
  }
}

Fixed version (ground truth):
@Override public void evaluate() throws Throwable {
  starting(base,method,target);
  try {
    base.evaluate();
    succeeded();
  }
 catch (  AssumptionViolatedException e) {
    throw e;
  }
catch (  Throwable t) {
    failed(t);
    throw t;
  }
}
Program: 29833
Project: 29833
Buggy source:
private static List<TestScenario> setupTestScenarios(){
  List<TestScenario> result=Lists.newArrayList();
  addTestScenario(result,"String_Node_Str").numberOfSteps(2).failingStep(1);
  addTestScenario(result,"String_Node_Str").numberOfSteps(2).failingStep(2);
  addTestScenario(result,"String_Node_Str").notImplementedYet().numberOfSteps(2).failingStep(1);
  addTestScenario(result,"String_Node_Str").notImplementedYet();
  addTestScenario(result,"String_Node_Str").notImplementedYet().failIfPassed();
  addTestScenario(result,"String_Node_Str").notImplementedYet().failIfPassed().failingStep(1);
  addTestScenario(result,"String_Node_Str").notImplementedYet().executeSteps().failingStep(1);
  addTestScenario(result,"String_Node_Str").tagAnnotation();
  return result;
}

Fixed version (ground truth):
private static List<TestScenario> setupTestScenarios(){
  List<TestScenario> result=Lists.newArrayList();
  addTestScenario(result,"String_Node_Str").numberOfSteps(2).failingStep(1);
  addTestScenario(result,"String_Node_Str").numberOfSteps(3).failingStep(1);
  addTestScenario(result,"String_Node_Str").numberOfSteps(2).failingStep(2);
  addTestScenario(result,"String_Node_Str").notImplementedYet().numberOfSteps(2).failingStep(1);
  addTestScenario(result,"String_Node_Str").notImplementedYet();
  addTestScenario(result,"String_Node_Str").notImplementedYet().failIfPassed();
  addTestScenario(result,"String_Node_Str").notImplementedYet().failIfPassed().failingStep(1);
  addTestScenario(result,"String_Node_Str").notImplementedYet().executeSteps().failingStep(1);
  addTestScenario(result,"String_Node_Str").tagAnnotation();
  return result;
}
Program: 29834
Project: 29834
Buggy source:
@Test public void steps_following_failing_steps_are_reported_as_skipped(){
  given().a_failing_test_with_$_steps(2).and().step_$_fails(1);
  when().the_test_is_executed_with_JUnit();
  then().step_$_is_reported_as_failed(1).and().step_$_is_reported_as_skipped(2);
}

Fixed version (ground truth):
@Test public void steps_following_failing_steps_are_reported_as_skipped(){
  given().a_failing_test_with_$_steps(3).and().step_$_fails(1);
  when().the_test_is_executed_with_JUnit();
  then().step_$_is_reported_as_failed(1).and().step_$_is_reported_as_skipped(2).and().step_$_is_reported_as_skipped(3);
}
Program: 29835
Project: 29835
Buggy source:
public DeutscheTestSchritte JGiven_verwendet_wird(){
  return self();
}

Fixed version (ground truth):
public DeutscheTestStufe JGiven_verwendet_wird(){
  return self();
}
Program: 29836
Project: 29836
Buggy source:
public DeutscheTestSchritte generiert_JGiven_deutsche_Berichte(){
  return self();
}

Fixed version (ground truth):
public DeutscheTestStufe generiert_JGiven_deutsche_Berichte(){
  return self();
}
Program: 29837
Project: 29837
Buggy source:
public DeutscheTestSchritte ein_deutsches_Projekt(){
  return self();
}

Fixed version (ground truth):
public DeutscheTestStufe ein_deutsches_Projekt(){
  return self();
}
Program: 29838
Project: 29838
Buggy source:
public DeutscheTestSchritte die_Szenarien_in_deutsch_geschrieben_werden(){
  return self();
}

Fixed version (ground truth):
public DeutscheTestStufe die_Szenarien_in_deutsch_geschrieben_werden(){
  return self();
}
Program: 29839
Project: 29839
Buggy source:
public void a_step_fails(){
  Assertions.assertThat(true).as("String_Node_Str").isFalse();
}

Fixed version (ground truth):
public void a_step_fails(){
  throw new AssertionError();
}
Program: 29840
Project: 29840
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  Word other=(Word)obj;
  return Objects.equal(isIntroWord,other.isIntroWord) && Objects.equal(value,other.value) && Objects.equal(argumentInfo,other.argumentInfo);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  Word other=(Word)obj;
  return Objects.equal(isIntroWord,other.isIntroWord) && Objects.equal(value,other.value) && Objects.equal(argumentInfo,other.argumentInfo);
}
Program: 29841
Project: 29841
Buggy source:
@Override protected String wordToString(Word word){
  if (word.isArg()) {
    int argIndex=word.getArgumentInfo().getParameterIndex();
    if (argIndex < currentScenarioModel.parameterNames.size()) {
      return "String_Node_Str" + currentScenarioModel.parameterNames.get(argIndex) + "String_Node_Str";
    }
  }
  return super.wordToString(word);
}

Fixed version (ground truth):
@Override protected String wordToString(Word word){
  if (word.isArg() && word.getArgumentInfo().isCaseArg()) {
    int argIndex=word.getArgumentInfo().getParameterIndex();
    if (argIndex < currentScenarioModel.parameterNames.size()) {
      return "String_Node_Str" + currentScenarioModel.parameterNames.get(argIndex) + "String_Node_Str";
    }
  }
  return super.wordToString(word);
}
Program: 29842
Project: 29842
Buggy source:
/** 
 * Has to be called when the scenario is finished in order to execute after methods
 */
public void finished() throws Throwable {
  if (state == FINISHED)   return;
  if (state != STARTED)   throw new IllegalStateException("String_Node_Str" + state);
  state=FINISHED;
  methodInterceptor.enableMethodHandling(false);
  Throwable lastThrownException=failedException;
  if (beforeStepsWereExecuted) {
    if (currentStage != null) {
      try {
        executeAfterStageMethods(currentStage);
      }
 catch (      AssertionError e) {
        log.error(e.getMessage(),e);
        lastThrownException=e;
      }
catch (      Exception e) {
        log.error(e.getMessage(),e);
        lastThrownException=e;
      }
    }
    for (    StageState stage : reverse(newArrayList(stages.values()))) {
      try {
        executeAnnotatedMethods(stage.instance,AfterScenario.class);
      }
 catch (      Exception e) {
        log.error(e.getMessage(),e);
        lastThrownException=e;
      }
    }
  }
  for (  Object rule : Lists.reverse(scenarioRules)) {
    try {
      invokeRuleMethod(rule,"String_Node_Str");
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
      lastThrownException=e;
    }
  }
  if (lastThrownException != null) {
    throw lastThrownException;
  }
  if (failIfPass) {
    throw new AssertionFailedError("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Has to be called when the scenario is finished in order to execute after methods
 */
public void finished() throws Throwable {
  if (state == FINISHED)   return;
  if (state != STARTED)   throw new IllegalStateException("String_Node_Str" + state);
  state=FINISHED;
  methodInterceptor.enableMethodHandling(false);
  Throwable lastThrownException=failedException;
  if (beforeStepsWereExecuted) {
    if (currentStage != null) {
      try {
        executeAfterStageMethods(currentStage);
      }
 catch (      AssertionError e) {
        log.error(e.getMessage(),e);
        lastThrownException=e;
      }
catch (      Exception e) {
        log.error(e.getMessage(),e);
        lastThrownException=e;
      }
    }
    for (    StageState stage : reverse(newArrayList(stages.values()))) {
      try {
        executeAnnotatedMethods(stage.instance,AfterScenario.class);
      }
 catch (      Exception e) {
        log.error(e.getMessage(),e);
        lastThrownException=e;
      }
    }
  }
  for (  Object rule : Lists.reverse(scenarioRules)) {
    try {
      invokeRuleMethod(rule,"String_Node_Str");
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
      lastThrownException=e;
    }
  }
  if (lastThrownException != null) {
    throw lastThrownException;
  }
  if (failIfPass) {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 29843
Project: 29843
Buggy source:
public void setPrependType(boolean prependType){
  this.prependType=prependType;
}

Fixed version (ground truth):
public Tag setPrependType(boolean prependType){
  this.prependType=prependType;
  return this;
}
Program: 29844
Project: 29844
Buggy source:
/** 
 * Has to be called when the scenario is finished in order to execute after methods
 */
public void finished() throws Throwable {
  if (state == FINISHED)   return;
  if (state != STARTED)   throw new IllegalStateException("String_Node_Str" + state);
  state=FINISHED;
  Exception lastThrownException=null;
  if (beforeStepsWereExecuted) {
    for (    StageState stage : reverse(newArrayList(stages.values()))) {
      try {
        executeAnnotatedMethods(stage.instance,AfterScenario.class);
      }
 catch (      Exception e) {
        log.error(e.getMessage(),e);
        lastThrownException=e;
      }
    }
  }
  for (  Object rule : Lists.reverse(scenarioRules)) {
    try {
      invokeRuleMethod(rule,"String_Node_Str");
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
      lastThrownException=e;
    }
  }
  if (lastThrownException != null) {
    throw lastThrownException;
  }
}

Fixed version (ground truth):
/** 
 * Has to be called when the scenario is finished in order to execute after methods
 */
public void finished() throws Throwable {
  if (state == FINISHED)   return;
  if (state != STARTED)   throw new IllegalStateException("String_Node_Str" + state);
  state=FINISHED;
  Throwable lastThrownException=null;
  if (beforeStepsWereExecuted) {
    if (currentStage != null) {
      try {
        executeAfterStageMethods(currentStage);
      }
 catch (      AssertionError e) {
        log.error(e.getMessage(),e);
        lastThrownException=e;
      }
catch (      Exception e) {
        log.error(e.getMessage(),e);
        lastThrownException=e;
      }
    }
    for (    StageState stage : reverse(newArrayList(stages.values()))) {
      try {
        executeAnnotatedMethods(stage.instance,AfterScenario.class);
      }
 catch (      Exception e) {
        log.error(e.getMessage(),e);
        lastThrownException=e;
      }
    }
  }
  for (  Object rule : Lists.reverse(scenarioRules)) {
    try {
      invokeRuleMethod(rule,"String_Node_Str");
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
      lastThrownException=e;
    }
  }
  if (lastThrownException != null) {
    throw lastThrownException;
  }
}
Program: 29845
Project: 29845
Buggy source:
public void after(){
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
@AfterStage public void after(){
  throw new SomeExceptionInAfterStage();
}
Program: 29846
Project: 29846
Buggy source:
@Test public void given_steps_are_reported(){
  given().some_test_step();
  getScenario().finished();
  ScenarioModel model=getScenario().getModel().getLastScenarioModel();
  assertThat(model.className).isEqualTo(StepsAreReported.class.getName());
  assertThat(model.testMethodName).isEqualTo("String_Node_Str");
  assertThat(model.description).isEqualTo("String_Node_Str");
  assertThat(model.parameterNames).isEmpty();
  assertThat(model.tags).isEmpty();
  assertThat(model.getScenarioCases()).hasSize(1);
  ScenarioCaseModel scenarioCase=model.getCase(0);
  assertThat(scenarioCase.arguments).isEmpty();
  assertThat(scenarioCase.caseNr).isEqualTo(1);
  assertThat(scenarioCase.steps).hasSize(1);
  StepModel step=scenarioCase.steps.get(0);
  assertThat(step.name).isEqualTo("String_Node_Str");
  assertThat(step.words).isEqualTo(Arrays.asList(new Word("String_Node_Str"),new Word("String_Node_Str")));
  assertThat(step.notImplementedYet).isFalse();
}

Fixed version (ground truth):
@Test public void given_steps_are_reported(){
  given().some_test_step();
  getScenario().finished();
  ScenarioModel model=getScenario().getModel().getLastScenarioModel();
  assertThat(model.className).isEqualTo(StepsAreReported.class.getName());
  assertThat(model.testMethodName).isEqualTo("String_Node_Str");
  assertThat(model.description).isEqualTo("String_Node_Str");
  assertThat(model.parameterNames).isEmpty();
  assertThat(model.tags).isEmpty();
  assertThat(model.getScenarioCases()).hasSize(1);
  ScenarioCaseModel scenarioCase=model.getCase(0);
  assertThat(scenarioCase.arguments).isEmpty();
  assertThat(scenarioCase.caseNr).isEqualTo(1);
  assertThat(scenarioCase.steps).hasSize(1);
  StepModel step=scenarioCase.steps.get(0);
  assertThat(step.name).isEqualTo("String_Node_Str");
  assertThat(step.words).isEqualTo(Arrays.asList(Word.introWord("String_Node_Str"),new Word("String_Node_Str")));
  assertThat(step.notImplementedYet).isFalse();
}
Program: 29847
Project: 29847
Buggy source:
@Test public void printf_annotation_uses_the_PrintfFormatter(){
  scenario.startScenario("String_Node_Str");
  given().a_step_with_a_printf_annotation_$(5.2);
  scenario.finished();
  StepModel step=scenario.getModel().getFirstStepModelOfLastScenario();
  assertThat(step.words.get(2).value).isEqualTo("String_Node_Str");
}

Fixed version (ground truth):
@Test public void printf_annotation_uses_the_PrintfFormatter(){
  scenario.startScenario("String_Node_Str");
  given().a_step_with_a_printf_annotation_$(5.2);
  scenario.finished();
  StepModel step=scenario.getModel().getFirstStepModelOfLastScenario();
  assertThat(step.words.get(2).value).isEqualTo(String.format("String_Node_Str",5.2));
}
Program: 29848
Project: 29848
Buggy source:
@Override public String format(T argumentToFormat,final String... formatterArguments){
  if (argumentToFormat == null) {
    return "String_Node_Str";
  }
  if (argumentToFormat.getClass().isArray()) {
    return Joiner.on("String_Node_Str").join(Iterables.transform(Arrays.asList((Object[])argumentToFormat),new Function<Object,String>(){
      @Override public String apply(      Object input){
        return new DefaultFormatter<Object>().format(input,formatterArguments);
      }
    }
));
  }
  return String.valueOf(argumentToFormat);
}

Fixed version (ground truth):
@Override public String format(T argumentToFormat,final String... formatterArguments){
  if (argumentToFormat == null) {
    return "String_Node_Str";
  }
  Class<? extends Object> clazz=argumentToFormat.getClass();
  if (clazz.isArray()) {
    DefaultFormatter<Object> defaultFormatter=new DefaultFormatter<Object>();
    StringBuilder sb=new StringBuilder();
    for (int i=0; i < Array.getLength(argumentToFormat); i++) {
      if (i > 0) {
        sb.append("String_Node_Str");
      }
      sb.append(defaultFormatter.format(Array.get(argumentToFormat,i)));
    }
    return sb.toString();
  }
  return String.valueOf(argumentToFormat);
}
Program: 29849
Project: 29849
Buggy source:
private void writeIndexFile(HtmlTocWriter tocWriter){
  File file=new File(toDir,"String_Node_Str");
  PrintWriter printWriter=HtmlWriter.getPrintWriter(file);
  try {
    HtmlWriter htmlWriter=new HtmlWriter(printWriter);
    htmlWriter.writeHtmlHeader("String_Node_Str");
    tocWriter.writeToc(printWriter);
    ReportModel reportModel=new ReportModel();
    reportModel.className="String_Node_Str";
    htmlWriter.visit(reportModel);
    for (    Tag tag : tocWriter.getSortedTags()) {
      printWriter.println(ScenarioHtmlWriter.tagToHtml(tag));
    }
    htmlWriter.visitEnd(reportModel);
    htmlWriter.writeHtmlFooter();
  }
  finally {
    ResourceUtil.close(printWriter);
  }
}

Fixed version (ground truth):
private void writeIndexFile(HtmlTocWriter tocWriter){
  File file=new File(toDir,"String_Node_Str");
  PrintWriter printWriter=HtmlWriter.getPrintWriter(file);
  try {
    HtmlWriter htmlWriter=new HtmlWriter(printWriter);
    htmlWriter.writeHtmlHeader("String_Node_Str");
    ReportModel reportModel=new ReportModel();
    reportModel.className="String_Node_Str";
    htmlWriter.writeHeader(reportModel);
    tocWriter.writeToc(printWriter);
    htmlWriter.visit(reportModel);
    for (    Tag tag : tocWriter.getSortedTags()) {
      printWriter.println(ScenarioHtmlWriter.tagToHtml(tag));
    }
    htmlWriter.visitEnd(reportModel);
    htmlWriter.writeHtmlFooter();
  }
  finally {
    ResourceUtil.close(printWriter);
  }
}
Program: 29850
Project: 29850
Buggy source:
public void writeHtmlFooter(){
  writer.write("String_Node_Str");
  writer.write("String_Node_Str");
  writer.write("String_Node_Str");
}

Fixed version (ground truth):
public void writeHtmlFooter(){
  writer.write("String_Node_Str");
  writer.write("String_Node_Str");
  writer.write("String_Node_Str");
  writer.write("String_Node_Str");
}
Program: 29851
Project: 29851
Buggy source:
public void write(ReportModel model,HtmlTocWriter htmlTocWriter){
  writeHtmlHeader(model.className);
  if (htmlTocWriter != null) {
    htmlTocWriter.writeToc(writer);
  }
  model.accept(this);
  writeHtmlFooter();
}

Fixed version (ground truth):
public void write(ReportModel model,HtmlTocWriter htmlTocWriter){
  writeHtmlHeader(model.className);
  writeHeader(model);
  if (htmlTocWriter != null) {
    htmlTocWriter.writeToc(writer);
  }
  model.accept(this);
  writeHtmlFooter();
}
Program: 29852
Project: 29852
Buggy source:
/** 
 * Starts the scenario with the given method and arguments. Derives the description from the method name.
 * @param method the method that started the scenario
 * @param arguments the arguments of the method invocation
 */
public void startScenario(Method method,List<?> arguments){
  listener.scenarioStarted(method,arguments);
}

Fixed version (ground truth):
/** 
 * Starts the scenario with the given method and arguments. Derives the description from the method name.
 * @param method the method that started the scenario
 * @param arguments the arguments of the method invocation
 */
public void startScenario(Method method,List<?> arguments){
  listener.scenarioStarted(method,arguments);
  if (method.isAnnotationPresent(NotImplementedYet.class)) {
    methodInterceptor.disableMethodExecution();
  }
}
Program: 29853
Project: 29853
Buggy source:
@SuppressWarnings("String_Node_Str") public <T>T addStage(Class<T> stepsClass){
  if (stages.containsKey(stepsClass))   return (T)stages.get(stepsClass).instance;
  Enhancer e=new Enhancer();
  e.setSuperclass(stepsClass);
  StepMethodInterceptor callback=new StepMethodInterceptor(new MethodHandler(),stackDepth);
  e.setCallback(callback);
  T result=(T)e.create();
  callback.enable();
  stages.put(stepsClass,new StageState(result));
  gatherRules(result);
  injectSteps(result);
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T>T addStage(Class<T> stepsClass){
  if (stages.containsKey(stepsClass))   return (T)stages.get(stepsClass).instance;
  Enhancer e=new Enhancer();
  e.setSuperclass(stepsClass);
  e.setCallback(methodInterceptor);
  T result=(T)e.create();
  methodInterceptor.enableMethodHandling();
  stages.put(stepsClass,new StageState(result));
  gatherRules(result);
  injectSteps(result);
  return result;
}
Program: 29854
Project: 29854
Buggy source:
@Override public Object intercept(Object receiver,Method method,Object[] parameters,MethodProxy methodProxy) throws Throwable {
  if (enabled && stackDepth.get() == 0 && !method.getDeclaringClass().equals(Object.class)) {
    scenarioMethodHandler.handleMethod(receiver,method,parameters);
  }
  if (method.isAnnotationPresent(NotImplementedYet.class) || receiver.getClass().isAnnotationPresent(NotImplementedYet.class)) {
    if (!method.getReturnType().isAssignableFrom(receiver.getClass())) {
      log.warn("String_Node_Str" + method.getName() + "String_Node_Str"+ method.getDeclaringClass().getSimpleName()+ "String_Node_Str"+ "String_Node_Str");
      return null;
    }
    return receiver;
  }
  try {
    stackDepth.incrementAndGet();
    return methodProxy.invokeSuper(receiver,parameters);
  }
 catch (  Throwable t) {
    scenarioMethodHandler.handleThrowable(t);
    throw t;
  }
 finally {
    stackDepth.decrementAndGet();
  }
}

Fixed version (ground truth):
@Override public Object intercept(Object receiver,Method method,Object[] parameters,MethodProxy methodProxy) throws Throwable {
  if (methodHandlingEnabled && stackDepth.get() == 0 && !method.getDeclaringClass().equals(Object.class)) {
    scenarioMethodHandler.handleMethod(receiver,method,parameters);
  }
  if (!methodExecutionEnabled || method.isAnnotationPresent(NotImplementedYet.class) || receiver.getClass().isAnnotationPresent(NotImplementedYet.class)) {
    if (!method.getReturnType().isAssignableFrom(receiver.getClass())) {
      log.warn("String_Node_Str" + method.getName() + "String_Node_Str"+ method.getDeclaringClass().getSimpleName()+ "String_Node_Str"+ "String_Node_Str");
      return null;
    }
    return receiver;
  }
  try {
    stackDepth.incrementAndGet();
    return methodProxy.invokeSuper(receiver,parameters);
  }
 catch (  Throwable t) {
    scenarioMethodHandler.handleThrowable(t);
    throw t;
  }
 finally {
    stackDepth.decrementAndGet();
  }
}
Program: 29855
Project: 29855
Buggy source:
public abstract void handleReportModel(ReportModel model,File file);

Fixed version (ground truth):
@Override public abstract void handleReportModel(ReportModel model,File file);
Program: 29856
Project: 29856
Buggy source:
public void generate(File toDir,String targetFileName,File sourceDir) throws IOException {
  if (!toDir.isDirectory())   throw new RuntimeException(toDir + "String_Node_Str");
  log.info("String_Node_Str" + targetFileName + "String_Node_Str"+ toDir);
  this.toDir=toDir;
  writer=new PrintWriter(new File(toDir,targetFileName),Charsets.UTF_8.name());
  utils=new HtmlWriterUtils(writer);
  try {
    writeStart();
    for (    ReportModelFile f : Files.fileTreeTraverser().breadthFirstTraversal(sourceDir).filter(FilePredicates.endsWith("String_Node_Str")).transform(new TestCaseFileReader())) {
      handleReportModel(f.model,f.file);
    }
    writeEnd();
  }
  finally {
    ResourceUtil.close(writer);
  }
  copyFileToTargetDir("String_Node_Str");
  copyFileToTargetDir("String_Node_Str");
}

Fixed version (ground truth):
public void generate(File toDir,String targetFileName,File sourceDir) throws IOException {
  if (!toDir.isDirectory())   throw new RuntimeException(toDir + "String_Node_Str");
  log.info("String_Node_Str" + targetFileName + "String_Node_Str"+ toDir);
  this.toDir=toDir;
  writer=new PrintWriter(new File(toDir,targetFileName),Charsets.UTF_8.name());
  utils=new HtmlWriterUtils(writer);
  try {
    writeStart();
    new JsonModelTraverser().traverseModels(sourceDir,this);
    writeEnd();
  }
  finally {
    ResourceUtil.close(writer);
  }
  copyFileToTargetDir("String_Node_Str");
  copyFileToTargetDir("String_Node_Str");
}
Program: 29857
Project: 29857
Buggy source:
@Override public int compare(ModelFile o1,ModelFile o2){
  return o1.model.getSimpleClassName().compareTo(o2.model.getSimpleClassName());
}

Fixed version (ground truth):
@Override public int compare(Tag o1,Tag o2){
  return o1.toString().compareTo(o2.toString());
}
Program: 29858
Project: 29858
Buggy source:
@Override public void handleReportModel(ReportModel model,File file){
  String targetFileName=Files.getNameWithoutExtension(file.getName()) + "String_Node_Str";
  File targetFile=new File(toDir,targetFileName);
  log.debug("String_Node_Str" + targetFile);
  try {
    HtmlFileWriter.writeModelToFile(model,targetFile);
    ModelFile modelFile=new ModelFile();
    modelFile.model=model;
    modelFile.file=targetFile;
    models.add(modelFile);
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + file + "String_Node_Str"+ e);
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Override public void handleReportModel(ReportModel model,File file){
  String targetFileName=Files.getNameWithoutExtension(file.getName()) + "String_Node_Str";
  File targetFile=new File(toDir,targetFileName);
  log.debug("String_Node_Str" + targetFile);
  try {
    HtmlFileWriter.writeModelToFile(model,targetFile);
    ModelFile modelFile=new ModelFile();
    modelFile.model=model;
    modelFile.file=targetFile;
    models.add(modelFile);
    for (    ScenarioModel scenario : model.scenarios) {
      for (      Tag tag : scenario.tags) {
        addToMap(tag,scenario);
      }
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + file + "String_Node_Str"+ e);
    throw Throwables.propagate(e);
  }
}
Program: 29859
Project: 29859
Buggy source:
@Override public void writeEnd(){
  Comparator<ModelFile> comparator=new Comparator<ModelFile>(){
    @Override public int compare(    ModelFile o1,    ModelFile o2){
      return o1.model.getSimpleClassName().compareTo(o2.model.getSimpleClassName());
    }
  }
;
  Collections.sort(models,comparator);
  for (  ModelFile modelFile : models) {
    writeFileLink(modelFile);
  }
}

Fixed version (ground truth):
@Override public void writeEnd(){
  Comparator<ModelFile> comparator=new Comparator<ModelFile>(){
    @Override public int compare(    ModelFile o1,    ModelFile o2){
      return o1.model.getSimpleClassName().compareTo(o2.model.getSimpleClassName());
    }
  }
;
  Collections.sort(models,comparator);
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  for (  ModelFile modelFile : models) {
    writeFileLink(modelFile);
  }
  writer.println("String_Node_Str");
  writeTagFiles();
}
Program: 29860
Project: 29860
Buggy source:
private static PrintWriter getPrintWriter(File file){
  try {
    return new PrintWriter(file);
  }
 catch (  FileNotFoundException e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
private static PrintWriter getPrintWriter(File file){
  try {
    return new PrintWriter(file,Charsets.UTF_8.name());
  }
 catch (  FileNotFoundException e) {
    throw Throwables.propagate(e);
  }
catch (  UnsupportedEncodingException e) {
    throw Throwables.propagate(e);
  }
}
Program: 29861
Project: 29861
Buggy source:
public static void writeModelToFile(ReportModel model,File file){
  PrintWriter printWriter=getPrintWriter(file);
  try {
    HtmlWriter htmlWriter=new HtmlWriter(printWriter);
    htmlWriter.writeHtmlHeader(model.className);
    htmlWriter.write(model);
    htmlWriter.writeHtmlFooter();
  }
  finally {
    ResourceUtil.close(printWriter);
  }
}

Fixed version (ground truth):
public static void writeModelToFile(ReportModel model,File file){
  PrintWriter printWriter=getPrintWriter(file);
  try {
    HtmlWriter htmlWriter=new HtmlWriter(printWriter);
    htmlWriter.write(model);
  }
  finally {
    ResourceUtil.close(printWriter);
  }
}
Program: 29862
Project: 29862
Buggy source:
public void generate() throws IOException {
  if (!toDir.exists() && !toDir.mkdirs()) {
    log.error("String_Node_Str" + toDir);
    return;
  }
  if (frames) {
    new FrameBasedHtmlReportGenerator().generate(toDir,sourceDir);
  }
 else {
    new FrameBasedHtmlReportGenerator().generate(toDir,sourceDir);
    new SingleFileHtmlReportGenerator().generate(toDir,"String_Node_Str",sourceDir);
  }
  if (customCssFile != null) {
    if (!customCssFile.canRead()) {
      log.info("String_Node_Str" + customCssFile + "String_Node_Str");
    }
 else {
      Files.copy(customCssFile,new File(toDir,"String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
public void generate() throws IOException {
  if (!toDir.exists() && !toDir.mkdirs()) {
    log.error("String_Node_Str" + toDir);
    return;
  }
  new FrameBasedHtmlReportGenerator().generate(toDir,sourceDir);
  new SingleFileHtmlReportGenerator().generate(toDir,"String_Node_Str",sourceDir);
  if (customCssFile != null) {
    if (!customCssFile.canRead()) {
      log.info("String_Node_Str" + customCssFile + "String_Node_Str");
    }
 else {
      Files.copy(customCssFile,new File(toDir,"String_Node_Str"));
    }
  }
}
Program: 29863
Project: 29863
Buggy source:
@Test @TestTag({"String_Node_Str","String_Node_Str","String_Node_Str"}) public void annotations_are_translated_to_tags(){
  given().some_test_step();
  getScenario().finished();
  ScenarioModel model=getScenario().getModel().getLastScenarioModel();
  assertThat(model.tags).hasSize(1);
  assertThat(model.tags.get(0).getName()).isEqualTo("String_Node_Str");
  assertThat(model.tags.get(0).getValue()).isEqualTo(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
}

Fixed version (ground truth):
@Test @TestTag({"String_Node_Str","String_Node_Str","String_Node_Str"}) public void annotations_are_translated_to_tags(){
  given().some_test_step();
  getScenario().finished();
  ScenarioModel model=getScenario().getModel().getLastScenarioModel();
  assertThat(model.tags).hasSize(1);
  assertThat(model.getTags().get(0).getName()).isEqualTo("String_Node_Str");
  assertThat(model.getTags().get(0).getValue()).isEqualTo(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
}
Program: 29864
Project: 29864
Buggy source:
@Test @TestTag({"String_Node_Str","String_Node_Str","String_Node_Str"}) @UseDataProvider("String_Node_Str") public void annotations_are_translated_to_tags_only_once(int n){
  given().some_test_step();
  getScenario().finished();
  ScenarioModel model=getScenario().getModel().getLastScenarioModel();
  assertThat(model.tags).hasSize(1);
  assertThat(model.tags.get(0).getName()).isEqualTo("String_Node_Str");
  assertThat(model.tags.get(0).getValue()).isEqualTo(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
}

Fixed version (ground truth):
@Test @TestTag({"String_Node_Str","String_Node_Str","String_Node_Str"}) @UseDataProvider("String_Node_Str") public void annotations_are_translated_to_tags_only_once(int n){
  given().some_test_step();
  getScenario().finished();
  ScenarioModel model=getScenario().getModel().getLastScenarioModel();
  assertThat(model.tags).hasSize(1);
  assertThat(model.getTags().get(0).getName()).isEqualTo("String_Node_Str");
  assertThat(model.getTags().get(0).getValue()).isEqualTo(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
}
Program: 29865
Project: 29865
Buggy source:
@Override public void execute(){
  m_logger.info("String_Node_Str",m_appDef.getAppName());
  Date now=new Date();
  OLAPService olap=OLAPService.instance();
  List<String> shards=olap.listShards(m_appDef);
  for (  String shardName : shards) {
    Date expirationDate=olap.getExpirationDate(m_appDef,shardName);
    if (expirationDate != null && expirationDate.before(now)) {
      olap.deleteShard(m_appDef,shardName);
      m_logger.info("String_Node_Str",shardName,m_appDef.getAppName());
    }
  }
}

Fixed version (ground truth):
@Override public void execute(){
  m_logger.info("String_Node_Str",m_appDef.getAppName());
  Date now=new Date();
  OLAPService olap=OLAPService.instance();
  List<String> shards=olap.listShards(m_appDef);
  for (  String shardName : shards) {
    Date expirationDate=olap.getExpirationDate(m_appDef,shardName);
    m_logger.debug("String_Node_Str",shardName,expirationDate);
    if (expirationDate != null && expirationDate.before(now)) {
      olap.deleteShard(m_appDef,shardName);
      m_logger.info("String_Node_Str",shardName,m_appDef.getAppName());
    }
  }
}
Program: 29866
Project: 29866
Buggy source:
private void attemptToExecuteTask(ApplicationDefinition appDef,Task task,TaskRecord taskRecord){
  Tenant tenant=Tenant.getTenant(appDef);
  String taskID=taskRecord.getTaskID();
  String claimID="String_Node_Str" + taskID;
  long claimStamp=System.currentTimeMillis();
  writeTaskClaim(tenant,claimID,claimStamp);
  if (taskClaimedByUs(tenant,claimID)) {
    startTask(appDef,task,taskRecord);
  }
}

Fixed version (ground truth):
private void attemptToExecuteTask(ApplicationDefinition appDef,Task task,TaskRecord taskRecord){
  Tenant tenant=Tenant.getTenant(appDef);
  String taskID=taskRecord.getTaskID();
  String claimID="String_Node_Str" + taskID;
  long claimStamp=System.currentTimeMillis();
  writeTaskClaim(tenant,claimID,claimStamp);
  if (taskClaimedByUs(tenant,claimID)) {
    startTask(appDef,task,taskRecord);
  }
 else {
    m_logger.info("String_Node_Str");
  }
}
Program: 29867
Project: 29867
Buggy source:
private boolean taskClaimedByUs(Tenant tenant,String claimID){
  waitForClaim();
  Iterator<DColumn> colIter=DBService.instance(tenant).getAllColumns(TaskManagerService.TASKS_STORE_NAME,claimID).iterator();
  if (colIter == null) {
    m_logger.warn("String_Node_Str",claimID);
    return false;
  }
  String claimingHost=m_hostClaimID;
  long earliestClaim=Long.MAX_VALUE;
  while (colIter.hasNext()) {
    DColumn col=colIter.next();
    try {
      long claimStamp=Long.parseLong(col.getValue());
      String claimHost=col.getName();
      if (claimStamp < earliestClaim) {
        claimingHost=claimHost;
        earliestClaim=claimStamp;
      }
 else       if (claimStamp == earliestClaim) {
        if (claimHost.compareTo(claimingHost) < 0) {
          claimingHost=claimHost;
        }
      }
    }
 catch (    NumberFormatException e) {
    }
  }
  return claimingHost.equals(m_hostClaimID) && !m_bShutdown;
}

Fixed version (ground truth):
private boolean taskClaimedByUs(Tenant tenant,String claimID){
  waitForClaim();
  Iterator<DColumn> colIter=DBService.instance(tenant).getAllColumns(TaskManagerService.TASKS_STORE_NAME,claimID).iterator();
  if (colIter == null) {
    m_logger.warn("String_Node_Str",claimID);
    return false;
  }
  String claimingHost=m_hostClaimID;
  long earliestClaim=Long.MAX_VALUE;
  while (colIter.hasNext()) {
    DColumn col=colIter.next();
    try {
      long claimStamp=Long.parseLong(col.getValue());
      long secondsSinceClaim=(System.currentTimeMillis() - claimStamp) / 1000;
      if (secondsSinceClaim > 600)       continue;
      String claimHost=col.getName();
      if (claimStamp < earliestClaim) {
        claimingHost=claimHost;
        earliestClaim=claimStamp;
      }
 else       if (claimStamp == earliestClaim) {
        if (claimHost.compareTo(claimingHost) < 0) {
          claimingHost=claimHost;
        }
      }
    }
 catch (    NumberFormatException e) {
    }
  }
  return claimingHost.equals(m_hostClaimID) && !m_bShutdown;
}
Program: 29868
Project: 29868
Buggy source:
/** 
 * Apply aall updates in the given   {@link DBTransaction} to our DynamoDB instance.
 * @param dbTran {@link DBTransaction} with updates.
 */
public void commit(DBTransaction dbTran){
  try {
    applyUpdates(dbTran);
  }
 catch (  Exception e) {
    if (e instanceof AmazonServiceException) {
      String rawMessage=((AmazonServiceException)e).getRawResponseContent();
      m_logger.error("String_Node_Str",e,rawMessage);
    }
 else {
      m_logger.error("String_Node_Str",e);
    }
    throw e;
  }
 finally {
    dbTran.clear();
  }
}

Fixed version (ground truth):
/** 
 * Apply aall updates in the given   {@link DBTransaction} to our DynamoDB instance.
 * @param dbTran {@link DBTransaction} with updates.
 */
public void commit(DBTransaction dbTran){
  try {
    applyUpdates(dbTran);
  }
 catch (  Exception e) {
    m_logger.error("String_Node_Str",e);
    throw e;
  }
 finally {
    dbTran.clear();
  }
}
Program: 29869
Project: 29869
Buggy source:
@Override public void initializeApplication(ApplicationDefinition oldAppDef,ApplicationDefinition appDef){
  checkServiceState();
  m_olap.createApplication(appDef.getAppName());
}

Fixed version (ground truth):
@Override public void initializeApplication(ApplicationDefinition oldAppDef,ApplicationDefinition appDef){
  checkServiceState();
  Tenant tenant=Tenant.getTenant(appDef);
  m_olap.createApplication(tenant,appDef.getAppName());
}
Program: 29871
Project: 29871
Buggy source:
/** 
 * Add the given list of DBObjects to the builder.
 * @param list dbObjectList  New list of {@link DBObject}.
 * @return          This {@link Builder}.
 */
public Builder withObjects(List<DBObject> dbObjectList){
  for (  DBObject dbObject : dbObjectList) {
    dbObjectBatch.addObject(dbObject);
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Add the given list of DBObjects to the builder.
 * @param dbObjectList dbObjectList  New list of {@link DBObject}.
 * @return             This {@link Builder}.
 */
public Builder withObjects(List<DBObject> dbObjectList){
  for (  DBObject dbObject : dbObjectList) {
    dbObjectBatch.addObject(dbObject);
  }
  return this;
}