nus-yam/ex-repair huggingface dataset:
Program: 62874
Project: 62874
Buggy source:
@Override public ActionResult execute() throws EntityDoesNotExistException {
  new GateKeeper().verifyInstructorPrivileges(account);
  String searchKey=getRequestParamValue(Const.ParamsNames.SEARCH_KEY);
  Boolean displayArchive=getRequestParamAsBoolean(Const.ParamsNames.DISPLAY_ARCHIVE);
  data=new InstructorStudentListPageData(account);
  data.instructors=new HashMap<String,InstructorAttributes>();
  HashMap<String,CourseDetailsBundle> courses=logic.getCourseDetailsListForInstructor(account.googleId);
  for (  CourseDetailsBundle courseDetails : courses.values()) {
    InstructorAttributes instructor=logic.getInstructorForGoogleId(courseDetails.course.id,account.googleId);
    data.instructors.put(courseDetails.course.id,instructor);
  }
  data.courses=new ArrayList<CourseDetailsBundle>(courses.values());
  CourseDetailsBundle.sortDetailedCoursesByCreationDate(data.courses);
  data.searchKey=searchKey;
  data.displayArchive=displayArchive;
  if (data.courses.size() == 0) {
    statusToUser.add(Const.StatusMessages.INSTRUCTOR_NO_COURSE_AND_STUDENTS);
  }
  statusToAdmin="String_Node_Str" + "String_Node_Str" + data.courses.size();
  ShowPageResult response=createShowPageResult(Const.ViewURIs.INSTRUCTOR_STUDENT_LIST,data);
  return response;
}

Fixed version (ground truth):
@Override public ActionResult execute() throws EntityDoesNotExistException {
  new GateKeeper().verifyInstructorPrivileges(account);
  String searchKey=getRequestParamValue(Const.ParamsNames.SEARCH_KEY);
  Boolean displayArchive=getRequestParamAsBoolean(Const.ParamsNames.DISPLAY_ARCHIVE);
  data=new InstructorStudentListPageData(account);
  data.instructors=new HashMap<String,InstructorAttributes>();
  HashMap<String,CourseDetailsBundle> courses=logic.getCourseSummariesForInstructor(account.googleId);
  for (  CourseDetailsBundle courseDetails : courses.values()) {
    InstructorAttributes instructor=logic.getInstructorForGoogleId(courseDetails.course.id,account.googleId);
    data.instructors.put(courseDetails.course.id,instructor);
  }
  data.courses=new ArrayList<CourseDetailsBundle>(courses.values());
  CourseDetailsBundle.sortDetailedCoursesByCreationDate(data.courses);
  data.searchKey=searchKey;
  data.displayArchive=displayArchive;
  if (data.courses.size() == 0) {
    statusToUser.add(Const.StatusMessages.INSTRUCTOR_NO_COURSE_AND_STUDENTS);
  }
  statusToAdmin="String_Node_Str" + "String_Node_Str" + data.courses.size();
  ShowPageResult response=createShowPageResult(Const.ViewURIs.INSTRUCTOR_STUDENT_LIST,data);
  return response;
}
Program: 62878
Project: 62878
Buggy source:
@Override public String getQuestionResultStatisticsHtml(List<FeedbackResponseAttributes> responses,FeedbackSessionResultsBundle bundle){
  if (responses.size() == 0) {
    return "String_Node_Str";
  }
  String html="String_Node_Str";
  String fragments="String_Node_Str";
  Map<String,Integer> answerFrequency=new LinkedHashMap<String,Integer>();
  for (  String option : msqChoices) {
    answerFrequency.put(option,0);
  }
  int numChoicesSelected=0;
  for (  FeedbackResponseAttributes response : responses) {
    List<String> answerStrings=((FeedbackMsqResponseDetails)response.getResponseDetails()).getAnswerStrings();
    for (    String answerString : answerStrings) {
      numChoicesSelected++;
      if (!answerFrequency.containsKey(answerString)) {
        answerFrequency.put(answerString,1);
      }
 else {
        answerFrequency.put(answerString,answerFrequency.get(answerString) + 1);
      }
    }
  }
  DecimalFormat df=new DecimalFormat("String_Node_Str");
  for (  Entry<String,Integer> entry : answerFrequency.entrySet()) {
    fragments+=FeedbackQuestionFormTemplates.populateTemplate(FeedbackQuestionFormTemplates.MCQ_RESULT_STATS_OPTIONFRAGMENT,"String_Node_Str",entry.getKey(),"String_Node_Str",entry.getValue().toString(),"String_Node_Str",df.format(100 * (double)entry.getValue() / numChoicesSelected));
  }
  html=FeedbackQuestionFormTemplates.populateTemplate(FeedbackQuestionFormTemplates.MCQ_RESULT_STATS,"String_Node_Str",fragments);
  return html;
}

Fixed version (ground truth):
@Override public String getQuestionResultStatisticsHtml(List<FeedbackResponseAttributes> responses,FeedbackQuestionAttributes question,FeedbackSessionResultsBundle bundle){
  if (responses.size() == 0) {
    return "String_Node_Str";
  }
  String html="String_Node_Str";
  String fragments="String_Node_Str";
  Map<String,Integer> answerFrequency=new LinkedHashMap<String,Integer>();
  for (  String option : msqChoices) {
    answerFrequency.put(option,0);
  }
  int numChoicesSelected=0;
  for (  FeedbackResponseAttributes response : responses) {
    List<String> answerStrings=((FeedbackMsqResponseDetails)response.getResponseDetails()).getAnswerStrings();
    for (    String answerString : answerStrings) {
      numChoicesSelected++;
      if (!answerFrequency.containsKey(answerString)) {
        answerFrequency.put(answerString,1);
      }
 else {
        answerFrequency.put(answerString,answerFrequency.get(answerString) + 1);
      }
    }
  }
  DecimalFormat df=new DecimalFormat("String_Node_Str");
  for (  Entry<String,Integer> entry : answerFrequency.entrySet()) {
    fragments+=FeedbackQuestionFormTemplates.populateTemplate(FeedbackQuestionFormTemplates.MCQ_RESULT_STATS_OPTIONFRAGMENT,"String_Node_Str",entry.getKey(),"String_Node_Str",entry.getValue().toString(),"String_Node_Str",df.format(100 * (double)entry.getValue() / numChoicesSelected));
  }
  html=FeedbackQuestionFormTemplates.populateTemplate(FeedbackQuestionFormTemplates.MCQ_RESULT_STATS,"String_Node_Str",fragments);
  return html;
}
Program: 62880
Project: 62880
Buggy source:
@Override protected ActionResult execute() throws EntityDoesNotExistException {
  String courseId=getRequestParamValue(Const.ParamsNames.COURSE_ID);
  String feedbackSessionName=getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME);
  Assumption.assertNotNull(courseId);
  Assumption.assertNotNull(feedbackSessionName);
  new GateKeeper().verifyAccessible(logic.getInstructorForGoogleId(courseId,account.googleId),logic.getFeedbackSession(feedbackSessionName,courseId),true);
  String editType=getRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE);
  Assumption.assertNotNull("String_Node_Str",editType);
  FeedbackQuestionAttributes updatedQuestion=extractFeedbackQuestionData(requestParameters);
  try {
    if (editType.equals("String_Node_Str")) {
      editQuestion(updatedQuestion);
    }
 else     if (editType.equals("String_Node_Str")) {
      deleteQuestion(updatedQuestion);
    }
 else {
      Assumption.fail("String_Node_Str");
    }
  }
 catch (  InvalidParametersException e) {
    setStatusForException(e);
  }
  return createRedirectResult(new PageData(account).getInstructorFeedbackSessionEditLink(courseId,feedbackSessionName));
}

