Program: 62872
Project: 62872
Buggy source:
private void createFeedbackResponsesFromSubmission(String feedbackSessionName,String courseId,boolean peerFeedback,List<String> fqIds,SubmissionAttributes sub){
  String giver=sub.reviewer;
  String recipient=sub.reviewee;
  String giverSection="String_Node_Str";
  String recipientSection="String_Node_Str";
  StudentAttributes studentGiver=logic.getStudentForEmail(courseId,giver);
  recipientSection=(studentGiver == null) ? Const.DEFAULT_SECTION : studentGiver.section;
  StudentAttributes studentRecipient=logic.getStudentForEmail(courseId,recipient);
  recipientSection=(studentRecipient == null) ? Const.DEFAULT_SECTION : studentRecipient.section;
  FeedbackResponseAttributes q1Response=null;
  FeedbackResponseAttributes q2Response=null;
  FeedbackResponseAttributes q3Response=null;
  FeedbackResponseAttributes q4Response=null;
  FeedbackResponseAttributes q5Response=null;
  if (sub.points != Const.POINTS_NOT_SUBMITTED) {
    q1Response=new FeedbackResponseAttributes();
    q1Response.setId(null);
    q1Response.feedbackSessionName=feedbackSessionName;
    q1Response.courseId=courseId;
    q1Response.giverEmail=giver;
    q1Response.giverSection=giverSection;
    q1Response.recipientEmail=recipient;
    q1Response.recipientSection=recipientSection;
    q1Response.feedbackQuestionType=FeedbackQuestionType.CONTRIB;
    q1Response.feedbackQuestionId=fqIds.get(0);
    FeedbackAbstractResponseDetails responseDetails1=new FeedbackContributionResponseDetails(sub.points);
    q1Response.setResponseDetails(responseDetails1);
  }
  if (giver.equals(recipient)) {
    q2Response=new FeedbackResponseAttributes();
    q2Response.setId(null);
    q2Response.feedbackSessionName=feedbackSessionName;
    q2Response.courseId=courseId;
    q2Response.giverEmail=giver;
    q2Response.giverSection=giverSection;
    q2Response.recipientEmail=recipient;
    q2Response.recipientSection=recipientSection;
    q2Response.feedbackQuestionType=FeedbackQuestionType.TEXT;
    q2Response.feedbackQuestionId=fqIds.get(1);
    FeedbackAbstractResponseDetails responseDetails2=new FeedbackTextResponseDetails(sub.justification.getValue());
    q2Response.setResponseDetails(responseDetails2);
  }
 else {
    q3Response=new FeedbackResponseAttributes();
    q3Response.setId(null);
    q3Response.feedbackSessionName=feedbackSessionName;
    q3Response.courseId=courseId;
    q3Response.giverEmail=giver;
    q3Response.giverSection=giverSection;
    q3Response.recipientEmail=recipient;
    q3Response.recipientSection=recipientSection;
    q3Response.feedbackQuestionType=FeedbackQuestionType.TEXT;
    q3Response.feedbackQuestionId=fqIds.get(2);
    FeedbackAbstractResponseDetails responseDetails3=new FeedbackTextResponseDetails(sub.justification.getValue());
    q3Response.setResponseDetails(responseDetails3);
  }
  if (peerFeedback) {
    if (giver.equals(recipient)) {
      q4Response=new FeedbackResponseAttributes();
      q4Response.setId(null);
      q4Response.feedbackSessionName=feedbackSessionName;
      q4Response.courseId=courseId;
      q4Response.giverEmail=giver;
      q4Response.giverSection=giverSection;
      q4Response.recipientEmail=recipient;
      q4Response.recipientSection=recipientSection;
      q4Response.feedbackQuestionType=FeedbackQuestionType.TEXT;
      q4Response.feedbackQuestionId=fqIds.get(3);
      FeedbackAbstractResponseDetails responseDetails4=new FeedbackTextResponseDetails(sub.p2pFeedback.getValue());
      q4Response.setResponseDetails(responseDetails4);
    }
 else {
      q5Response=new FeedbackResponseAttributes();
      q5Response.setId(null);
      q5Response.feedbackSessionName=feedbackSessionName;
      q5Response.courseId=courseId;
      q5Response.giverEmail=giver;
      q5Response.giverSection=giverSection;
      q5Response.recipientEmail=recipient;
      q5Response.recipientSection=recipientSection;
      q5Response.feedbackQuestionType=FeedbackQuestionType.TEXT;
      q5Response.feedbackQuestionId=fqIds.get(4);
      FeedbackAbstractResponseDetails responseDetails5=new FeedbackTextResponseDetails(sub.p2pFeedback.getValue());
      q5Response.setResponseDetails(responseDetails5);
    }
  }
  List<FeedbackResponseAttributes> allResponses=new ArrayList<FeedbackResponseAttributes>();
  allResponses.add(q1Response);
  allResponses.add(q2Response);
  allResponses.add(q3Response);
  allResponses.add(q4Response);
  allResponses.add(q5Response);
  for (  FeedbackResponseAttributes response : allResponses) {
    if (response != null) {
      if (!(response.responseMetaData.getValue().isEmpty() || response.recipientEmail.isEmpty())) {
        try {
          logic.createFeedbackResponse(response);
        }
 catch (        EntityAlreadyExistsException e) {
          System.out.println("String_Node_Str");
          e.printStackTrace();
        }
catch (        InvalidParametersException e) {
          System.out.println("String_Node_Str");
          e.printStackTrace();
        }
      }
    }
  }
}

