Program: 62698
Project: 62698
Buggy source:
@Test public void testSaveAndUpdateFeedbackParticipantCommentsOnResponseInClosedSession(){
  FeedbackQuestionsDb fqDb=new FeedbackQuestionsDb();
  FeedbackResponsesDb frDb=new FeedbackResponsesDb();
  FeedbackQuestionAttributes fq=fqDb.getFeedbackQuestion("String_Node_Str","String_Node_Str",2);
  assertNotNull("String_Node_Str",fq);
  FeedbackResponseAttributes fr=dataBundle.feedbackResponses.get("String_Node_Str");
  fr=frDb.getFeedbackResponse(fq.getId(),fr.giver,fr.recipient);
  assertNotNull("String_Node_Str",fr);
  InstructorAttributes instructor1InCourse1=dataBundle.instructors.get("String_Node_Str");
  gaeSimulation.loginAsInstructor(instructor1InCourse1.googleId);
  String moderatedInstructorEmail="String_Node_Str";
  ______TS("String_Node_Str");
  String[] submissionParams=new String[]{Const.ParamsNames.FEEDBACK_QUESTION_RESPONSETOTAL + "String_Node_Str","String_Node_Str",Const.ParamsNames.FEEDBACK_RESPONSE_ID + "String_Node_Str",fr.getId(),Const.ParamsNames.FEEDBACK_SESSION_NAME,fr.feedbackSessionName,Const.ParamsNames.COURSE_ID,fr.courseId,Const.ParamsNames.FEEDBACK_QUESTION_ID + "String_Node_Str",fr.feedbackQuestionId,Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "String_Node_Str",fr.recipient,Const.ParamsNames.FEEDBACK_QUESTION_TYPE + "String_Node_Str",fr.feedbackQuestionType.toString(),Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "String_Node_Str","String_Node_Str",Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ADD_TEXT + "String_Node_Str","String_Node_Str",Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON,moderatedInstructorEmail};
  RedirectResult result=getRedirectResult(getAction(submissionParams));
  assertFalse(result.isError);
  assertEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED,result.getStatusMessage());
  assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_EDIT_INSTRUCTOR_FEEDBACK_PAGE,false,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),result.getDestinationWithParams());
  FeedbackResponseCommentAttributes frc=getFeedbackParticipantComment(fr.getId());
  assertEquals("String_Node_Str",frc.commentText.getValue());
  assertEquals(FeedbackParticipantType.INSTRUCTORS,frc.commentGiverType);
  assertEquals("String_Node_Str",frc.commentGiver);
  assertTrue(frc.isCommentFromFeedbackParticipant);
  assertTrue(frc.isVisibilityFollowingFeedbackQuestion);
  ______TS("String_Node_Str");
  submissionParams=new String[]{Const.ParamsNames.FEEDBACK_QUESTION_RESPONSETOTAL + "String_Node_Str","String_Node_Str",Const.ParamsNames.FEEDBACK_RESPONSE_ID + "String_Node_Str",fr.getId(),Const.ParamsNames.FEEDBACK_SESSION_NAME,fr.feedbackSessionName,Const.ParamsNames.COURSE_ID,fr.courseId,Const.ParamsNames.FEEDBACK_QUESTION_ID + "String_Node_Str",fr.feedbackQuestionId,Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "String_Node_Str",fr.recipient,Const.ParamsNames.FEEDBACK_QUESTION_TYPE + "String_Node_Str",fr.feedbackQuestionType.toString(),Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "String_Node_Str","String_Node_Str",Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_TEXT + "String_Node_Str","String_Node_Str",Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ID + "String_Node_Str",frc.getId().toString(),Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON,moderatedInstructorEmail};
  result=getRedirectResult(getAction(submissionParams));
  assertFalse(result.isError);
  assertEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED,result.getStatusMessage());
  assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_EDIT_INSTRUCTOR_FEEDBACK_PAGE,false,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),result.getDestinationWithParams());
  frc=getFeedbackParticipantComment(fr.getId());
  assertEquals("String_Node_Str",frc.commentText.getValue());
  assertEquals(FeedbackParticipantType.INSTRUCTORS,frc.commentGiverType);
  assertEquals("String_Node_Str",frc.commentGiver);
  assertTrue(frc.isCommentFromFeedbackParticipant);
  assertTrue(frc.isVisibilityFollowingFeedbackQuestion);
}

