Program: 62866
Project: 62866
Buggy source:
@Override protected ActionResult execute() throws EntityDoesNotExistException {
  String courseId=getRequestParamValue(Const.ParamsNames.COURSE_ID);
  Assumption.assertNotNull("String_Node_Str",courseId);
  String feedbackSessionName=getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME);
  Assumption.assertNotNull("String_Node_Str",feedbackSessionName);
  String feedbackQuestionId=getRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID);
  Assumption.assertNotNull("String_Node_Str",feedbackQuestionId);
  String feedbackResponseId=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID);
  Assumption.assertNotNull("String_Node_Str",feedbackResponseId);
  InstructorAttributes instructor=logic.getInstructorForGoogleId(courseId,account.googleId);
  FeedbackSessionAttributes session=logic.getFeedbackSession(feedbackSessionName,courseId);
  FeedbackResponseAttributes response=logic.getFeedbackResponse(feedbackResponseId);
  Assumption.assertNotNull(response);
  boolean isCreatorOnly=true;
  new GateKeeper().verifyAccessible(instructor,session,!isCreatorOnly,response.giverSection,feedbackSessionName,Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS);
  new GateKeeper().verifyAccessible(instructor,session,!isCreatorOnly,response.recipientSection,feedbackSessionName,Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS);
  InstructorFeedbackResponseCommentAjaxPageData data=new InstructorFeedbackResponseCommentAjaxPageData(account);
  String commentText=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_TEXT);
  Assumption.assertNotNull("String_Node_Str",commentText);
  if (commentText.trim().isEmpty()) {
    data.errorMessage=Const.StatusMessages.FEEDBACK_RESPONSE_COMMENT_EMPTY;
    data.isError=true;
    return createAjaxResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_RECIPIENT_GIVER_QUESTION,data);
  }
  FeedbackResponseCommentAttributes feedbackResponseComment=new FeedbackResponseCommentAttributes(courseId,feedbackSessionName,feedbackQuestionId,instructor.email,feedbackResponseId,new Date(),new Text(commentText),response.giverSection,response.recipientSection);
  String showCommentTo=getRequestParamValue(Const.ParamsNames.RESPONSE_COMMENTS_SHOWCOMMENTSTO);
  String showGiverNameTo=getRequestParamValue(Const.ParamsNames.RESPONSE_COMMENTS_SHOWGIVERTO);
  feedbackResponseComment.showCommentTo=new ArrayList<FeedbackParticipantType>();
  if (showCommentTo != null && !showCommentTo.isEmpty()) {
    String[] showCommentToArray=showCommentTo.split("String_Node_Str");
    for (    String viewer : showCommentToArray) {
      feedbackResponseComment.showCommentTo.add(FeedbackParticipantType.valueOf(viewer.trim()));
    }
  }
  feedbackResponseComment.showGiverNameTo=new ArrayList<FeedbackParticipantType>();
  if (showGiverNameTo != null && !showGiverNameTo.isEmpty()) {
    String[] showGiverNameToArray=showGiverNameTo.split("String_Node_Str");
    for (    String viewer : showGiverNameToArray) {
      feedbackResponseComment.showGiverNameTo.add(FeedbackParticipantType.valueOf(viewer.trim()));
    }
  }
  if (isResponseCommentPublicToRecipient(feedbackResponseComment)) {
    feedbackResponseComment.sendingState=CommentSendingState.PENDING;
  }
  FeedbackResponseCommentAttributes createdComment=new FeedbackResponseCommentAttributes();
  try {
    createdComment=logic.createFeedbackResponseComment(feedbackResponseComment);
    logic.putDocument(createdComment);
  }
 catch (  InvalidParametersException e) {
    setStatusForException(e);
    data.errorMessage=e.getMessage();
    data.isError=true;
  }
  if (!data.isError) {
    statusToAdmin+="String_Node_Str" + "String_Node_Str" + feedbackResponseComment.feedbackResponseId + "String_Node_Str"+ "String_Node_Str"+ feedbackResponseComment.courseId+ "String_Node_Str"+ feedbackResponseComment.feedbackSessionName+ "String_Node_Str"+ "String_Node_Str"+ feedbackResponseComment.giverEmail+ "String_Node_Str"+ feedbackResponseComment.createdAt+ "String_Node_Str"+ "String_Node_Str"+ feedbackResponseComment.commentText.getValue();
  }
  data.comment=createdComment;
  return createAjaxResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_RECIPIENT_GIVER_QUESTION,data);
}

