Program: 146654
Project: 146654
Buggy source:
@Test public void testAnswerConstraintOldText(){
  IntegerData ans=new IntegerData(7);
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=fpi.getFormEntryController();
  fec.jumpToIndex(FormIndex.createBeginningOfFormIndex());
  fec.setLanguage("String_Node_Str");
  do {
    QuestionDef q=fpi.getCurrentQuestion();
    if (q == null || q.getTextID() == null || "String_Node_Str".equals(q.getTextID())) {
      continue;
    }
    if (q.getTextID().equals("String_Node_Str")) {
      int response=fec.answerQuestion(ans);
      if (response == FormEntryController.ANSWER_CONSTRAINT_VIOLATED) {
        if (!"String_Node_Str".equals(fec.getModel().getQuestionPrompt().getConstraintText())) {
          fail("String_Node_Str" + fec.getModel().getQuestionPrompt().getConstraintText());
        }
      }
 else       if (response == FormEntryController.ANSWER_OK) {
        fail("String_Node_Str");
        break;
      }
    }
    if (q.getTextID().equals("String_Node_Str")) {
      int response3=fec.answerQuestion(new IntegerData(13));
      if (response3 == FormEntryController.ANSWER_CONSTRAINT_VIOLATED) {
        if (!"String_Node_Str".equals(fec.getModel().getQuestionPrompt().getConstraintText())) {
          fail("String_Node_Str" + fec.getModel().getQuestionPrompt().getConstraintText());
        }
      }
 else       if (response3 == FormEntryController.ANSWER_OK) {
        fail("String_Node_Str");
        break;
      }
    }
    if (q.getTextID().equals("String_Node_Str")) {
      int response4=fec.answerQuestion(new IntegerData(13));
      if (response4 == FormEntryController.ANSWER_CONSTRAINT_VIOLATED) {
        if (!"String_Node_Str".equals(fec.getModel().getQuestionPrompt().getConstraintText())) {
          fail("String_Node_Str" + fec.getModel().getQuestionPrompt().getConstraintText());
        }
      }
 else       if (response4 == FormEntryController.ANSWER_OK) {
        fail("String_Node_Str");
        break;
      }
    }
  }
 while (fec.stepToNextEvent() != FormEntryController.EVENT_END_OF_FORM);
}

Fixed version (ground truth):
@Test public void testAnswerConstraintOldText(){
  IntegerData ans=new IntegerData(7);
  FormParseInit fpi=new FormParseInit("String_Node_Str");
  FormEntryController fec=initFormEntry(fpi);
  fec.setLanguage("String_Node_Str");
  do {
    QuestionDef q=fpi.getCurrentQuestion();
    if (q == null || q.getTextID() == null || "String_Node_Str".equals(q.getTextID())) {
      continue;
    }
    if (q.getTextID().equals("String_Node_Str")) {
      int response=fec.answerQuestion(ans);
      if (response == FormEntryController.ANSWER_CONSTRAINT_VIOLATED) {
        if (!"String_Node_Str".equals(fec.getModel().getQuestionPrompt().getConstraintText())) {
          fail("String_Node_Str" + fec.getModel().getQuestionPrompt().getConstraintText());
        }
      }
 else       if (response == FormEntryController.ANSWER_OK) {
        fail("String_Node_Str");
        break;
      }
    }
    if (q.getTextID().equals("String_Node_Str")) {
      int response3=fec.answerQuestion(new IntegerData(13));
      if (response3 == FormEntryController.ANSWER_CONSTRAINT_VIOLATED) {
        if (!"String_Node_Str".equals(fec.getModel().getQuestionPrompt().getConstraintText())) {
          fail("String_Node_Str" + fec.getModel().getQuestionPrompt().getConstraintText());
        }
      }
 else       if (response3 == FormEntryController.ANSWER_OK) {
        fail("String_Node_Str");
        break;
      }
    }
    if (q.getTextID().equals("String_Node_Str")) {
      int response4=fec.answerQuestion(new IntegerData(13));
      if (response4 == FormEntryController.ANSWER_CONSTRAINT_VIOLATED) {
        if (!"String_Node_Str".equals(fec.getModel().getQuestionPrompt().getConstraintText())) {
          fail("String_Node_Str" + fec.getModel().getQuestionPrompt().getConstraintText());
        }
      }
 else       if (response4 == FormEntryController.ANSWER_OK) {
        fail("String_Node_Str");
        break;
      }
    }
  }
 while (fec.stepToNextEvent() != FormEntryController.EVENT_END_OF_FORM);
}