Fixed version (ground truth):
@Override protected ActionResult execute() throws EntityDoesNotExistException {
  String courseId=getRequestParamValue(Const.ParamsNames.COURSE_ID);
  String feedbackSessionName=getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME);
  Assumption.assertNotNull(courseId);
  Assumption.assertNotNull(feedbackSessionName);
  new GateKeeper().verifyAccessible(logic.getInstructorForGoogleId(courseId,account.googleId),logic.getFeedbackSession(feedbackSessionName,courseId),false,Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION);
  String editType=getRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE);
  Assumption.assertNotNull("String_Node_Str",editType);
  FeedbackQuestionAttributes updatedQuestion=extractFeedbackQuestionData(requestParameters);
  try {
    if (editType.equals("String_Node_Str")) {
      editQuestion(updatedQuestion);
    }
 else     if (editType.equals("String_Node_Str")) {
      deleteQuestion(updatedQuestion);
    }
 else {
      Assumption.fail("String_Node_Str");
    }
  }
 catch (  InvalidParametersException e) {
    setStatusForException(e);
  }
  return createRedirectResult(new PageData(account).getInstructorFeedbackSessionEditLink(courseId,feedbackSessionName));
}
Program: 62881
Project: 62881
Buggy source:
@Test public void testAccessControl() throws Exception {
  FeedbackSessionAttributes fs=dataBundle.feedbackSessions.get("String_Node_Str");
  String[] submissionParams=createParamsForTypicalFeedbackQuestion(fs.courseId,fs.feedbackSessionName);
  verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams);
}

Fixed version (ground truth):
@Test public void testAccessControl() throws Exception {
  FeedbackSessionAttributes fs=dataBundle.feedbackSessions.get("String_Node_Str");
  String[] submissionParams=createParamsForTypicalFeedbackQuestion(fs.courseId,fs.feedbackSessionName);
  verifyUnaccessibleWithoutModifySessionPrivilege(submissionParams);
  verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams);
}
Program: 62883
Project: 62883
Buggy source:
@Override public ActionResult execute(){
  String courseId=getRequestParamValue(Const.ParamsNames.COURSE_ID);
  Assumption.assertNotNull(courseId);
  new GateKeeper().verifyAccessible(logic.getInstructorForGoogleId(courseId,account.googleId),logic.getCourse(courseId));
  InstructorCourseEnrollPageData pageData=new InstructorCourseEnrollPageData(account);
  pageData.courseId=courseId;
  statusToAdmin="String_Node_Str" + "String_Node_Str" + courseId + "String_Node_Str";
  ShowPageResult response=createShowPageResult(Const.ViewURIs.INSTRUCTOR_COURSE_ENROLL,pageData);
  return response;
}

Fixed version (ground truth):
@Override public ActionResult execute(){
  String courseId=getRequestParamValue(Const.ParamsNames.COURSE_ID);
  String studentsInfo=getRequestParamValue(Const.ParamsNames.STUDENTS_ENROLLMENT_INFO);
  Assumption.assertNotNull(courseId);
  new GateKeeper().verifyAccessible(logic.getInstructorForGoogleId(courseId,account.googleId),logic.getCourse(courseId));
  InstructorCourseEnrollPageData pageData=new InstructorCourseEnrollPageData(account);
  pageData.courseId=courseId;
  pageData.enrollStudents=studentsInfo;
  statusToAdmin="String_Node_Str" + "String_Node_Str" + courseId + "String_Node_Str";
  ShowPageResult response=createShowPageResult(Const.ViewURIs.INSTRUCTOR_COURSE_ENROLL,pageData);
  return response;
}
Program: 62884
Project: 62884
Buggy source:
@Override public ActionResult execute() throws EntityDoesNotExistException {
  String courseId=getRequestParamValue(Const.ParamsNames.COURSE_ID);
  Assumption.assertNotNull(courseId);
  String studentsInfo=getRequestParamValue(Const.ParamsNames.STUDENTS_ENROLLMENT_INFO);
  Assumption.assertPostParamNotNull(Const.ParamsNames.STUDENTS_ENROLLMENT_INFO,studentsInfo);
  new GateKeeper().verifyAccessible(logic.getInstructorForGoogleId(courseId,account.googleId),logic.getCourse(courseId));
  try {
    InstructorCourseEnrollResultPageData pageData=new InstructorCourseEnrollResultPageData(account);
    pageData.courseId=courseId;
    pageData.students=enrollAndProcessResultForDisplay(studentsInfo,courseId);
    pageData.hasSection=hasSections(pageData.students);
    statusToAdmin="String_Node_Str" + courseId + "String_Node_Str"+ (studentsInfo).replace("String_Node_Str","String_Node_Str");
    return createShowPageResult(Const.ViewURIs.INSTRUCTOR_COURSE_ENROLL_RESULT,pageData);
  }
 catch (  EnrollException|InvalidParametersException e) {
    setStatusForException(e);
    statusToAdmin+="String_Node_Str" + (studentsInfo).replace("String_Node_Str","String_Node_Str");
    InstructorCourseEnrollPageData pageData=new InstructorCourseEnrollPageData(account);
    pageData.courseId=courseId;
    pageData.enrollStudents=studentsInfo;
    return createShowPageResult(Const.ViewURIs.INSTRUCTOR_COURSE_ENROLL,pageData);
  }
}

