nus-yam/ex-repair huggingface dataset:
Program: 62975
Project: 62975
Buggy source:
/** 
 * @param filepath
 * @return Returns content of the file after replacing parameters e.g. {version} and transforming to "clean" HTML. 
 * @throws Exception
 */
private String getCleanExpectedHtml(String filepath) throws Exception {
  String inputStr=Common.readFile(filepath).replace("String_Node_Str",TestProperties.inst().TEAMMATES_VERSION);
  inputStr=HtmlHelper.cleanupHtml(inputStr);
  return inputStr;
}

Fixed version (ground truth):
/** 
 * @param filepath
 * @return Returns content of the file after replacing parameters e.g. {version} and transforming to "clean" HTML. 
 * @throws Exception
 */
private String getCleanExpectedHtml(String filepath) throws Exception {
  String inputStr=Common.readFile(filepath).replace("String_Node_Str",TestProperties.inst().TEAMMATES_VERSION);
  inputStr=HtmlHelper.parseHtml(inputStr);
  return inputStr;
}
Program: 62976
Project: 62976
Buggy source:
/** 
 * @return Returns content of the file after transforming to "clean" HTML.
 * @throws Exception
 */
private String getCleanPageSource() throws Exception {
  String pageSrc=getCurrentPageSource();
  pageSrc=HtmlHelper.preProcessHtml(pageSrc);
  pageSrc=HtmlHelper.cleanupHtml(pageSrc);
  pageSrc=HtmlHelper.postProcessHtml(pageSrc);
  return pageSrc;
}

Fixed version (ground truth):
/** 
 * @return Returns content of the file after transforming to "clean" HTML.
 * @throws Exception
 */
private String getCleanPageSource() throws Exception {
  String pageSrc=getCurrentPageSource();
  pageSrc=HtmlHelper.parseHtml(pageSrc);
  return pageSrc;
}
Program: 62977
Project: 62977
Buggy source:
public static String postProcessHtml(String htmlString){
  htmlString=htmlString.replaceAll("String_Node_Str","String_Node_Str");
  return htmlString;
}

Fixed version (ground truth):
private static String postProcessHtml(String htmlString){
  htmlString=htmlString.replaceAll("String_Node_Str","String_Node_Str");
  return htmlString;
}
Program: 62978
Project: 62978
Buggy source:
/** 
 * Assert whether two HTML strings are the same in the DOM representation. This ignores the order of attributes, and ignores unnecessary whitespaces as well.
 * @param html1
 * @param html2
 * @throws SAXException
 * @throws IOException
 * @throws TransformerException
 */
public static void assertSameHtml(String html1,String html2) throws SAXException, IOException, TransformerException {
  html1=preProcessHtml(html1);
  html1=cleanupHtml(html1);
  html1=postProcessHtml(html1);
  html2=preProcessHtml(html2);
  html2=cleanupHtml(html2);
  html2=postProcessHtml(html2);
  assertEquals(html1,html2);
}

Fixed version (ground truth):
/** 
 * Assert whether two HTML strings are the same in the DOM representation. This ignores the order of attributes, and ignores unnecessary whitespaces as well.
 * @param html1
 * @param html2
 * @throws SAXException
 * @throws IOException
 * @throws TransformerException
 */
public static void assertSameHtml(String html1,String html2) throws SAXException, IOException, TransformerException {
  html1=parseHtml(html1);
  html2=parseHtml(html2);
  assertEquals(html1,html2);
}
Program: 62979
Project: 62979
Buggy source:
public static String preProcessHtml(String htmlString){
  htmlString=htmlString.replaceFirst("String_Node_Str","String_Node_Str");
  if (htmlString.indexOf("String_Node_Str") < 0) {
    htmlString="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + htmlString + "String_Node_Str";
  }
  return htmlString;
}

Fixed version (ground truth):
private static String preProcessHtml(String htmlString){
  htmlString=htmlString.replaceFirst("String_Node_Str","String_Node_Str");
  if (htmlString.indexOf("String_Node_Str") < 0) {
    htmlString="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + htmlString + "String_Node_Str";
  }
  return htmlString;
}
Program: 62980
Project: 62980
Buggy source:
@Test public void testCoordCourseEnrollPage() throws Exception {
  ______TS("String_Node_Str");
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
  bi.fillString(By.id("String_Node_Str"),"String_Node_Str");
  bi.click(By.id("String_Node_Str"));
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
  ______TS("String_Node_Str");
  bi.fillString(By.id("String_Node_Str"),enrollString);
  bi.click(By.id("String_Node_Str"));
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
}

Fixed version (ground truth):
@Test public void testCoordCourseEnrollPage() throws Exception {
  ______TS("String_Node_Str");
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
  String errorString="String_Node_Str";
  bi.fillString(By.id("String_Node_Str"),errorString);
  bi.click(By.id("String_Node_Str"));
  assertContains(bi.getElementText(By.id("String_Node_Str")),errorString);
  bi.fillString(By.id("String_Node_Str"),"String_Node_Str");
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
  ______TS("String_Node_Str");
  bi.fillString(By.id("String_Node_Str"),enrollString);
  bi.click(By.id("String_Node_Str"));
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
}
Program: 62981
Project: 62981
Buggy source:
/** 
 * Assert whether two HTML strings are the same in the DOM representation. This ignores the order of attributes, and ignores unnecessary whitespaces as well.
 * @param html1
 * @param html2
 * @throws SAXException
 * @throws IOException
 * @throws TransformerException
 */
public static void assertSameHtml(String html1,String html2) throws SAXException, IOException, TransformerException {
  html1=preProcessHTML(html1);
  html1=cleanupHtml(html1);
  html2=preProcessHTML(html2);
  html2=cleanupHtml(html2);
  assertEquals(html1,html2);
}

Fixed version (ground truth):
/** 
 * Assert whether two HTML strings are the same in the DOM representation. This ignores the order of attributes, and ignores unnecessary whitespaces as well.
 * @param html1
 * @param html2
 * @throws SAXException
 * @throws IOException
 * @throws TransformerException
 */
public static void assertSameHtml(String html1,String html2) throws SAXException, IOException, TransformerException {
  html1=preProcessHtml(html1);
  html1=cleanupHtml(html1);
  html1=postProcessHtml(html1);
  html2=preProcessHtml(html2);
  html2=cleanupHtml(html2);
  html2=postProcessHtml(html2);
  assertEquals(html1,html2);
}
Program: 62982
Project: 62982
Buggy source:
/** 
 * Access level: Admin, Coord (for self)
 * @return Returns a less-detailed version of Coord's evaluations <br>
 */
