Program: 62828
Project: 62828
Buggy source:
protected void convertOneEvaluationToFeedbackSession(EvaluationAttributes eval,String newFeedbackSessionName) throws Exception {
  if (newFeedbackSessionName == null || newFeedbackSessionName.isEmpty()) {
    newFeedbackSessionName="String_Node_Str" + eval.name;
  }
  int num=0;
  String feedbackSessionName=newFeedbackSessionName + (num == 0 ? "String_Node_Str" : ("String_Node_Str" + num + "String_Node_Str"));
  String courseId=eval.courseId;
  List<InstructorAttributes> instructorsForCourse=logic.getInstructorsForCourse(courseId);
  if (instructorsForCourse.size() == 0) {
    printErrorMessage("String_Node_Str" + courseId);
    return;
  }
  String instEmail=instructorsForCourse.get(0).email;
  System.out.print("String_Node_Str" + eval.courseId + "String_Node_Str"+ eval.name+ "String_Node_Str");
  String creatorEmail=instEmail;
  Text instructions=eval.instructions;
  Date createdTime=(new Date()).compareTo(eval.startTime) > 0 ? new Date() : eval.startTime;
  Date startTime=eval.startTime;
  Date endTime=eval.endTime;
  Date sessionVisibleFromTime=eval.startTime;
  Date resultsVisibleFromTime=eval.endTime;
  double timeZone=eval.timeZone;
  int gracePeriod=eval.gracePeriod;
  FeedbackSessionType feedbackSessionType=FeedbackSessionType.STANDARD;
  boolean sentOpenEmail=(new Date()).compareTo(eval.startTime) > 0;
  boolean sentPublishedEmail=eval.published;
  boolean isOpeningEmailEnabled=true;
  boolean isClosingEmailEnabled=true;
  boolean isPublishedEmailEnabled=true;
  while (true) {
    feedbackSessionName=newFeedbackSessionName + (num == 0 ? "String_Node_Str" : ("String_Node_Str" + num + "String_Node_Str"));
    if (logic.getFeedbackSession(feedbackSessionName,courseId) != null) {
      printErrorMessage(String.format("String_Node_Str",feedbackSessionName));
    }
    if (isPreview) {
      return;
    }
    FeedbackSessionAttributes fsa=new FeedbackSessionAttributes(feedbackSessionName,courseId,creatorEmail,instructions,createdTime,startTime,endTime,sessionVisibleFromTime,resultsVisibleFromTime,timeZone,gracePeriod,feedbackSessionType,sentOpenEmail,sentPublishedEmail,isOpeningEmailEnabled,isClosingEmailEnabled,isPublishedEmailEnabled);
    try {
      fsDb.createEntity(fsa);
      break;
    }
 catch (    EntityAlreadyExistsException e) {
      printErrorMessage(String.format("String_Node_Str",feedbackSessionName));
      e.printStackTrace();
    }
    num++;
  }
  boolean peerFeedback=eval.p2pEnabled;
  List<String> fqIds=createFeedbackQuestions(eval,feedbackSessionName,courseId,creatorEmail,peerFeedback);
  List<SubmissionAttributes> allSubmissions=subDb.getSubmissionsForEvaluation(courseId,eval.name);
  for (  SubmissionAttributes sub : allSubmissions) {
    createFeedbackResponsesFromSubmission(feedbackSessionName,courseId,peerFeedback,fqIds,sub);
  }
}

Fixed version (ground truth):
protected void convertOneEvaluationToFeedbackSession(EvaluationAttributes eval,String newFeedbackSessionName) throws Exception {
  if (newFeedbackSessionName == null || newFeedbackSessionName.isEmpty()) {
    newFeedbackSessionName="String_Node_Str" + eval.name;
  }
  int num=0;
  String feedbackSessionName=newFeedbackSessionName + (num == 0 ? "String_Node_Str" : ("String_Node_Str" + num + "String_Node_Str"));
  String courseId=eval.courseId;
  List<InstructorAttributes> instructorsForCourse=logic.getInstructorsForCourse(courseId);
  if (instructorsForCourse.size() == 0) {
    printErrorMessage("String_Node_Str" + courseId);
    return;
  }
  String instEmail=instructorsForCourse.get(0).email;
  System.out.print("String_Node_Str" + eval.courseId + "String_Node_Str"+ eval.name+ "String_Node_Str");
  String creatorEmail=instEmail;
  Text instructions=eval.instructions;
  Date createdTime=(new Date()).compareTo(eval.startTime) > 0 ? new Date() : eval.startTime;
  Date startTime=eval.startTime;
  Date endTime=eval.endTime;
  Date sessionVisibleFromTime=eval.startTime;
  Date resultsVisibleFromTime=eval.published ? eval.endTime : Const.TIME_REPRESENTS_LATER;
  double timeZone=eval.timeZone;
  int gracePeriod=eval.gracePeriod;
  FeedbackSessionType feedbackSessionType=FeedbackSessionType.STANDARD;
  boolean sentOpenEmail=(new Date()).compareTo(eval.startTime) > 0;
  boolean sentPublishedEmail=eval.published;
  boolean isOpeningEmailEnabled=true;
  boolean isClosingEmailEnabled=true;
  boolean isPublishedEmailEnabled=true;
  while (true) {
    feedbackSessionName=newFeedbackSessionName + (num == 0 ? "String_Node_Str" : ("String_Node_Str" + num + "String_Node_Str"));
    if (logic.getFeedbackSession(feedbackSessionName,courseId) != null) {
      printErrorMessage(String.format("String_Node_Str",feedbackSessionName));
    }
    if (isPreview) {
      return;
    }
    FeedbackSessionAttributes fsa=new FeedbackSessionAttributes(feedbackSessionName,courseId,creatorEmail,instructions,createdTime,startTime,endTime,sessionVisibleFromTime,resultsVisibleFromTime,timeZone,gracePeriod,feedbackSessionType,sentOpenEmail,sentPublishedEmail,isOpeningEmailEnabled,isClosingEmailEnabled,isPublishedEmailEnabled);
    try {
      fsDb.createEntity(fsa);
      break;
    }
 catch (    EntityAlreadyExistsException e) {
      printErrorMessage(String.format("String_Node_Str",feedbackSessionName));
      e.printStackTrace();
    }
    num++;
  }
  boolean peerFeedback=eval.p2pEnabled;
  List<String> fqIds=createFeedbackQuestions(eval,feedbackSessionName,courseId,creatorEmail,peerFeedback);
  List<SubmissionAttributes> allSubmissions=subDb.getSubmissionsForEvaluation(courseId,eval.name);
  for (  SubmissionAttributes sub : allSubmissions) {
    createFeedbackResponsesFromSubmission(feedbackSessionName,courseId,peerFeedback,fqIds,sub);
  }
}