Fixed version (ground truth):
@Test public void testSaveAndUpdateFeedbackParticipantCommentsOnResponseInClosedSession(){
  FeedbackQuestionsDb fqDb=new FeedbackQuestionsDb();
  FeedbackResponsesDb frDb=new FeedbackResponsesDb();
  FeedbackResponseCommentsDb frcDb=new FeedbackResponseCommentsDb();
  FeedbackQuestionAttributes fq=fqDb.getFeedbackQuestion("String_Node_Str","String_Node_Str",2);
  assertNotNull("String_Node_Str",fq);
  FeedbackResponseAttributes fr=dataBundle.feedbackResponses.get("String_Node_Str");
  fr=frDb.getFeedbackResponse(fq.getId(),fr.giver,fr.recipient);
  assertNotNull("String_Node_Str",fr);
  InstructorAttributes instructor1InCourse1=dataBundle.instructors.get("String_Node_Str");
  gaeSimulation.loginAsInstructor(instructor1InCourse1.googleId);
  String moderatedInstructorEmail="String_Node_Str";
  ______TS("String_Node_Str");
  String[] submissionParams=new String[]{Const.ParamsNames.FEEDBACK_QUESTION_RESPONSETOTAL + "String_Node_Str","String_Node_Str",Const.ParamsNames.FEEDBACK_RESPONSE_ID + "String_Node_Str",fr.getId(),Const.ParamsNames.FEEDBACK_SESSION_NAME,fr.feedbackSessionName,Const.ParamsNames.COURSE_ID,fr.courseId,Const.ParamsNames.FEEDBACK_QUESTION_ID + "String_Node_Str",fr.feedbackQuestionId,Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "String_Node_Str",fr.recipient,Const.ParamsNames.FEEDBACK_QUESTION_TYPE + "String_Node_Str",fr.feedbackQuestionType.toString(),Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "String_Node_Str","String_Node_Str",Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ADD_TEXT + "String_Node_Str","String_Node_Str",Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON,moderatedInstructorEmail};
  RedirectResult result=getRedirectResult(getAction(submissionParams));
  assertFalse(result.isError);
  assertEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED,result.getStatusMessage());
  assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_EDIT_INSTRUCTOR_FEEDBACK_PAGE,false,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),result.getDestinationWithParams());
  FeedbackResponseCommentAttributes frc=getFeedbackParticipantComment(fr.getId());
  assertEquals("String_Node_Str",frc.commentText.getValue());
  assertEquals(FeedbackParticipantType.INSTRUCTORS,frc.commentGiverType);
  assertEquals("String_Node_Str",frc.commentGiver);
  assertTrue(frc.isCommentFromFeedbackParticipant);
  assertTrue(frc.isVisibilityFollowingFeedbackQuestion);
  ArrayList<InstructorAttributes> instructors=new ArrayList<>();
  instructors.add(instructor1InCourse1);
  FeedbackResponseCommentSearchResultBundle bundle=frcDb.search("String_Node_Str",instructors);
  assertEquals(1,bundle.numberOfResults);
  verifySearchResults(bundle,frc);
  ______TS("String_Node_Str");
  submissionParams=new String[]{Const.ParamsNames.FEEDBACK_QUESTION_RESPONSETOTAL + "String_Node_Str","String_Node_Str",Const.ParamsNames.FEEDBACK_RESPONSE_ID + "String_Node_Str",fr.getId(),Const.ParamsNames.FEEDBACK_SESSION_NAME,fr.feedbackSessionName,Const.ParamsNames.COURSE_ID,fr.courseId,Const.ParamsNames.FEEDBACK_QUESTION_ID + "String_Node_Str",fr.feedbackQuestionId,Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "String_Node_Str",fr.recipient,Const.ParamsNames.FEEDBACK_QUESTION_TYPE + "String_Node_Str",fr.feedbackQuestionType.toString(),Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "String_Node_Str","String_Node_Str",Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_TEXT + "String_Node_Str","String_Node_Str",Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ID + "String_Node_Str",frc.getId().toString(),Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON,moderatedInstructorEmail};
  result=getRedirectResult(getAction(submissionParams));
  assertFalse(result.isError);
  assertEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED,result.getStatusMessage());
  assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_EDIT_INSTRUCTOR_FEEDBACK_PAGE,false,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),result.getDestinationWithParams());
  frc=getFeedbackParticipantComment(fr.getId());
  assertEquals("String_Node_Str",frc.commentText.getValue());
  assertEquals(FeedbackParticipantType.INSTRUCTORS,frc.commentGiverType);
  assertEquals("String_Node_Str",frc.commentGiver);
  assertTrue(frc.isCommentFromFeedbackParticipant);
  assertTrue(frc.isVisibilityFollowingFeedbackQuestion);
  bundle=frcDb.search("String_Node_Str",instructors);
  assertEquals(1,bundle.numberOfResults);
  verifySearchResults(bundle,frc);
}