public ArrayList<EvaluationData> getEvaluationsListForCoord(String coordId) throws EntityDoesNotExistException {
  Common.verifyNotNull(coordId,"String_Node_Str");
  verifyCoordUsingOwnIdOrAbove(coordId);
  List<Course> courseList=CoursesStorage.inst().getCoordinatorCourseList(coordId);
  if ((courseList.size() == 0) && (getCoord(coordId) == null)) {
    throw new EntityDoesNotExistException("String_Node_Str" + coordId);
  }
  ArrayList<EvaluationData> evaluationDetailsList=new ArrayList<EvaluationData>();
  for (  Course c : courseList) {
    ArrayList<EvaluationData> evaluationsSummaryForCourse=EvaluationsStorage.inst().getEvaluationsSummaryForCourse(c.getID());
    evaluationDetailsList.addAll(evaluationsSummaryForCourse);
  }
  return evaluationDetailsList;
}

Fixed version (ground truth):
/** 
 * Access level: Admin, Coord (for self)
 * @return Returns a less-detailed version of Coord's evaluations <br>
 */
public ArrayList<EvaluationData> getEvaluationsListForCoord(String coordId) throws EntityDoesNotExistException {
  Common.verifyNotNull(coordId,"String_Node_Str");
  verifyCoordUsingOwnIdOrAbove(coordId);
  List<Course> courseList=CoursesStorage.inst().getCoordinatorCourseList(coordId);
  if ((courseList.size() == 0) && (getCoord(coordId) == null)) {
    throw new EntityDoesNotExistException("String_Node_Str" + coordId);
  }
  ArrayList<EvaluationData> evaluationSummaryList=new ArrayList<EvaluationData>();
  for (  Course c : courseList) {
    ArrayList<EvaluationData> evaluationsSummaryForCourse=EvaluationsStorage.inst().getEvaluationsSummaryForCourse(c.getID());
    List<StudentData> students=getStudentListForCourse(c.getID());
    for (    EvaluationData evaluation : evaluationsSummaryForCourse) {
      evaluation.expectedTotal=students.size();
      HashMap<String,SubmissionData> submissions=getSubmissionsForEvaluation(c.getID(),evaluation.name);
      evaluation.submittedTotal=countSubmittedStudents(submissions.values());
      evaluationSummaryList.add(evaluation);
    }
  }
  return evaluationSummaryList;
}
Program: 62983
Project: 62983
Buggy source:
private HashMap<String,SubmissionData> getSubmissionsForEvaluation(String courseId,String evaluationName) throws EntityDoesNotExistException {
  if (getEvaluation(courseId,evaluationName) == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + evaluationName + "String_Node_Str"+ courseId+ "String_Node_Str");
  }
  List<StudentData> students=getStudentListForCourse(courseId);
  List<Submission> submissionsList=EvaluationsStorage.inst().getSubmissionList(courseId,evaluationName);
  submissionsList=purgeOrphanSubmissions(students,submissionsList);
  HashMap<String,SubmissionData> submissionDataList=new HashMap<String,SubmissionData>();
  for (  Submission s : submissionsList) {
    SubmissionData sd=new SubmissionData(s);
    submissionDataList.put(sd.reviewer + "String_Node_Str" + sd.reviewee,sd);
  }
  return submissionDataList;
}

Fixed version (ground truth):
/** 
 * Returns submission for the evaluation, excluding orphaned submissions.
 */
private HashMap<String,SubmissionData> getSubmissionsForEvaluation(String courseId,String evaluationName) throws EntityDoesNotExistException {
  if (getEvaluation(courseId,evaluationName) == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + evaluationName + "String_Node_Str"+ courseId+ "String_Node_Str");
  }
  List<StudentData> students=getStudentListForCourse(courseId);
  List<Submission> submissionsList=EvaluationsStorage.inst().getSubmissionList(courseId,evaluationName);
  submissionsList=purgeOrphanSubmissions(students,submissionsList);
  HashMap<String,SubmissionData> submissionDataList=new HashMap<String,SubmissionData>();
  for (  Submission s : submissionsList) {
    SubmissionData sd=new SubmissionData(s);
    submissionDataList.put(sd.reviewer + "String_Node_Str" + sd.reviewee,sd);
  }
  return submissionDataList;
}
Program: 62984
Project: 62984
Buggy source:
public ArrayList<EvaluationData> getEvaluationsSummaryForCourse(String courseId){
  ArrayList<EvaluationData> evaluationsSummaryList=new ArrayList<EvaluationData>();
  List<Evaluation> evaluationList=getEvaluationList(courseId);
  for (  Evaluation e : evaluationList) {
    EvaluationData ed=new EvaluationData();
    ed.course=e.getCourseID();
    ed.name=e.getName();
    ed.instructions=e.getInstructions();
    ed.p2pEnabled=e.isCommentsEnabled();
    ed.startTime=e.getStart();
    ed.endTime=e.getDeadline();
    ed.timeZone=e.getTimeZone();
    ed.gracePeriod=e.getGracePeriod();
    ed.published=e.isPublished();
    ed.activated=e.isActivated();
    ed.submittedTotal=getNumberOfCompletedEvaluations(e.getCourseID(),e.getName());
    ed.expectedTotal=getNumberOfEvaluations(e.getCourseID(),e.getName());
    evaluationsSummaryList.add(ed);
  }
  return evaluationsSummaryList;
}

Fixed version (ground truth):
public ArrayList<EvaluationData> getEvaluationsSummaryForCourse(String courseId){
  ArrayList<EvaluationData> evaluationsSummaryList=new ArrayList<EvaluationData>();
  List<Evaluation> evaluationList=getEvaluationList(courseId);
  for (  Evaluation e : evaluationList) {
    EvaluationData ed=new EvaluationData();
    ed.course=e.getCourseID();
    ed.name=e.getName();
    ed.instructions=e.getInstructions();
    ed.p2pEnabled=e.isCommentsEnabled();
    ed.startTime=e.getStart();
    ed.endTime=e.getDeadline();
    ed.timeZone=e.getTimeZone();
    ed.gracePeriod=e.getGracePeriod();
    ed.published=e.isPublished();
    ed.activated=e.isActivated();
    evaluationsSummaryList.add(ed);
  }
  return evaluationsSummaryList;
}
Program: 62987
Project: 62987
Buggy source:
/** 
 * Access: course owner and above
 */