Fixed version (ground truth):
@Override public ActionResult execute() throws EntityDoesNotExistException {
  String courseId=getRequestParamValue(Const.ParamsNames.COURSE_ID);
  Assumption.assertNotNull(courseId);
  String studentsInfo=getRequestParamValue(Const.ParamsNames.STUDENTS_ENROLLMENT_INFO);
  Assumption.assertPostParamNotNull(Const.ParamsNames.STUDENTS_ENROLLMENT_INFO,studentsInfo);
  new GateKeeper().verifyAccessible(logic.getInstructorForGoogleId(courseId,account.googleId),logic.getCourse(courseId));
  try {
    InstructorCourseEnrollResultPageData pageData=new InstructorCourseEnrollResultPageData(account);
    pageData.courseId=courseId;
    pageData.students=enrollAndProcessResultForDisplay(studentsInfo,courseId);
    pageData.hasSection=hasSections(pageData.students);
    pageData.enrollStudents=studentsInfo;
    statusToAdmin="String_Node_Str" + courseId + "String_Node_Str"+ (studentsInfo).replace("String_Node_Str","String_Node_Str");
    return createShowPageResult(Const.ViewURIs.INSTRUCTOR_COURSE_ENROLL_RESULT,pageData);
  }
 catch (  EnrollException|InvalidParametersException e) {
    setStatusForException(e);
    statusToAdmin+="String_Node_Str" + (studentsInfo).replace("String_Node_Str","String_Node_Str");
    InstructorCourseEnrollPageData pageData=new InstructorCourseEnrollPageData(account);
    pageData.courseId=courseId;
    pageData.enrollStudents=studentsInfo;
    return createShowPageResult(Const.ViewURIs.INSTRUCTOR_COURSE_ENROLL,pageData);
  }
}
Program: 62885
Project: 62885
Buggy source:
private boolean hasSections(List<StudentAttributes>[] students){
  for (  List<StudentAttributes> studentList : students) {
    for (    StudentAttributes student : studentList) {
      if (!student.section.equals("String_Node_Str")) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean hasSections(List<StudentAttributes>[] students){
  for (  List<StudentAttributes> studentList : students) {
    for (    StudentAttributes student : studentList) {
      if (!student.section.equals(Const.DEFAULT_SECTION)) {
        return true;
      }
    }
  }
  return false;
}
Program: 62886
Project: 62886
Buggy source:
@Override public void sanitizeForSaving(){
  this.googleId=Sanitizer.sanitizeGoogleId(this.googleId);
  this.email=Sanitizer.sanitizeEmail(this.email);
  this.course=Sanitizer.sanitizeTitle(this.course);
  this.name=Sanitizer.sanitizeName(this.name);
  this.team=Sanitizer.sanitizeTitle(this.team);
  this.comments=Sanitizer.sanitizeTextField(this.comments);
  this.googleId=Sanitizer.sanitizeForHtml(this.googleId);
  this.email=Sanitizer.sanitizeForHtml(this.email);
  this.course=Sanitizer.sanitizeForHtml(this.course);
  this.name=Sanitizer.sanitizeForHtml(this.name);
  this.team=Sanitizer.sanitizeForHtml(this.team);
  this.comments=Sanitizer.sanitizeForHtml(this.comments);
}

Fixed version (ground truth):
@Override public void sanitizeForSaving(){
  this.googleId=Sanitizer.sanitizeGoogleId(this.googleId);
  this.email=Sanitizer.sanitizeEmail(this.email);
  this.course=Sanitizer.sanitizeTitle(this.course);
  this.name=Sanitizer.sanitizeName(this.name);
  this.team=Sanitizer.sanitizeTitle(this.team);
  this.section=Sanitizer.sanitizeTitle(this.section);
  this.comments=Sanitizer.sanitizeTextField(this.comments);
  this.googleId=Sanitizer.sanitizeForHtml(this.googleId);
  this.email=Sanitizer.sanitizeForHtml(this.email);
  this.course=Sanitizer.sanitizeForHtml(this.course);
  this.name=Sanitizer.sanitizeForHtml(this.name);
  this.team=Sanitizer.sanitizeForHtml(this.team);
  this.section=Sanitizer.sanitizeForHtml(this.section);
  this.comments=Sanitizer.sanitizeForHtml(this.comments);
}
Program: 62887
Project: 62887
Buggy source:
public boolean isEnrollInfoSameAs(StudentAttributes otherStudent){
  return (otherStudent != null) && otherStudent.email.equals(this.email) && otherStudent.course.equals(this.course)&& otherStudent.name.equals(this.name)&& otherStudent.comments.equals(this.comments)&& otherStudent.team.equals(this.team);
}

Fixed version (ground truth):
public boolean isEnrollInfoSameAs(StudentAttributes otherStudent){
  return (otherStudent != null) && otherStudent.email.equals(this.email) && otherStudent.course.equals(this.course)&& otherStudent.name.equals(this.name)&& otherStudent.comments.equals(this.comments)&& otherStudent.team.equals(this.team)&& otherStudent.section.equals(this.section);
}
Program: 62888
Project: 62888
Buggy source:
private static boolean isToolTip(Node currentNode){
  if (!currentNode.getNodeName().equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
  NamedNodeMap attributes=currentNode.getAttributes();
  if (attributes == null) {
    return false;
  }
  for (int i=0; i < attributes.getLength(); i++) {
    Node attribute=attributes.item(i);
    if (attribute.getNodeName().equalsIgnoreCase("String_Node_Str") && attribute.getNodeValue().equalsIgnoreCase("String_Node_Str")) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private static boolean isToolTip(Node currentNode){
  if (!currentNode.getNodeName().equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
  NamedNodeMap attributes=currentNode.getAttributes();
  if (attributes == null) {
    return false;
  }
  for (int i=0; i < attributes.getLength(); i++) {
    Node attribute=attributes.item(i);
    if (attribute.getNodeName().equalsIgnoreCase("String_Node_Str") && attribute.getNodeValue().contains("String_Node_Str")) {
      return true;
    }
  }
  return false;
}
Program: 62889
Project: 62889
Buggy source:
private static boolean isToolTip(Node currentNode){
  if (!currentNode.getNodeName().equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
  NamedNodeMap attributes=currentNode.getAttributes();
  if (attributes == null) {
    return false;
  }
  for (int i=0; i < attributes.getLength(); i++) {
    Node attribute=attributes.item(i);
    if (attribute.getNodeName().equalsIgnoreCase("String_Node_Str") && attribute.getNodeValue().equalsIgnoreCase("String_Node_Str")) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private static boolean isToolTip(Node currentNode){
  if (!currentNode.getNodeName().equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
  NamedNodeMap attributes=currentNode.getAttributes();
  if (attributes == null) {
    return false;
  }
  for (int i=0; i < attributes.getLength(); i++) {
    Node attribute=attributes.item(i);
    if (attribute.getNodeName().equalsIgnoreCase("String_Node_Str") && attribute.getNodeValue().contains("String_Node_Str")) {
      return true;
    }
  }
  return false;
}
Program: 62894
Project: 62894
Buggy source:
@Override public List<String> validateQuestionDetails(){
  List<String> errors=new ArrayList<String>();
  if (numOfMcqChoices <= MIN_NUM_OF_MCQ_CHOICES) {
    errors.add(ERROR_NOT_ENOUGH_MCQ_CHOICES + MIN_NUM_OF_MCQ_CHOICES + "String_Node_Str");
  }
  return errors;
}

Fixed version (ground truth):
@Override public List<String> validateQuestionDetails(){
  List<String> errors=new ArrayList<String>();
  if (generateOptionsFor == FeedbackParticipantType.NONE && numOfMcqChoices < MIN_NUM_OF_MCQ_CHOICES) {
    errors.add(ERROR_NOT_ENOUGH_MCQ_CHOICES + MIN_NUM_OF_MCQ_CHOICES + "String_Node_Str");
  }
  return errors;
}
Program: 62895
Project: 62895
Buggy source:
@Override public List<String> validateQuestionDetails(){
  List<String> errors=new ArrayList<String>();
  if (numOfMsqChoices <= MIN_NUM_OF_MSQ_CHOICES) {
    errors.add(ERROR_NOT_ENOUGH_MSQ_CHOICES + MIN_NUM_OF_MSQ_CHOICES + "String_Node_Str");
  }
  return errors;
}

Fixed version (ground truth):
@Override public List<String> validateQuestionDetails(){
  List<String> errors=new ArrayList<String>();
  if (generateOptionsFor == FeedbackParticipantType.NONE && numOfMsqChoices < MIN_NUM_OF_MSQ_CHOICES) {
    errors.add(ERROR_NOT_ENOUGH_MSQ_CHOICES + MIN_NUM_OF_MSQ_CHOICES + "String_Node_Str");
  }
  return errors;
}
Program: 62897
Project: 62897
Buggy source:
public void createStudentCascade(StudentAttributes studentData) throws InvalidParametersException, EntityAlreadyExistsException, EntityDoesNotExistException {
  if (!coursesLogic.isCoursePresent(studentData.course)) {
    throw new EntityDoesNotExistException("String_Node_Str" + studentData.course + "String_Node_Str");
  }
  createStudentCascadeWithSubmissionAdjustmentScheduled(studentData);
  evaluationsLogic.adjustSubmissionsForNewStudent(studentData.course,studentData.email,studentData.team);
}

Fixed version (ground truth):
public void createStudentCascade(StudentAttributes studentData) throws InvalidParametersException, EntityAlreadyExistsException, EntityDoesNotExistException {
  createStudentCascadeWithSubmissionAdjustmentScheduled(studentData);
  if (!coursesLogic.isCoursePresent(studentData.course)) {
    throw new EntityDoesNotExistException("String_Node_Str" + studentData.course + "String_Node_Str");
  }
  evaluationsLogic.adjustSubmissionsForNewStudent(studentData.course,studentData.email,studentData.team);
}
Program: 62899
Project: 62899
Buggy source:
@Test public void testGetKeyForStudent() throws Exception {
  restoreTypicalDataInDatastore();
  ______TS("String_Node_Str");
  try {
    studentsLogic.getKeyForStudent("String_Node_Str",null);
    signalFailureToDetectException();
  }
 catch (  AssertionError a) {
    assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT,a.getMessage());
  }
  ______TS("String_Node_Str");
  StudentAttributes student=dataBundle.students.get("String_Node_Str");
  assertEquals(null,studentsLogic.getKeyForStudent(student.course,"String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testGetKeyForStudent() throws Exception {
  restoreTypicalDataInDatastore();
  ______TS("String_Node_Str");
  try {
    studentsLogic.getKeyForStudent("String_Node_Str",null);
    signalFailureToDetectException();
  }
 catch (  AssertionError a) {
    assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT,a.getMessage());
  }
  ______TS("String_Node_Str");
  StudentAttributes student=dataBundle.students.get("String_Node_Str");
  String nonExistStudentEmail="String_Node_Str";
  try {
    studentsLogic.getKeyForStudent(student.course,nonExistStudentEmail);
    signalFailureToDetectException();
  }
 catch (  EntityDoesNotExistException e) {
    String expectedErrorMsg="String_Node_Str" + student.course + "String_Node_Str"+ nonExistStudentEmail+ "String_Node_Str";
    assertEquals(expectedErrorMsg,e.getMessage());
  }
}
Program: 62900
Project: 62900
Buggy source:
@Test public void testSendRegistrationInviteForCourse() throws Exception {
  restoreTypicalDataInDatastore();
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  CourseAttributes course1=dataBundle.courses.get("String_Node_Str");
  List<MimeMessage> emailsSent=studentsLogic.sendRegistrationInviteForCourse(course1.id);
  assertEquals(0,emailsSent.size());
  ______TS("String_Node_Str");
  StudentAttributes student1InCourse1=dataBundle.students.get("String_Node_Str");
  student1InCourse1.googleId="String_Node_Str";
  studentsLogic.updateStudentCascade(student1InCourse1.email,student1InCourse1);
  StudentAttributes student2InCourse1=dataBundle.students.get("String_Node_Str");
  student2InCourse1.googleId="String_Node_Str";
  studentsLogic.updateStudentCascade(student2InCourse1.email,student2InCourse1);
  emailsSent=studentsLogic.sendRegistrationInviteForCourse(course1.id);
  assertEquals(2,emailsSent.size());
  TestHelper.verifyJoinInviteToStudent(student2InCourse1,emailsSent.get(0));
  TestHelper.verifyJoinInviteToStudent(student1InCourse1,emailsSent.get(1));
  ______TS("String_Node_Str");
  try {
    studentsLogic.sendRegistrationInviteForCourse(null);
    signalFailureToDetectException();
  }
 catch (  AssertionError a) {
    assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT,a.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testSendRegistrationInviteForCourse() throws Exception {
  restoreTypicalDataInDatastore();
  ______TS("String_Node_Str");
  CourseAttributes course1=dataBundle.courses.get("String_Node_Str");
  List<MimeMessage> emailsSent=studentsLogic.sendRegistrationInviteForCourse(course1.id);
  assertEquals(0,emailsSent.size());
  ______TS("String_Node_Str");
  StudentAttributes student1InCourse1=dataBundle.students.get("String_Node_Str");
  student1InCourse1.googleId="String_Node_Str";
  studentsLogic.updateStudentCascade(student1InCourse1.email,student1InCourse1);
  StudentAttributes student2InCourse1=dataBundle.students.get("String_Node_Str");
  student2InCourse1.googleId="String_Node_Str";
  studentsLogic.updateStudentCascade(student2InCourse1.email,student2InCourse1);
  emailsSent=studentsLogic.sendRegistrationInviteForCourse(course1.id);
  assertEquals(2,emailsSent.size());
  TestHelper.verifyJoinInviteToStudent(student2InCourse1,emailsSent.get(0));
  TestHelper.verifyJoinInviteToStudent(student1InCourse1,emailsSent.get(1));
  ______TS("String_Node_Str");
  try {
    studentsLogic.sendRegistrationInviteForCourse(null);
    signalFailureToDetectException();
  }
 catch (  AssertionError a) {
    assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT,a.getMessage());
  }
}
Program: 62901
Project: 62901
Buggy source:
@Test public void testSendRegistrationInviteToStudent() throws Exception {
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  dataBundle=getTypicalDataBundle();
  StudentAttributes student1InCourse1=dataBundle.students.get("String_Node_Str");
  String studentEmail=student1InCourse1.email;
  String courseId=student1InCourse1.course;
  MimeMessage msgToStudent=studentsLogic.sendRegistrationInviteToStudent(courseId,studentEmail);
  Emails emailMgr=new Emails();
  @SuppressWarnings("String_Node_Str") String emailInfo=emailMgr.getEmailInfo(msgToStudent);
  String expectedEmailInfo="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  assertEquals(expectedEmailInfo,emailInfo);
  ______TS("String_Node_Str");
  String invalidCourseId="String_Node_Str";
  try {
    studentsLogic.sendRegistrationInviteToStudent(invalidCourseId,studentEmail);
    signalFailureToDetectException();
  }
 catch (  EntityDoesNotExistException e) {
  }
  ______TS("String_Node_Str");
  String invalidStudentEmail="String_Node_Str";
  try {
    studentsLogic.sendRegistrationInviteToStudent(courseId,invalidStudentEmail);
    signalFailureToDetectException();
  }
 catch (  EntityDoesNotExistException e) {
  }
}

Fixed version (ground truth):
@Test public void testSendRegistrationInviteToStudent() throws Exception {
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  StudentAttributes student1InCourse1=dataBundle.students.get("String_Node_Str");
  String studentEmail=student1InCourse1.email;
  String courseId=student1InCourse1.course;
  MimeMessage msgToStudent=studentsLogic.sendRegistrationInviteToStudent(courseId,studentEmail);
  Emails emailMgr=new Emails();
  @SuppressWarnings("String_Node_Str") String emailInfo=emailMgr.getEmailInfo(msgToStudent);
  String expectedEmailInfo="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  assertEquals(expectedEmailInfo,emailInfo);
  ______TS("String_Node_Str");
  String invalidCourseId="String_Node_Str";
  try {
    studentsLogic.sendRegistrationInviteToStudent(invalidCourseId,studentEmail);
    signalFailureToDetectException();
  }
 catch (  EntityDoesNotExistException e) {
  }
  ______TS("String_Node_Str");
  String invalidStudentEmail="String_Node_Str";
  try {
    studentsLogic.sendRegistrationInviteToStudent(courseId,invalidStudentEmail);
    signalFailureToDetectException();
  }
 catch (  EntityDoesNotExistException e) {
  }
}
Program: 62906
Project: 62906
Buggy source:
@Override protected ActionResult execute() throws EntityDoesNotExistException {
  String key=getRequestParamValue(Const.ParamsNames.REGKEY);
  Assumption.assertNotNull(key);
  new GateKeeper().verifyLoggedInUserPrivileges();
  try {
    logic.joinCourseForInstructor(key,account.googleId);
  }
 catch (  JoinCourseException e) {
    setStatusForException(e,e.getMessage());
    log.info(e.getMessage());
  }
  final String joinedCourseMsg="String_Node_Str" + "String_Node_Str" + account.googleId + "String_Node_Str"+ StringHelper.decrypt(key);
  boolean hasPreviousAdminStatus=statusToAdmin != null && !statusToAdmin.trim().isEmpty();
  if (hasPreviousAdminStatus) {
    statusToAdmin+="String_Node_Str" + joinedCourseMsg;
  }
 else {
    statusToAdmin=joinedCourseMsg;
  }
  RedirectResult response=createRedirectResult(Const.ActionURIs.INSTRUCTOR_HOME_PAGE);
  InstructorAttributes instructor=logic.getInstructorForRegistrationKey(key);
  if (instructor != null) {
    response.addResponseParam(Const.ParamsNames.CHECK_PERSISTENCE_COURSE,instructor.courseId);
  }
  return response;
}

Fixed version (ground truth):
@Override protected ActionResult execute() throws EntityDoesNotExistException {
  String key=getRequestParamValue(Const.ParamsNames.REGKEY);
  Assumption.assertNotNull(key);
  new GateKeeper().verifyLoggedInUserPrivileges();
  try {
    logic.joinCourseForInstructor(key,account.googleId);
  }
 catch (  JoinCourseException e) {
    setStatusForException(e,e.getMessage());
    log.info(e.getMessage());
  }
  final String joinedCourseMsg="String_Node_Str" + "String_Node_Str" + account.googleId + "String_Node_Str"+ StringHelper.decrypt(key);
  if (statusToAdmin != null) {
    statusToAdmin+="String_Node_Str" + joinedCourseMsg;
  }
 else {
    statusToAdmin=joinedCourseMsg;
  }
  RedirectResult response=createRedirectResult(Const.ActionURIs.INSTRUCTOR_HOME_PAGE);
  InstructorAttributes instructor=logic.getInstructorForRegistrationKey(key);
  if (instructor != null) {
    response.addResponseParam(Const.ParamsNames.CHECK_PERSISTENCE_COURSE,instructor.courseId);
  }
  return response;
}
Program: 62908
Project: 62908
Buggy source:
@Test public void testAccessControl() throws Exception {
  String[] submissionParams=new String[]{Const.ParamsNames.REGKEY,"String_Node_Str"};
  verifyOnlyLoggedInUsersCanAccess(submissionParams);
}

Fixed version (ground truth):
@Test public void testAccessControl() throws Exception {
  String[] submissionParams=new String[]{Const.ParamsNames.REGKEY,invalidEncryptedKey};
  verifyOnlyLoggedInUsersCanAccess(submissionParams);
}
Program: 62909
Project: 62909
Buggy source:
public String getCourseInstitute(String courseId){
  CourseAttributes cd=new CoursesLogic().getCourse(courseId);
  List<InstructorAttributes> instructorList=InstructorsLogic.inst().getInstructorsForCourse(cd.id);
  Assumption.assertTrue("String_Node_Str" + cd.id,!instructorList.isEmpty());
  String institute="String_Node_Str";
  for (int i=0; i < instructorList.size(); i++) {
    AccountAttributes instructorAcc=accountsDb.getAccount(instructorList.get(i).googleId);
    if (instructorAcc != null) {
      institute=instructorAcc.institute;
      break;
    }
  }
  return institute;
}

Fixed version (ground truth):
public String getCourseInstitute(String courseId){
  CourseAttributes cd=new CoursesLogic().getCourse(courseId);
  List<InstructorAttributes> instructorList=InstructorsLogic.inst().getInstructorsForCourse(cd.id);
  Assumption.assertTrue("String_Node_Str" + cd.id,!instructorList.isEmpty());
  String institute="String_Node_Str";
  for (int i=0; i < instructorList.size(); i++) {
    String instructorGoogleId=instructorList.get(i).googleId;
    if (instructorGoogleId == null) {
      continue;
    }
    AccountAttributes instructorAcc=accountsDb.getAccount(instructorGoogleId);
    if (instructorAcc != null) {
      institute=instructorAcc.institute;
      break;
    }
  }
  Assumption.assertNotEmpty("String_Node_Str",institute);
  return institute;
}
Program: 62911
Project: 62911
Buggy source:
public void doGet(HttpServletRequest req,HttpServletResponse resp){
  Emails.EmailType typeOfMail=Emails.EmailType.valueOf(HttpRequestHelper.getValueFromRequestParameterMap(req,ParamsNames.EMAIL_TYPE));
  Assumption.assertNotNull(typeOfMail);
  EmailAction emailObj=null;
  int responseCode=Response.SC_OK;
switch (typeOfMail) {
case EVAL_CLOSING:
    emailObj=new EvaluationClosingMailAction(req);
  break;
case EVAL_OPENING:
emailObj=new EvaluationOpeningMailAction(req);
break;
case FEEDBACK_CLOSING:
emailObj=new FeedbackSessionClosingMailAction(req);
break;
case FEEDBACK_OPENING:
emailObj=new FeedbackSessionOpeningMailAction(req);
break;
case FEEDBACK_PUBLISHED:
emailObj=new FeedbackSessionPublishedMailAction(req);
break;
default :
log.severe("String_Node_Str");
responseCode=Response.SC_INTERNAL_SERVER_ERROR;
}
if (emailObj != null) {
emailObj.sendEmails();
}
resp.setStatus(responseCode);
}

Fixed version (ground truth):
public void doGet(HttpServletRequest req,HttpServletResponse resp){
  Emails.EmailType typeOfMail=Emails.EmailType.valueOf(HttpRequestHelper.getValueFromRequestParameterMap(req,ParamsNames.EMAIL_TYPE));
  Assumption.assertNotNull(typeOfMail);
  EmailAction emailObj=null;
  int responseCode=Response.SC_OK;
  log.info("String_Node_Str" + HttpRequestHelper.printRequestParameters(req));
switch (typeOfMail) {
case EVAL_CLOSING:
    emailObj=new EvaluationClosingMailAction(req);
  break;
case EVAL_OPENING:
emailObj=new EvaluationOpeningMailAction(req);
break;
case FEEDBACK_CLOSING:
emailObj=new FeedbackSessionClosingMailAction(req);
break;
case FEEDBACK_OPENING:
emailObj=new FeedbackSessionOpeningMailAction(req);
break;
case FEEDBACK_PUBLISHED:
emailObj=new FeedbackSessionPublishedMailAction(req);
break;
default :
log.severe("String_Node_Str");
responseCode=Response.SC_INTERNAL_SERVER_ERROR;
}
if (emailObj != null) {
emailObj.sendEmails();
}
resp.setStatus(responseCode);
}
Program: 62912
Project: 62912
Buggy source:
public String getDateInfo(){
  Calendar appCal=Calendar.getInstance(TimeZone.getTimeZone("String_Node_Str"));
  SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
  appCal.setTimeInMillis(time);
  return sdf.format(appCal.getTime());
}

Fixed version (ground truth):
public String getDateInfo(){
  Calendar appCal=Calendar.getInstance(TimeZone.getTimeZone("String_Node_Str"));
  SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
  sdf.setTimeZone(TimeZone.getTimeZone(Const.SystemParams.ADMIN_TIME_ZONE));
  appCal.setTimeInMillis(time);
  return sdf.format(appCal.getTime());
}
Program: 62914
Project: 62914
Buggy source:
@Test public void testAll(){
  testContent();
  testInputValidation();
  testCreateInstructorAction();
  testInputSanitization();
}

Fixed version (ground truth):
@Test public void testAll(){
  testContent();
  testInputValidation();
  testCreateInstructorAction();
}
Program: 62915
Project: 62915
Buggy source:
public static String printRequestParameters(HttpServletRequest request){
  String requestParameters="String_Node_Str";
  for (Enumeration<?> f=request.getParameterNames(); f.hasMoreElements(); ) {
    String paramet=new String(f.nextElement().toString());
    requestParameters+=paramet + "String_Node_Str";
    String[] parameterValues=request.getParameterValues(paramet);
    for (int j=0; j < parameterValues.length; j++) {
      requestParameters+=parameterValues[j] + "String_Node_Str";
    }
    requestParameters=requestParameters.substring(0,requestParameters.length() - 2) + "String_Node_Str";
  }
  if (requestParameters != "String_Node_Str") {
    requestParameters=requestParameters.substring(0,requestParameters.length() - 2);
  }
  requestParameters+="String_Node_Str";
  return requestParameters;
}

Fixed version (ground truth):
public static String printRequestParameters(HttpServletRequest request){
  String requestParameters="String_Node_Str";
  for (Enumeration<?> f=request.getParameterNames(); f.hasMoreElements(); ) {
    String paramet=new String(f.nextElement().toString());
    requestParameters+=paramet + "String_Node_Str";
    String[] parameterValues=request.getParameterValues(paramet);
    for (int j=0; j < parameterValues.length; j++) {
      requestParameters+=parameterValues[j] + "String_Node_Str";
    }
    requestParameters=requestParameters.substring(0,requestParameters.length() - 2) + "String_Node_Str";
  }
  if (!requestParameters.equals("String_Node_Str")) {
    requestParameters=requestParameters.substring(0,requestParameters.length() - 2);
  }
  requestParameters+="String_Node_Str";
  return requestParameters;
}
Program: 62917
Project: 62917
Buggy source:
private List<FeedbackQuestionAttributes> getUnstolenTeamQuestions(String feedbackSessionName,String courseId,String studentEmail) throws EntityDoesNotExistException {
  List<FeedbackQuestionAttributes> teamQuestions=fqDb.getFeedbackQuestionsForGiverType(feedbackSessionName,courseId,TEAMS);
  List<FeedbackQuestionAttributes> unstolenQuestions=new ArrayList<FeedbackQuestionAttributes>();
  StudentAttributes student=studentsLogic.getStudentForEmail(courseId,studentEmail);
  Assumption.assertNotNull("String_Node_Str",student);
  for (  FeedbackQuestionAttributes question : teamQuestions) {
    if (isQuestionAnsweredByTeam(question,student.team) == true) {
      if (frLogic.getFeedbackResponsesFromGiverForQuestion(question.getId(),studentEmail).isEmpty() == false) {
        unstolenQuestions.add(question);
      }
    }
 else {
      unstolenQuestions.add(question);
    }
  }
  return unstolenQuestions;
}

Fixed version (ground truth):
private List<FeedbackQuestionAttributes> getUnstolenTeamQuestions(String feedbackSessionName,String courseId,String studentEmail) throws EntityDoesNotExistException {
  List<FeedbackQuestionAttributes> teamQuestions=fqDb.getFeedbackQuestionsForGiverType(feedbackSessionName,courseId,TEAMS);
  List<FeedbackQuestionAttributes> unstolenQuestions=new ArrayList<FeedbackQuestionAttributes>();
  StudentAttributes student=studentsLogic.getStudentForEmail(courseId,studentEmail);
  Assumption.assertNotNull("String_Node_Str",student);
  for (  FeedbackQuestionAttributes question : teamQuestions) {
    if (isQuestionAnsweredByTeam(question,student.team)) {
      if (frLogic.getFeedbackResponsesFromGiverForQuestion(question.getId(),studentEmail).isEmpty() == false) {
        unstolenQuestions.add(question);
      }
    }
 else {
      unstolenQuestions.add(question);
    }
  }
  return unstolenQuestions;
}
Program: 62918
Project: 62918
Buggy source:
private boolean isFeedbackSessionViewableTo(FeedbackSessionAttributes session,String userEmail) throws EntityDoesNotExistException {
  if (fsDb.getFeedbackSession(session.feedbackSessionName,session.courseId) == null) {
    throw new EntityDoesNotExistException("String_Node_Str");
  }
  if (session.feedbackSessionType == FeedbackSessionType.PRIVATE) {
    if (session.creatorEmail.equals(userEmail)) {
      return true;
    }
 else {
      return false;
    }
  }
  InstructorAttributes instructor=instructorsLogic.getInstructorForEmail(session.courseId,userEmail);
  if (instructor != null) {
    if (instructorsLogic.isInstructorOfCourse(instructor.googleId,session.courseId)) {
      return true;
    }
  }
  if (session.isPublished() == false) {
    List<FeedbackQuestionAttributes> questions=fqLogic.getFeedbackQuestionsForUser(session.feedbackSessionName,session.courseId,userEmail);
    if (questions.isEmpty() == false) {
      return true;
    }
  }
 else {
    try {
      getFeedbackSessionResultsForUser(session.feedbackSessionName,session.courseId,userEmail);
    }
 catch (    UnauthorizedAccessException e) {
      return false;
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isFeedbackSessionViewableTo(FeedbackSessionAttributes session,String userEmail) throws EntityDoesNotExistException {
  if (fsDb.getFeedbackSession(session.feedbackSessionName,session.courseId) == null) {
    throw new EntityDoesNotExistException("String_Node_Str");
  }
  if (session.feedbackSessionType == FeedbackSessionType.PRIVATE) {
    return session.creatorEmail.equals(userEmail);
  }
  InstructorAttributes instructor=instructorsLogic.getInstructorForEmail(session.courseId,userEmail);
  if (instructor != null) {
    return instructorsLogic.isInstructorOfCourse(instructor.googleId,session.courseId);
  }
  if (session.isPublished() == false) {
    List<FeedbackQuestionAttributes> questions=fqLogic.getFeedbackQuestionsForUser(session.feedbackSessionName,session.courseId,userEmail);
    if (questions.isEmpty() == false) {
      return true;
    }
  }
 else {
    try {
      getFeedbackSessionResultsForUser(session.feedbackSessionName,session.courseId,userEmail);
    }
 catch (    UnauthorizedAccessException e) {
      return false;
    }
    return true;
  }
  return false;
}
Program: 62919
Project: 62919
Buggy source:
public List<FeedbackSessionAttributes> getFeedbackSessionsForUserInCourse(String courseId,String userEmail) throws EntityDoesNotExistException {
  if (coursesLogic.isCoursePresent(courseId) == false) {
    throw new EntityDoesNotExistException("String_Node_Str");
  }
  List<FeedbackSessionAttributes> sessions=fsDb.getFeedbackSessionsForCourse(courseId);
  List<FeedbackSessionAttributes> viewableSessions=new ArrayList<FeedbackSessionAttributes>();
  for (  FeedbackSessionAttributes session : sessions) {
    if (isFeedbackSessionViewableTo(session,userEmail) == true) {
      viewableSessions.add(session);
      log.info(session.getIdentificationString() + "String_Node_Str");
    }
  }
  return viewableSessions;
}

Fixed version (ground truth):
public List<FeedbackSessionAttributes> getFeedbackSessionsForUserInCourse(String courseId,String userEmail) throws EntityDoesNotExistException {
  if (coursesLogic.isCoursePresent(courseId) == false) {
    throw new EntityDoesNotExistException("String_Node_Str");
  }
  List<FeedbackSessionAttributes> sessions=fsDb.getFeedbackSessionsForCourse(courseId);
  List<FeedbackSessionAttributes> viewableSessions=new ArrayList<FeedbackSessionAttributes>();
  for (  FeedbackSessionAttributes session : sessions) {
    if (isFeedbackSessionViewableTo(session,userEmail)) {
      viewableSessions.add(session);
      log.info(session.getIdentificationString() + "String_Node_Str");
    }
  }
  return viewableSessions;
}
Program: 62920
Project: 62920
Buggy source:
private void makeEmailStateConsistent(FeedbackSessionAttributes oldSession,FeedbackSessionAttributes newSession){
  if (oldSession.sentOpenEmail == true && newSession.startTime.after(oldSession.startTime) && newSession.isOpened() == false) {
    newSession.sentOpenEmail=false;
  }
 else {
    newSession.sentOpenEmail=oldSession.sentOpenEmail;
  }
  if (oldSession.sentPublishedEmail == true && newSession.resultsVisibleFromTime.after(oldSession.resultsVisibleFromTime) && newSession.isPublished() == false) {
    newSession.sentPublishedEmail=false;
  }
 else {
    newSession.sentPublishedEmail=oldSession.sentPublishedEmail;
  }
}

Fixed version (ground truth):
private void makeEmailStateConsistent(FeedbackSessionAttributes oldSession,FeedbackSessionAttributes newSession){
  if (oldSession.sentOpenEmail && newSession.startTime.after(oldSession.startTime) && newSession.isOpened() == false) {
    newSession.sentOpenEmail=false;
  }
 else {
    newSession.sentOpenEmail=oldSession.sentOpenEmail;
  }
  if (oldSession.sentPublishedEmail && newSession.resultsVisibleFromTime.after(oldSession.resultsVisibleFromTime) && newSession.isPublished() == false) {
    newSession.sentPublishedEmail=false;
  }
 else {
    newSession.sentPublishedEmail=oldSession.sentPublishedEmail;
  }
}
Program: 62921
Project: 62921
Buggy source:
/** 
 * Preconditions:  <br> *   {@code accountToAdd} is not null and has valid data.
 */
public void createAccount(AccountAttributes accountToAdd) throws InvalidParametersException {
  try {
    createEntity((EntityAttributes)accountToAdd);
  }
 catch (  EntityAlreadyExistsException e) {
    updateAccount(accountToAdd);
  }
}

Fixed version (ground truth):
/** 
 * Preconditions:  <br> *   {@code accountToAdd} is not null and has valid data.
 */
public void createAccount(AccountAttributes accountToAdd) throws InvalidParametersException {
  try {
    createEntity(accountToAdd);
  }
 catch (  EntityAlreadyExistsException e) {
    updateAccount(accountToAdd);
  }
}
Program: 62922
Project: 62922
Buggy source:
private static Action getAction(String uri){
  Class<? extends Action> controllerClass=actionMappings.get(uri);
  if (controllerClass == null) {
    return new NonExistentAction();
  }
  try {
    return (Action)controllerClass.newInstance();
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str" + uri);
  }
}

Fixed version (ground truth):
private static Action getAction(String uri){
  Class<? extends Action> controllerClass=actionMappings.get(uri);
  if (controllerClass == null) {
    return new NonExistentAction();
  }
  try {
    return controllerClass.newInstance();
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str" + uri);
  }
}
Program: 62923
Project: 62923
Buggy source:
@SuppressWarnings("String_Node_Str") private List<StudentAttributes>[] separateStudents(List<StudentAttributes> students){
  if (students == null)   return (List<StudentAttributes>[])new List[6];
  List<StudentAttributes>[] lists=(List<StudentAttributes>[])new List[6];
  int prevIdx=0;
  int nextIdx=0;
  int id=0;
  for (  StudentAttributes student : students) {
    if (student.comments == null)     student.comments="String_Node_Str";
    if (student.team == null)     student.team="String_Node_Str";
    while (student.updateStatus.numericRepresentation > id) {
      lists[id]=students.subList(prevIdx,nextIdx);
      id++;
      prevIdx=nextIdx;
    }
    nextIdx++;
  }
  while (id < 6) {
    lists[id++]=students.subList(prevIdx,nextIdx);
    StudentAttributes.sortByNameAndThenByEmail(lists[id - 1]);
    prevIdx=nextIdx;
  }
  return lists;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private List<StudentAttributes>[] separateStudents(List<StudentAttributes> students){
  if (students == null)   return new List[6];
  List<StudentAttributes>[] lists=new List[6];
  int prevIdx=0;
  int nextIdx=0;
  int id=0;
  for (  StudentAttributes student : students) {
    if (student.comments == null)     student.comments="String_Node_Str";
    if (student.team == null)     student.team="String_Node_Str";
    while (student.updateStatus.numericRepresentation > id) {
      lists[id]=students.subList(prevIdx,nextIdx);
      id++;
      prevIdx=nextIdx;
    }
    nextIdx++;
  }
  while (id < 6) {
    lists[id++]=students.subList(prevIdx,nextIdx);
    StudentAttributes.sortByNameAndThenByEmail(lists[id - 1]);
    prevIdx=nextIdx;
  }
  return lists;
}
Program: 62924
Project: 62924
Buggy source:
@Override protected ActionResult execute() throws EntityDoesNotExistException, InvalidParametersException {
  String courseId=getRequestParam(Const.ParamsNames.COURSE_ID);
  Assumption.assertNotNull(courseId);
  String evalName=getRequestParam(Const.ParamsNames.EVALUATION_NAME);
  Assumption.assertNotNull(evalName);
  new GateKeeper().verifyAccessible(logic.getInstructorForGoogleId(courseId,account.googleId),logic.getEvaluation(courseId,evalName));
  InstructorEvalEditPageData data=new InstructorEvalEditPageData(account);
  data.evaluation=logic.getEvaluation(courseId,evalName);
  if (data.evaluation == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + evalName + "String_Node_Str"+ courseId+ "String_Node_Str");
  }
  statusToAdmin="String_Node_Str" + data.evaluation.name + "String_Node_Str"+ data.evaluation.courseId+ "String_Node_Str"+ "String_Node_Str"+ data.evaluation.startTime+ "String_Node_Str"+ data.evaluation.endTime+ "String_Node_Str"+ "String_Node_Str"+ (data.evaluation.p2pEnabled == true ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ data.evaluation.instructions;
  return createShowPageResult(Const.ViewURIs.INSTRUCTOR_EVAL_EDIT,data);
}

Fixed version (ground truth):
@Override protected ActionResult execute() throws EntityDoesNotExistException, InvalidParametersException {
  String courseId=getRequestParam(Const.ParamsNames.COURSE_ID);
  Assumption.assertNotNull(courseId);
  String evalName=getRequestParam(Const.ParamsNames.EVALUATION_NAME);
  Assumption.assertNotNull(evalName);
  new GateKeeper().verifyAccessible(logic.getInstructorForGoogleId(courseId,account.googleId),logic.getEvaluation(courseId,evalName));
  InstructorEvalEditPageData data=new InstructorEvalEditPageData(account);
  data.evaluation=logic.getEvaluation(courseId,evalName);
  if (data.evaluation == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + evalName + "String_Node_Str"+ courseId+ "String_Node_Str");
  }
  statusToAdmin="String_Node_Str" + data.evaluation.name + "String_Node_Str"+ data.evaluation.courseId+ "String_Node_Str"+ "String_Node_Str"+ data.evaluation.startTime+ "String_Node_Str"+ data.evaluation.endTime+ "String_Node_Str"+ "String_Node_Str"+ (data.evaluation.p2pEnabled ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ data.evaluation.instructions;
  return createShowPageResult(Const.ViewURIs.INSTRUCTOR_EVAL_EDIT,data);
}