Fixed version (ground truth):
private void createFeedbackResponsesFromSubmission(String feedbackSessionName,String courseId,boolean peerFeedback,List<String> fqIds,SubmissionAttributes sub){
  String giver=sub.reviewer;
  String recipient=sub.reviewee;
  String giverSection="String_Node_Str";
  String recipientSection="String_Node_Str";
  StudentAttributes studentGiver=logic.getStudentForEmail(courseId,giver);
  giverSection=(studentGiver == null) ? Const.DEFAULT_SECTION : studentGiver.section;
  StudentAttributes studentRecipient=logic.getStudentForEmail(courseId,recipient);
  recipientSection=(studentRecipient == null) ? Const.DEFAULT_SECTION : studentRecipient.section;
  FeedbackResponseAttributes q1Response=null;
  FeedbackResponseAttributes q2Response=null;
  FeedbackResponseAttributes q3Response=null;
  FeedbackResponseAttributes q4Response=null;
  FeedbackResponseAttributes q5Response=null;
  if (sub.points != Const.POINTS_NOT_SUBMITTED) {
    q1Response=new FeedbackResponseAttributes();
    q1Response.setId(null);
    q1Response.feedbackSessionName=feedbackSessionName;
    q1Response.courseId=courseId;
    q1Response.giverEmail=giver;
    q1Response.giverSection=giverSection;
    q1Response.recipientEmail=recipient;
    q1Response.recipientSection=recipientSection;
    q1Response.feedbackQuestionType=FeedbackQuestionType.CONTRIB;
    q1Response.feedbackQuestionId=fqIds.get(0);
    FeedbackAbstractResponseDetails responseDetails1=new FeedbackContributionResponseDetails(sub.points);
    q1Response.setResponseDetails(responseDetails1);
  }
  if (giver.equals(recipient)) {
    q2Response=new FeedbackResponseAttributes();
    q2Response.setId(null);
    q2Response.feedbackSessionName=feedbackSessionName;
    q2Response.courseId=courseId;
    q2Response.giverEmail=giver;
    q2Response.giverSection=giverSection;
    q2Response.recipientEmail=recipient;
    q2Response.recipientSection=recipientSection;
    q2Response.feedbackQuestionType=FeedbackQuestionType.TEXT;
    q2Response.feedbackQuestionId=fqIds.get(1);
    FeedbackAbstractResponseDetails responseDetails2=new FeedbackTextResponseDetails(sub.justification.getValue());
    q2Response.setResponseDetails(responseDetails2);
  }
 else {
    q3Response=new FeedbackResponseAttributes();
    q3Response.setId(null);
    q3Response.feedbackSessionName=feedbackSessionName;
    q3Response.courseId=courseId;
    q3Response.giverEmail=giver;
    q3Response.giverSection=giverSection;
    q3Response.recipientEmail=recipient;
    q3Response.recipientSection=recipientSection;
    q3Response.feedbackQuestionType=FeedbackQuestionType.TEXT;
    q3Response.feedbackQuestionId=fqIds.get(2);
    FeedbackAbstractResponseDetails responseDetails3=new FeedbackTextResponseDetails(sub.justification.getValue());
    q3Response.setResponseDetails(responseDetails3);
  }
  if (peerFeedback) {
    if (giver.equals(recipient)) {
      q4Response=new FeedbackResponseAttributes();
      q4Response.setId(null);
      q4Response.feedbackSessionName=feedbackSessionName;
      q4Response.courseId=courseId;
      q4Response.giverEmail=giver;
      q4Response.giverSection=giverSection;
      q4Response.recipientEmail=recipient;
      q4Response.recipientSection=recipientSection;
      q4Response.feedbackQuestionType=FeedbackQuestionType.TEXT;
      q4Response.feedbackQuestionId=fqIds.get(3);
      FeedbackAbstractResponseDetails responseDetails4=new FeedbackTextResponseDetails(sub.p2pFeedback.getValue());
      q4Response.setResponseDetails(responseDetails4);
    }
 else {
      q5Response=new FeedbackResponseAttributes();
      q5Response.setId(null);
      q5Response.feedbackSessionName=feedbackSessionName;
      q5Response.courseId=courseId;
      q5Response.giverEmail=giver;
      q5Response.giverSection=giverSection;
      q5Response.recipientEmail=recipient;
      q5Response.recipientSection=recipientSection;
      q5Response.feedbackQuestionType=FeedbackQuestionType.TEXT;
      q5Response.feedbackQuestionId=fqIds.get(4);
      FeedbackAbstractResponseDetails responseDetails5=new FeedbackTextResponseDetails(sub.p2pFeedback.getValue());
      q5Response.setResponseDetails(responseDetails5);
    }
  }
  List<FeedbackResponseAttributes> allResponses=new ArrayList<FeedbackResponseAttributes>();
  allResponses.add(q1Response);
  allResponses.add(q2Response);
  allResponses.add(q3Response);
  allResponses.add(q4Response);
  allResponses.add(q5Response);
  for (  FeedbackResponseAttributes response : allResponses) {
    if (response != null) {
      if (!(response.responseMetaData.getValue().isEmpty() || response.recipientEmail.isEmpty())) {
        try {
          logic.createFeedbackResponse(response);
        }
 catch (        EntityAlreadyExistsException e) {
          System.out.println("String_Node_Str");
          e.printStackTrace();
        }
catch (        InvalidParametersException e) {
          System.out.println("String_Node_Str");
          e.printStackTrace();
        }
      }
    }
  }
}