public void createStudent(StudentData studentData) throws EntityAlreadyExistsException, InvalidParametersException {
  Common.verifyNotNull(studentData,"String_Node_Str");
  verifyCourseOwnerOrAbove(studentData.course);
  Student student=new Student(studentData);
  if (student.getID() == null) {
    student.setID("String_Node_Str");
  }
  if (student.getComments() == null) {
    student.setComments("String_Node_Str");
  }
  if (student.getTeamName() == null) {
    student.setTeamName("String_Node_Str");
  }
  CoursesStorage.inst().createStudent(student);
}

Fixed version (ground truth):
/** 
 * Creates a student and adjust existing evaluations to  accommodate the new student Access: course owner and above
 */
public void createStudent(StudentData studentData) throws EntityAlreadyExistsException, InvalidParametersException {
  Common.verifyNotNull(studentData,"String_Node_Str");
  verifyCourseOwnerOrAbove(studentData.course);
  Student student=new Student(studentData);
  if (student.getID() == null) {
    student.setID("String_Node_Str");
  }
  if (student.getComments() == null) {
    student.setComments("String_Node_Str");
  }
  if (student.getTeamName() == null) {
    student.setTeamName("String_Node_Str");
  }
  CoursesStorage.inst().createStudent(student);
  EvaluationsStorage.inst().adjustSubmissions(student.getCourseID());
}
Program: 62988
Project: 62988
Buggy source:
@Test public void testCreateStudent() throws Exception {
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  String methodName="String_Node_Str";
  Class<?>[] paramTypes=new Class<?>[]{StudentData.class};
  StudentData s=new StudentData("String_Node_Str","String_Node_Str");
  Object[] params=new Object[]{s};
  verifyCannotAccess(USER_TYPE_NOT_LOGGED_IN,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_UNREGISTERED,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_STUDENT,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_COORD,methodName,"String_Node_Str",paramTypes,new Object[]{new StudentData("String_Node_Str","String_Node_Str")});
  verifyCanAccess(USER_TYPE_COORD,methodName,"String_Node_Str",paramTypes,params);
  ______TS("String_Node_Str");
  loginAsAdmin("String_Node_Str");
  StudentData newStudent=new StudentData("String_Node_Str","String_Node_Str");
  verifyAbsentInDatastore(newStudent);
  logic.createStudent(newStudent);
  verifyPresentInDatastore(newStudent);
  ______TS("String_Node_Str");
  try {
    logic.createStudent(newStudent);
    fail();
  }
 catch (  EntityAlreadyExistsException e) {
  }
  ______TS("String_Node_Str");
  verifyNullPointerException(methodName,"String_Node_Str",paramTypes,new Object[]{null});
}

Fixed version (ground truth):
@Test public void testCreateStudent() throws Exception {
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  String methodName="String_Node_Str";
  Class<?>[] paramTypes=new Class<?>[]{StudentData.class};
  StudentData s=new StudentData("String_Node_Str","String_Node_Str");
  Object[] params=new Object[]{s};
  verifyCannotAccess(USER_TYPE_NOT_LOGGED_IN,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_UNREGISTERED,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_STUDENT,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_COORD,methodName,"String_Node_Str",paramTypes,new Object[]{new StudentData("String_Node_Str","String_Node_Str")});
  verifyCanAccess(USER_TYPE_COORD,methodName,"String_Node_Str",paramTypes,params);
  ______TS("String_Node_Str");
  loginAsAdmin("String_Node_Str");
  restoreTypicalDataInDatastore();
  StudentData newStudent=dataBundle.students.get("String_Node_Str");
  newStudent.email="String_Node_Str";
  verifyAbsentInDatastore(newStudent);
  List<Submission> submissionsBeforeAdding=EvaluationsStorage.inst().getSubmissionList(newStudent.course);
  logic.createStudent(newStudent);
  verifyPresentInDatastore(newStudent);
  List<Submission> submissionsAfterAdding=EvaluationsStorage.inst().getSubmissionList(newStudent.course);
  assertEquals(submissionsBeforeAdding.size() + 18,submissionsAfterAdding.size());
  ______TS("String_Node_Str");
  try {
    logic.createStudent(newStudent);
    fail();
  }
 catch (  EntityAlreadyExistsException e) {
  }
  ______TS("String_Node_Str");
  verifyNullPointerException(methodName,"String_Node_Str",paramTypes,new Object[]{null});
}
Program: 62989
Project: 62989
Buggy source:
public ArrayList<EvaluationData> getEvaluationsSummaryForCourse(String courseId){
  ArrayList<EvaluationData> evaluationsSummaryList=new ArrayList<EvaluationData>();
  List<Evaluation> evaluationList=getEvaluationList(courseId);
  for (  Evaluation e : evaluationList) {
    EvaluationData ed=new EvaluationData();
    ed.course=e.getCourseID();
    ed.name=e.getName();
    ed.instructions=e.getInstructions();
    ed.p2pEnabled=e.isCommentsEnabled();
    ed.startTime=e.getStart();
    ed.endTime=e.getDeadline();
    ed.timeZone=e.getTimeZone();
    ed.gracePeriod=e.getGracePeriod();
    ed.published=e.isPublished();
    ed.activated=e.isActivated();
    ed.submittedTotal=getNumberOfCompletedEvaluations(e.getCourseID(),e.getName());
    ed.expectedTotal=getNumberOfEvaluations(e.getCourseID(),e.getName());
    evaluationsSummaryList.add(ed);
  }
  return evaluationsSummaryList;
}