Fixed version (ground truth):
@Override protected ActionResult execute() throws EntityDoesNotExistException {
  String courseId=getRequestParamValue(Const.ParamsNames.COURSE_ID);
  Assumption.assertNotNull("String_Node_Str",courseId);
  String feedbackSessionName=getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME);
  Assumption.assertNotNull("String_Node_Str",feedbackSessionName);
  String feedbackQuestionId=getRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID);
  Assumption.assertNotNull("String_Node_Str",feedbackQuestionId);
  String feedbackResponseId=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID);
  Assumption.assertNotNull("String_Node_Str",feedbackResponseId);
  InstructorAttributes instructor=logic.getInstructorForGoogleId(courseId,account.googleId);
  FeedbackSessionAttributes session=logic.getFeedbackSession(feedbackSessionName,courseId);
  FeedbackResponseAttributes response=logic.getFeedbackResponse(feedbackResponseId);
  Assumption.assertNotNull(response);
  boolean isCreatorOnly=true;
  new GateKeeper().verifyAccessible(instructor,session,!isCreatorOnly,response.giverSection,feedbackSessionName,Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS);
  new GateKeeper().verifyAccessible(instructor,session,!isCreatorOnly,response.recipientSection,feedbackSessionName,Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS);
  InstructorFeedbackResponseCommentAjaxPageData data=new InstructorFeedbackResponseCommentAjaxPageData(account);
  String commentText=getRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_TEXT);
  Assumption.assertNotNull("String_Node_Str",commentText);
  if (commentText.trim().isEmpty()) {
    data.errorMessage=Const.StatusMessages.FEEDBACK_RESPONSE_COMMENT_EMPTY;
    data.isError=true;
    return createAjaxResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_RECIPIENT_GIVER_QUESTION,data);
  }
  FeedbackResponseCommentAttributes feedbackResponseComment=new FeedbackResponseCommentAttributes(courseId,feedbackSessionName,feedbackQuestionId,instructor.email,feedbackResponseId,new Date(),new Text(commentText),response.giverSection,response.recipientSection);
  String showCommentTo=getRequestParamValue(Const.ParamsNames.RESPONSE_COMMENTS_SHOWCOMMENTSTO);
  String showGiverNameTo=getRequestParamValue(Const.ParamsNames.RESPONSE_COMMENTS_SHOWGIVERTO);
  feedbackResponseComment.showCommentTo=new ArrayList<FeedbackParticipantType>();
  if (showCommentTo != null && !showCommentTo.isEmpty()) {
    String[] showCommentToArray=showCommentTo.split("String_Node_Str");
    for (    String viewer : showCommentToArray) {
      feedbackResponseComment.showCommentTo.add(FeedbackParticipantType.valueOf(viewer.trim()));
    }
  }
  feedbackResponseComment.showGiverNameTo=new ArrayList<FeedbackParticipantType>();
  if (showGiverNameTo != null && !showGiverNameTo.isEmpty()) {
    String[] showGiverNameToArray=showGiverNameTo.split("String_Node_Str");
    for (    String viewer : showGiverNameToArray) {
      feedbackResponseComment.showGiverNameTo.add(FeedbackParticipantType.valueOf(viewer.trim()));
    }
  }
  if (isResponseCommentPublicToRecipient(feedbackResponseComment) && session.isPublished()) {
    feedbackResponseComment.sendingState=CommentSendingState.PENDING;
  }
  FeedbackResponseCommentAttributes createdComment=new FeedbackResponseCommentAttributes();
  try {
    createdComment=logic.createFeedbackResponseComment(feedbackResponseComment);
    logic.putDocument(createdComment);
  }
 catch (  InvalidParametersException e) {
    setStatusForException(e);
    data.errorMessage=e.getMessage();
    data.isError=true;
  }
  if (!data.isError) {
    statusToAdmin+="String_Node_Str" + "String_Node_Str" + feedbackResponseComment.feedbackResponseId + "String_Node_Str"+ "String_Node_Str"+ feedbackResponseComment.courseId+ "String_Node_Str"+ feedbackResponseComment.feedbackSessionName+ "String_Node_Str"+ "String_Node_Str"+ feedbackResponseComment.giverEmail+ "String_Node_Str"+ feedbackResponseComment.createdAt+ "String_Node_Str"+ "String_Node_Str"+ feedbackResponseComment.commentText.getValue();
  }
  data.comment=createdComment;
  return createAjaxResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESULTS_BY_RECIPIENT_GIVER_QUESTION,data);
}