Fixed version (ground truth):
public ArrayList<EvaluationData> getEvaluationsSummaryForCourse(String courseId){
  ArrayList<EvaluationData> evaluationsSummaryList=new ArrayList<EvaluationData>();
  List<Evaluation> evaluationList=getEvaluationList(courseId);
  for (  Evaluation e : evaluationList) {
    EvaluationData ed=new EvaluationData();
    ed.course=e.getCourseID();
    ed.name=e.getName();
    ed.instructions=e.getInstructions();
    ed.p2pEnabled=e.isCommentsEnabled();
    ed.startTime=e.getStart();
    ed.endTime=e.getDeadline();
    ed.timeZone=e.getTimeZone();
    ed.gracePeriod=e.getGracePeriod();
    ed.published=e.isPublished();
    ed.activated=e.isActivated();
    evaluationsSummaryList.add(ed);
  }
  return evaluationsSummaryList;
}
Program: 62990
Project: 62990
Buggy source:
private boolean isOrphanSubmission(StudentData reviewer,StudentData reviewee,Submission submission){
  if (!submission.getTeamName().equals(reviewer.team)) {
    return true;
  }
  if (!submission.getTeamName().equals(reviewee.team)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns true if either of the three objects is null or if the team in submission is different from those in two students.
 */
private boolean isOrphanSubmission(StudentData reviewer,StudentData reviewee,Submission submission){
  if ((reviewer == null) || (reviewee == null) || (submission == null)) {
    return true;
  }
  if (!submission.getTeamName().equals(reviewer.team)) {
    return true;
  }
  if (!submission.getTeamName().equals(reviewee.team)) {
    return true;
  }
  return false;
}
Program: 62991
Project: 62991
Buggy source:
private HashMap<String,SubmissionData> getSubmissionsForEvaluation(String courseId,String evaluationName) throws EntityDoesNotExistException {
  if (getEvaluation(courseId,evaluationName) == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + evaluationName + "String_Node_Str"+ courseId+ "String_Node_Str");
  }
  List<Submission> submissionsList=EvaluationsStorage.inst().getSubmissionList(courseId,evaluationName);
  HashMap<String,SubmissionData> submissionDataList=new HashMap<String,SubmissionData>();
  for (  Submission s : submissionsList) {
    SubmissionData sd=new SubmissionData(s);
    submissionDataList.put(sd.reviewer + "String_Node_Str" + sd.reviewee,sd);
  }
  return submissionDataList;
}

Fixed version (ground truth):
private HashMap<String,SubmissionData> getSubmissionsForEvaluation(String courseId,String evaluationName) throws EntityDoesNotExistException {
  if (getEvaluation(courseId,evaluationName) == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + evaluationName + "String_Node_Str"+ courseId+ "String_Node_Str");
  }
  List<StudentData> students=getStudentListForCourse(courseId);
  List<Submission> submissionsList=EvaluationsStorage.inst().getSubmissionList(courseId,evaluationName);
  submissionsList=purgeOrphanSubmissions(students,submissionsList);
  HashMap<String,SubmissionData> submissionDataList=new HashMap<String,SubmissionData>();
  for (  Submission s : submissionsList) {
    SubmissionData sd=new SubmissionData(s);
    submissionDataList.put(sd.reviewer + "String_Node_Str" + sd.reviewee,sd);
  }
  return submissionDataList;
}
Program: 62993
Project: 62993
Buggy source:
/** 
 * Access: course owner and above
 */
public void createStudent(StudentData studentData) throws EntityAlreadyExistsException, InvalidParametersException {
  Common.verifyNotNull(studentData,"String_Node_Str");
  verifyCourseOwnerOrAbove(studentData.course);
  Student student=new Student(studentData);
  if (student.getID() == null) {
    student.setID("String_Node_Str");
  }
  if (student.getComments() == null) {
    student.setComments("String_Node_Str");
  }
  if (student.getTeamName() == null) {
    student.setTeamName("String_Node_Str");
  }
  CoursesStorage.inst().createStudent(student);
}

Fixed version (ground truth):
/** 
 * Creates a student and adjust existing evaluations to  accommodate the new student Access: course owner and above
 */
public void createStudent(StudentData studentData) throws EntityAlreadyExistsException, InvalidParametersException {
  Common.verifyNotNull(studentData,"String_Node_Str");
  verifyCourseOwnerOrAbove(studentData.course);
  Student student=new Student(studentData);
  if (student.getID() == null) {
    student.setID("String_Node_Str");
  }
  if (student.getComments() == null) {
    student.setComments("String_Node_Str");
  }
  if (student.getTeamName() == null) {
    student.setTeamName("String_Node_Str");
  }
  CoursesStorage.inst().createStudent(student);
  EvaluationsStorage.inst().adjustSubmissions(student.getCourseID());
}
Program: 62994
Project: 62994
Buggy source:
@Test public void testCreateStudent() throws Exception {
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  String methodName="String_Node_Str";
  Class<?>[] paramTypes=new Class<?>[]{StudentData.class};
  StudentData s=new StudentData("String_Node_Str","String_Node_Str");
  Object[] params=new Object[]{s};
  verifyCannotAccess(USER_TYPE_NOT_LOGGED_IN,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_UNREGISTERED,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_STUDENT,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_COORD,methodName,"String_Node_Str",paramTypes,new Object[]{new StudentData("String_Node_Str","String_Node_Str")});
  verifyCanAccess(USER_TYPE_COORD,methodName,"String_Node_Str",paramTypes,params);
  ______TS("String_Node_Str");
  loginAsAdmin("String_Node_Str");
  StudentData newStudent=new StudentData("String_Node_Str","String_Node_Str");
  verifyAbsentInDatastore(newStudent);
  logic.createStudent(newStudent);
  verifyPresentInDatastore(newStudent);
  ______TS("String_Node_Str");
  try {
    logic.createStudent(newStudent);
    fail();
  }
 catch (  EntityAlreadyExistsException e) {
  }
  ______TS("String_Node_Str");
  verifyNullPointerException(methodName,"String_Node_Str",paramTypes,new Object[]{null});
}

Fixed version (ground truth):
@Test public void testCreateStudent() throws Exception {
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  String methodName="String_Node_Str";
  Class<?>[] paramTypes=new Class<?>[]{StudentData.class};
  StudentData s=new StudentData("String_Node_Str","String_Node_Str");
  Object[] params=new Object[]{s};
  verifyCannotAccess(USER_TYPE_NOT_LOGGED_IN,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_UNREGISTERED,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_STUDENT,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_COORD,methodName,"String_Node_Str",paramTypes,new Object[]{new StudentData("String_Node_Str","String_Node_Str")});
  verifyCanAccess(USER_TYPE_COORD,methodName,"String_Node_Str",paramTypes,params);
  ______TS("String_Node_Str");
  loginAsAdmin("String_Node_Str");
  restoreTypicalDataInDatastore();
  StudentData newStudent=dataBundle.students.get("String_Node_Str");
  newStudent.email="String_Node_Str";
  verifyAbsentInDatastore(newStudent);
  List<Submission> submissionsBeforeAdding=EvaluationsStorage.inst().getSubmissionList(newStudent.course);
  logic.createStudent(newStudent);
  verifyPresentInDatastore(newStudent);
  List<Submission> submissionsAfterAdding=EvaluationsStorage.inst().getSubmissionList(newStudent.course);
  assertEquals(submissionsBeforeAdding.size() + 18,submissionsAfterAdding.size());
  ______TS("String_Node_Str");
  try {
    logic.createStudent(newStudent);
    fail();
  }
 catch (  EntityAlreadyExistsException e) {
  }
  ______TS("String_Node_Str");
  verifyNullPointerException(methodName,"String_Node_Str",paramTypes,new Object[]{null});
}
Program: 62995
Project: 62995
Buggy source:
public List<CourseData> getCourseListForStudent(String googleId){
  List<Student> studentList=getStudentCourseList(googleId);
  ArrayList<CourseData> courseList=new ArrayList<CourseData>();
  for (  Student s : studentList) {
    CourseData c=new CourseData();
    c.id=s.getCourseID();
    c.name=CoursesStorage.inst().getCourse(c.id).getName();
    courseList.add(c);
  }
  return courseList;
}

Fixed version (ground truth):
public List<CourseData> getCourseListForStudent(String googleId){
  List<Student> studentList=getStudentListForGoogleId(googleId);
  ArrayList<CourseData> courseList=new ArrayList<CourseData>();
  for (  Student s : studentList) {
    CourseData c=new CourseData();
    c.id=s.getCourseID();
    c.name=CoursesStorage.inst().getCourse(c.id).getName();
    courseList.add(c);
  }
  return courseList;
}
Program: 62996
Project: 62996
Buggy source:
/** 
 * Edit an evaluation through the UI. Pre-condition: Should be at Evaluation page.
 * @param startTime Format: (YYYY,MM,DD)
 * @param nextTimeValue Format: HHMM
 * @param comments
 * @param instructions
 * @param gracePeriod
 */
public void editEvaluation(Date startTime,Date endTime,boolean p2pEnabled,String instructions,Integer gracePeriod){
  JavascriptExecutor js=(JavascriptExecutor)driver;
  js.executeScript("String_Node_Str" + Common.PARAM_EVALUATION_START + "String_Node_Str"+ Common.formatDate(startTime)+ "String_Node_Str");
  selectDropdownByValue(inputOpeningTime,Common.formatTimeForEvaluation(startTime));
  js.executeScript("String_Node_Str" + Common.PARAM_EVALUATION_DEADLINE + "String_Node_Str"+ Common.formatDate(endTime)+ "String_Node_Str");
  selectDropdownByValue(inputClosingTime,Common.formatTimeForEvaluation(endTime));
  if (p2pEnabled) {
    clickWithWait(By.id("String_Node_Str"));
  }
 else {
    clickWithWait(By.id("String_Node_Str"));
  }
  fillString(inputInstruction,instructions);
  selectDropdownByValue(inputGracePeriod,Integer.toString(gracePeriod));
  clickWithWait(editEvaluationButton);
}

Fixed version (ground truth):
/** 
 * Edit an evaluation through the UI. Pre-condition: Should be at Evaluation page.
 * @param startTime Format: (YYYY,MM,DD)
 * @param nextTimeValue Format: HHMM
 * @param comments
 * @param instructions
 * @param gracePeriod
 */
public void editEvaluation(Date startTime,Date endTime,boolean p2pEnabled,String instructions,Integer gracePeriod){
  JavascriptExecutor js=(JavascriptExecutor)driver;
  js.executeScript("String_Node_Str" + Common.PARAM_EVALUATION_START + "String_Node_Str"+ Common.formatDate(startTime)+ "String_Node_Str");
  selectDropdownByValue(inputOpeningTime,Common.convertToOptionValueInTimeDropDown(startTime));
  js.executeScript("String_Node_Str" + Common.PARAM_EVALUATION_DEADLINE + "String_Node_Str"+ Common.formatDate(endTime)+ "String_Node_Str");
  selectDropdownByValue(inputClosingTime,Common.convertToOptionValueInTimeDropDown(endTime));
  if (p2pEnabled) {
    clickWithWait(By.id("String_Node_Str"));
  }
 else {
    clickWithWait(By.id("String_Node_Str"));
  }
  fillString(inputInstruction,instructions);
  selectDropdownByValue(inputGracePeriod,Integer.toString(gracePeriod));
  clickWithWait(editEvaluationButton);
}
Program: 62997
Project: 62997
Buggy source:
@Test public void testCoordEval(){
  bi.loginCoord(coordUsername,coordPassword);
  ______TS("String_Node_Str");
  link=Common.PAGE_COORD_EVAL;
  verifyPageContains(link,coordUsername + "String_Node_Str" + ownCourse.id);
  ______TS("String_Node_Str");
  bi.addEvaluation(ownCourse.id,"String_Node_Str",Common.getDateOffsetToCurrentTime(1),Common.getDateOffsetToCurrentTime(2),true,"String_Node_Str",0);
  assertContainsRegex(coordUsername + "String_Node_Str" + Common.MESSAGE_EVALUATION_ADDED,bi.getCurrentPageSource());
  ______TS("String_Node_Str");
  verifyCannotMasquerade(link,otherCoord.id);
}

Fixed version (ground truth):
public void testCoordEval(){
  bi.loginCoord(coordUsername,coordPassword);
  ______TS("String_Node_Str");
  link=Common.PAGE_COORD_EVAL;
  verifyPageContains(link,coordUsername + "String_Node_Str" + ownCourse.id);
  ______TS("String_Node_Str");
  bi.addEvaluation(ownCourse.id,"String_Node_Str",Common.getDateOffsetToCurrentTime(1),Common.getDateOffsetToCurrentTime(2),true,"String_Node_Str",0);
  assertContainsRegex(coordUsername + "String_Node_Str" + Common.MESSAGE_EVALUATION_ADDED,bi.getCurrentPageSource());
  ______TS("String_Node_Str");
  verifyCannotMasquerade(link,otherCoord.id);
}
Program: 62998
Project: 62998
Buggy source:
/** 
 * Access: owner and above
 * @param evaluation
 * @throws EntityDoesNotExistException
 * @throws InvalidParametersException
 */
public void editEvaluation(EvaluationData evaluation) throws EntityDoesNotExistException, InvalidParametersException {
  Common.verifyNotNull(evaluation,"String_Node_Str");
  verifyCourseOwnerOrAbove(evaluation.course);
  evaluation.validate();
  Evaluations.inst().editEvaluation(evaluation.course,evaluation.name,evaluation.instructions,evaluation.p2pEnabled,evaluation.startTime,evaluation.endTime,evaluation.gracePeriod,evaluation.activated,evaluation.published,evaluation.timeZone);
}

Fixed version (ground truth):
/** 
 * Can be used to change all fields exception "activated" field Access: owner and above
 * @param evaluation
 * @throws EntityDoesNotExistException
 * @throws InvalidParametersException
 */
public void editEvaluation(String courseId,String evaluationName,String instructions,Date start,Date end,double timeZone,int gracePeriod,boolean p2pEndabled) throws EntityDoesNotExistException, InvalidParametersException {
  Common.verifyNotNull(courseId,"String_Node_Str");
  Common.verifyNotNull(evaluationName,"String_Node_Str");
  Common.verifyNotNull(start,"String_Node_Str");
  Common.verifyNotNull(end,"String_Node_Str");
  verifyCourseOwnerOrAbove(courseId);
  EvaluationData original=getEvaluation(courseId,evaluationName);
  if (original == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + evaluationName + "String_Node_Str"+ courseId);
  }
  EvaluationData evaluation=new EvaluationData();
  evaluation.course=courseId;
  evaluation.name=evaluationName;
  evaluation.instructions=instructions;
  evaluation.p2pEnabled=p2pEndabled;
  evaluation.startTime=start;
  evaluation.endTime=end;
  evaluation.gracePeriod=gracePeriod;
  evaluation.timeZone=timeZone;
  evaluation.activated=original.activated;
  evaluation.published=original.published;
  evaluation.validate();
  editEvaluationAllFields(evaluation);
}
Program: 62999
Project: 62999
Buggy source:
@Override protected void doAction(HttpServletRequest req,CoordEvalEditHelper helper) throws EntityDoesNotExistException {
  EvaluationData newEval=CoordEvalServlet.extractEvaluationData(req);
  if (newEval.course == null && newEval.name == null) {
    helper.redirectUrl=Common.PAGE_COORD_EVAL;
    return;
  }
  boolean isSubmit=isPost;
  if (isSubmit) {
    helper.submittedEval=newEval;
    try {
      helper.server.editEvaluation(newEval);
      helper.statusMessage=Common.MESSAGE_EVALUATION_EDITED;
      helper.redirectUrl=Common.PAGE_COORD_EVAL;
    }
 catch (    InvalidParametersException e) {
      helper.statusMessage=e.getMessage();
      helper.error=true;
    }
  }
 else {
    helper.submittedEval=helper.server.getEvaluation(newEval.course,newEval.name);
    if (helper.submittedEval == null) {
      helper.redirectUrl=Common.PAGE_COORD_EVAL;
      return;
    }
  }
}

Fixed version (ground truth):
@Override protected void doAction(HttpServletRequest req,CoordEvalEditHelper helper) throws EntityDoesNotExistException {
  EvaluationData newEval=CoordEvalServlet.extractEvaluationData(req);
  if (newEval.course == null && newEval.name == null) {
    helper.redirectUrl=Common.PAGE_COORD_EVAL;
    return;
  }
  boolean isSubmit=isPost;
  if (isSubmit) {
    helper.submittedEval=newEval;
    try {
      helper.server.editEvaluation(newEval.course,newEval.name,newEval.instructions,newEval.startTime,newEval.endTime,newEval.timeZone,newEval.gracePeriod,newEval.p2pEnabled);
      helper.statusMessage=Common.MESSAGE_EVALUATION_EDITED;
      helper.redirectUrl=Common.PAGE_COORD_EVAL;
    }
 catch (    InvalidParametersException ex) {
      helper.statusMessage=ex.getMessage();
      helper.error=true;
    }
  }
 else {
    helper.submittedEval=helper.server.getEvaluation(newEval.course,newEval.name);
    if (helper.submittedEval == null) {
      helper.redirectUrl=Common.PAGE_COORD_EVAL;
      return;
    }
  }
}
Program: 63000
Project: 63000
Buggy source:
@Test public void testEditEvaluation(){
  refreshDataInDatastore();
  EvaluationData e=dataBundle.evaluations.get("String_Node_Str");
  e.gracePeriod=e.gracePeriod + 1;
  e.instructions=e.instructions + "String_Node_Str";
  e.p2pEnabled=(!e.p2pEnabled);
  e.startTime=Common.getDateOffsetToCurrentTime(-2);
  e.endTime=Common.getDateOffsetToCurrentTime(-1);
  e.activated=(!e.activated);
  e.published=(!e.published);
  e.timeZone=e.timeZone + 1.0;
  String status=BackDoor.editEvaluation(e);
  assertEquals(Common.BACKEND_STATUS_SUCCESS,status);
  verifyPresentInDatastore(e);
  e.name="String_Node_Str";
  status=BackDoor.editEvaluation(e);
  assertTrue(status.startsWith(Common.BACKEND_STATUS_FAILURE));
  verifyAbsentInDatastore(e);
}

Fixed version (ground truth):
@Test public void testEditEvaluation(){
  refreshDataInDatastore();
  EvaluationData e=dataBundle.evaluations.get("String_Node_Str");
  e.gracePeriod=e.gracePeriod + 1;
  e.instructions=e.instructions + "String_Node_Str";
  e.p2pEnabled=(!e.p2pEnabled);
  e.startTime=Common.getDateOffsetToCurrentTime(-2);
  e.endTime=Common.getDateOffsetToCurrentTime(-1);
  e.activated=(!e.activated);
  e.published=(!e.published);
  e.timeZone=e.timeZone + 1.0;
  String status=BackDoor.editEvaluation(e);
  assertEquals(Common.BACKEND_STATUS_SUCCESS,status);
  verifyPresentInDatastore(e);
}
Program: 63007
Project: 63007
Buggy source:
/** 
 * Access: course owner and above
 * @throws EntityDoesNotExistException
 */
public CourseData getCourseDetails(String courseId) throws EntityDoesNotExistException {
  verifyCourseOwnerOrAbove(courseId);
  CourseData course=getCourse(courseId);
  if (course == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + courseId);
  }
  HashMap<String,CourseData> courseList=getCourseDetailsListForCoord(course.coord);
  return courseList.get(courseId);
}

Fixed version (ground truth):
/** 
 * Access: course owner, student in course, admin
 * @throws EntityDoesNotExistException
 */
public CourseData getCourseDetails(String courseId) throws EntityDoesNotExistException {
  verifyCourseOwnerOrStudentInCourse(courseId);
  CourseData course=getCourse(courseId);
  if (course == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + courseId);
  }
  HashMap<String,CourseData> courseList=getCourseDetailsListForCoord(course.coord);
  return courseList.get(courseId);
}
Program: 63008
Project: 63008
Buggy source:
/** 
 * Access: student who owns the googleId, admin
 * @param googleId
 * @return
 * @throws EntityDoesNotExistException
 * @throws InvalidParametersException
 */
public List<CourseData> getCourseListForStudent(String googleId) throws EntityDoesNotExistException, InvalidParametersException {
  Common.verifyNotNull(googleId,"String_Node_Str");
  verifySameStudentOrAdmin(googleId);
  if (getStudentsWithId(googleId) == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + googleId + "String_Node_Str");
  }
  return Courses.inst().getCourseListForStudent(googleId);
}

Fixed version (ground truth):
/** 
 * Access: student who owns the googleId, admin
 * @param googleId
 * @return
 * @throws EntityDoesNotExistException
 * @throws InvalidParametersException
 */
public List<CourseData> getCourseListForStudent(String googleId) throws EntityDoesNotExistException, InvalidParametersException {
  Common.verifyNotNull(googleId,"String_Node_Str");
  verifySameStudentOrAdmin(googleId);
  if (getStudentsWithId(googleId).size() == 0) {
    throw new EntityDoesNotExistException("String_Node_Str" + googleId + "String_Node_Str");
  }
  return Courses.inst().getCourseListForStudent(googleId);
}
Program: 63009
Project: 63009
Buggy source:
/** 
 * Access: same student and admin only
 * @param googleId
 * @return
 */
public ArrayList<StudentData> getStudentsWithId(String googleId){
  verifySameStudentOrAdmin(googleId);
  List<Student> students=Accounts.inst().getStudentWithID(googleId);
  if (students == null) {
    return null;
  }
  ArrayList<StudentData> returnList=new ArrayList<StudentData>();
  for (  Student s : students) {
    returnList.add(new StudentData(s));
  }
  return returnList;
}

Fixed version (ground truth):
/** 
 * Access: same student and admin only
 * @param googleId
 * @return returns null if 
 */
public ArrayList<StudentData> getStudentsWithId(String googleId){
  verifySameStudentOrAdmin(googleId);
  List<Student> students=Accounts.inst().getStudentsWithID(googleId);
  ArrayList<StudentData> returnList=new ArrayList<StudentData>();
  for (  Student s : students) {
    returnList.add(new StudentData(s));
  }
  return returnList;
}
Program: 63010
Project: 63010
Buggy source:
/** 
 * @param courseId
 * @return The CourseData object that is returned will contain attributesteams(type:TeamData) and loners(type:StudentData)
 * @throws EntityDoesNotExistException if the course does not exist <br> Access : course owner and above
 */
public CourseData getTeamsForCourse(String courseId) throws EntityDoesNotExistException {
  if (courseId == null) {
    return null;
  }
  verifyCourseOwnerOrAbove(courseId);
  List<StudentData> students=getStudentListForCourse(courseId);
  Courses.sortByTeamName(students);
  CourseData course=getCourse(courseId);
  if (course == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + courseId + "String_Node_Str");
  }
  TeamData team=null;
  for (int i=0; i < students.size(); i++) {
    StudentData s=students.get(i);
    if (s.team.equals("String_Node_Str")) {
      course.loners.add(s);
    }
 else     if (team == null) {
      team=new TeamData();
      team.name=s.team;
      team.students.add(s);
    }
 else     if (s.team.equals(team.name)) {
      team.students.add(s);
    }
 else {
      course.teams.add(team);
      team=new TeamData();
      team.name=s.team;
      team.students.add(s);
    }
    if (i == (students.size() - 1)) {
      course.teams.add(team);
    }
  }
  return course;
}

Fixed version (ground truth):
/** 
 * Access: course owner, student in course, admin
 * @param courseId
 * @return The CourseData object that is returned will contain attributesteams(type:TeamData) and loners(type:StudentData)
 * @throws EntityDoesNotExistException if the course does not exist <br> Access : course owner and above
 */
public CourseData getTeamsForCourse(String courseId) throws EntityDoesNotExistException {
  if (courseId == null) {
    return null;
  }
  verifyCourseOwnerOrStudentInCourse(courseId);
  List<StudentData> students=getStudentListForCourse(courseId);
  Courses.sortByTeamName(students);
  CourseData course=getCourse(courseId);
  if (course == null) {
    throw new EntityDoesNotExistException("String_Node_Str" + courseId + "String_Node_Str");
  }
  TeamData team=null;
  for (int i=0; i < students.size(); i++) {
    StudentData s=students.get(i);
    if (s.team.equals("String_Node_Str")) {
      course.loners.add(s);
    }
 else     if (team == null) {
      team=new TeamData();
      team.name=s.team;
      team.students.add(s);
    }
 else     if (s.team.equals(team.name)) {
      team.students.add(s);
    }
 else {
      course.teams.add(team);
      team=new TeamData();
      team.name=s.team;
      team.students.add(s);
    }
    if (i == (students.size() - 1)) {
      course.teams.add(team);
    }
  }
  return course;
}
Program: 63011
Project: 63011
Buggy source:
public boolean isStudent(String googleId){
  return getStudentWithID(googleId) != null;
}

Fixed version (ground truth):
public boolean isStudent(String googleId){
  return getStudentsWithID(googleId).size() != 0;
}
Program: 63012
Project: 63012
Buggy source:
private void verifyAccessLevel(boolean isUnauthExceptionExpected,int userType,String methodName,String userId,Class<?>[] paramTypes,Object[] params) throws Exception {
  Method method=Logic.class.getDeclaredMethod(methodName,paramTypes);
switch (userType) {
case USER_TYPE_NOT_LOGGED_IN:
    logoutUser();
  break;
case USER_TYPE_UNREGISTERED:
loginUser(userId);
break;
case USER_TYPE_STUDENT:
loginAsStudent(userId);
break;
case USER_TYPE_COORD:
loginAsCoord(userId);
break;
}
try {
method.setAccessible(true);
method.invoke(logic,params);
if (isUnauthExceptionExpected) {
fail();
}
}
 catch (Exception e) {
String stack=TeammatesException.stackTraceToString(e);
if (isUnauthExceptionExpected) {
assertEquals(stack,UnauthorizedAccessException.class,e.getCause().getClass());
}
 else {
assertTrue(stack,e.getCause() == null || UnauthorizedAccessException.class != e.getCause().getClass());
}
}
}

Fixed version (ground truth):
private void verifyAccessLevel(boolean isUnauthExceptionExpected,int userType,String methodName,String userId,Class<?>[] paramTypes,Object[] params) throws Exception {
  Method method=Logic.class.getDeclaredMethod(methodName,paramTypes);
switch (userType) {
case USER_TYPE_NOT_LOGGED_IN:
    logoutUser();
  break;
case USER_TYPE_UNREGISTERED:
loginUser(userId);
break;
case USER_TYPE_STUDENT:
loginAsStudent(userId);
break;
case USER_TYPE_COORD:
loginAsCoord(userId);
break;
}
try {
method.setAccessible(true);
method.invoke(logic,params);
if (isUnauthExceptionExpected) {
fail();
}
}
 catch (Exception e) {
String stack=TeammatesException.stackTraceToString(e);
if (isUnauthExceptionExpected) {
assertEquals("String_Node_Str" + stack,UnauthorizedAccessException.class,e.getCause().getClass());
}
 else {
assertTrue("String_Node_Str" + stack,e.getCause() == null || UnauthorizedAccessException.class != e.getCause().getClass());
}
}
}
Program: 63017
Project: 63017
Buggy source:
private EvaluationData extractEvaluationData(HttpServletRequest req){
  EvaluationData newEval=new EvaluationData();
  newEval.course=req.getParameter(Common.PARAM_COURSE_ID);
  newEval.name=req.getParameter(Common.PARAM_EVALUATION_NAME);
  newEval.p2pEnabled=Boolean.parseBoolean(req.getParameter(Common.PARAM_EVALUATION_COMMENTSENABLED));
  newEval.startTime=combineDateTime(req.getParameter(Common.PARAM_EVALUATION_START),req.getParameter(Common.PARAM_EVALUATION_STARTTIME));
  newEval.endTime=combineDateTime(req.getParameter(Common.PARAM_EVALUATION_DEADLINE),req.getParameter(Common.PARAM_EVALUATION_DEADLINETIME));
  String paramTimeZone=req.getParameter(Common.PARAM_EVALUATION_TIMEZONE);
  if (paramTimeZone != null) {
    newEval.timeZone=Double.parseDouble(paramTimeZone);
  }
  String paramGracePeriod=req.getParameter(Common.PARAM_EVALUATION_GRACEPERIOD);
  if (paramGracePeriod != null) {
    newEval.gracePeriod=Integer.parseInt(paramGracePeriod);
  }
  newEval.instructions=req.getParameter(Common.PARAM_EVALUATION_INSTRUCTIONS);
  return newEval;
}

Fixed version (ground truth):
public static EvaluationData extractEvaluationData(HttpServletRequest req){
  EvaluationData newEval=new EvaluationData();
  newEval.course=req.getParameter(Common.PARAM_COURSE_ID);
  newEval.name=req.getParameter(Common.PARAM_EVALUATION_NAME);
  newEval.p2pEnabled=Boolean.parseBoolean(req.getParameter(Common.PARAM_EVALUATION_COMMENTSENABLED));
  newEval.startTime=combineDateTime(req.getParameter(Common.PARAM_EVALUATION_START),req.getParameter(Common.PARAM_EVALUATION_STARTTIME));
  newEval.endTime=combineDateTime(req.getParameter(Common.PARAM_EVALUATION_DEADLINE),req.getParameter(Common.PARAM_EVALUATION_DEADLINETIME));
  String paramTimeZone=req.getParameter(Common.PARAM_EVALUATION_TIMEZONE);
  if (paramTimeZone != null) {
    newEval.timeZone=Double.parseDouble(paramTimeZone);
  }
  String paramGracePeriod=req.getParameter(Common.PARAM_EVALUATION_GRACEPERIOD);
  if (paramGracePeriod != null) {
    newEval.gracePeriod=Integer.parseInt(paramGracePeriod);
  }
  newEval.instructions=req.getParameter(Common.PARAM_EVALUATION_INSTRUCTIONS);
  return newEval;
}
Program: 63018
Project: 63018
Buggy source:
private Date combineDateTime(String inputDate,String inputTime){
  if (inputDate == null || inputTime == null) {
    return null;
  }
  int inputTimeInt=0;
  if (inputTime != null) {
    inputTimeInt=Integer.parseInt(inputTime) * 100;
  }
  return Common.convertToDate(inputDate,inputTimeInt);
}

Fixed version (ground truth):
public static Date combineDateTime(String inputDate,String inputTime){
  if (inputDate == null || inputTime == null) {
    return null;
  }
  int inputTimeInt=0;
  if (inputTime != null) {
    inputTimeInt=Integer.parseInt(inputTime) * 100;
  }
  return Common.convertToDate(inputDate,inputTimeInt);
}
Program: 63020
Project: 63020
Buggy source:
@Test public void testCoordEvalEditHTML() throws Exception {
  printTestCaseHeader("String_Node_Str");
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
}

Fixed version (ground truth):
@Test public void testCoordEvalEditHTML() throws Exception {
  printTestCaseHeader();
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
}
Program: 63021
Project: 63021
Buggy source:
@BeforeClass public static void classSetup() throws Exception {
  printTestClassHeader("String_Node_Str");
  ts=loadTestScenario();
  System.out.println("String_Node_Str" + ts.coordinator.id);
  long start=System.currentTimeMillis();
  BackDoor.deleteCoord(ts.coordinator.id);
  BackDoor.createCoord(ts.coordinator);
  BackDoor.createCourse(ts.course);
  BackDoor.createEvaluation(ts.evaluation);
  System.out.println("String_Node_Str" + (System.currentTimeMillis() - start) + "String_Node_Str");
  bi=BrowserInstancePool.getBrowserInstance();
  bi.loginAdmin(Config.inst().TEAMMATES_ADMIN_ACCOUNT,Config.inst().TEAMMATES_ADMIN_PASSWORD);
  String link=appUrl + Common.PAGE_COORD_EVAL_EDIT;
  link=Helper.addParam(link,Common.PARAM_COURSE_ID,ts.evaluation.course);
  link=Helper.addParam(link,Common.PARAM_EVALUATION_NAME,ts.evaluation.name);
  link=Helper.addParam(link,Common.PARAM_USER_ID,ts.coordinator.id);
  bi.goToUrl(link);
}

Fixed version (ground truth):
@BeforeClass public static void classSetup() throws Exception {
  printTestClassHeader();
  ts=loadTestScenario();
  print("String_Node_Str" + ts.coordinator.id);
  long start=System.currentTimeMillis();
  BackDoor.deleteCoord(ts.coordinator.id);
  BackDoor.createCoord(ts.coordinator);
  BackDoor.createCourse(ts.course);
  BackDoor.createEvaluation(ts.evaluation);
  print("String_Node_Str" + (System.currentTimeMillis() - start) + "String_Node_Str");
  bi=BrowserInstancePool.getBrowserInstance();
  bi.loginAdmin(Config.inst().TEAMMATES_ADMIN_ACCOUNT,Config.inst().TEAMMATES_ADMIN_PASSWORD);
  String link=appUrl + Common.PAGE_COORD_EVAL_EDIT;
  link=Helper.addParam(link,Common.PARAM_COURSE_ID,ts.evaluation.course);
  link=Helper.addParam(link,Common.PARAM_EVALUATION_NAME,ts.evaluation.name);
  link=Helper.addParam(link,Common.PARAM_USER_ID,ts.coordinator.id);
  bi.goToUrl(link);
}