nus-yam/ex-repair huggingface dataset:
Program: 62673
Project: 62673
Buggy source:
void processForCompatibility(){
  final MergeRequestObjectAttributes attributes=this.mergeRequestHook.getObjectAttributes();
  if (attributes != null) {
    final Project source=attributes.getSource();
    if (source != null && source.getHttpUrl() != null) {
      if (source.getUrl() == null) {
        source.setUrl(source.getHttpUrl());
      }
      if (source.getHomepage() == null) {
        source.setHomepage(source.getHttpUrl().substring(0,source.getHttpUrl().lastIndexOf("String_Node_Str")));
      }
    }
  }
}

Fixed version (ground truth):
void processForCompatibility(){
  final MergeRequestObjectAttributes attributes=this.mergeRequestHook.getObjectAttributes();
  if (attributes != null) {
    final Project source=attributes.getSource();
    if (source != null && source.getHttpUrl() != null) {
      if (source.getUrl() == null) {
        source.setUrl(source.getHttpUrl());
      }
      if (source.getHomepage() == null) {
        source.setHomepage(source.getHttpUrl().substring(0,source.getHttpUrl().lastIndexOf("String_Node_Str")));
      }
    }
    if (mergeRequestHook.getProject() == null && attributes.getTarget() != null) {
      mergeRequestHook.setProject(attributes.getTarget());
    }
  }
}
Program: 62674
Project: 62674
Buggy source:
@Test public void build() throws IOException {
  FreeStyleProject testProject=jenkins.createFreeStyleProject();
  testProject.addTrigger(trigger);
  exception.expect(HttpResponses.HttpResponseException.class);
  new MergeRequestBuildAction(testProject,getJson("String_Node_Str"),null).execute(response);
  verify(trigger).onPost(any(MergeRequestHook.class));
}

Fixed version (ground truth):
@Test public void build() throws IOException {
  try {
    FreeStyleProject testProject=jenkins.createFreeStyleProject();
    testProject.addTrigger(trigger);
    exception.expect(HttpResponses.HttpResponseException.class);
    new MergeRequestBuildAction(testProject,getJson("String_Node_Str"),null).execute(response);
  }
  finally {
    ArgumentCaptor<MergeRequestHook> pushHookArgumentCaptor=ArgumentCaptor.forClass(MergeRequestHook.class);
    verify(trigger).onPost(pushHookArgumentCaptor.capture());
    assertThat(pushHookArgumentCaptor.getValue().getProject(),is(notNullValue()));
    assertThat(pushHookArgumentCaptor.getValue().getProject().getWebUrl(),is(notNullValue()));
  }
}
Program: 62675
Project: 62675
Buggy source:
@Test public void build() throws IOException {
  FreeStyleProject testProject=jenkins.createFreeStyleProject();
  when(trigger.getTriggerOpenMergeRequestOnPush()).thenReturn(TriggerOpenMergeRequest.never);
  testProject.addTrigger(trigger);
  exception.expect(HttpResponses.HttpResponseException.class);
  new PushBuildAction(testProject,getJson("String_Node_Str"),null).execute(response);
  verify(trigger).onPost(any(PushHook.class));
}

Fixed version (ground truth):
@Test public void build() throws IOException {
  try {
    FreeStyleProject testProject=jenkins.createFreeStyleProject();
    when(trigger.getTriggerOpenMergeRequestOnPush()).thenReturn(TriggerOpenMergeRequest.never);
    testProject.addTrigger(trigger);
    exception.expect(HttpResponses.HttpResponseException.class);
    new PushBuildAction(testProject,getJson("String_Node_Str"),null).execute(response);
  }
  finally {
    ArgumentCaptor<PushHook> pushHookArgumentCaptor=ArgumentCaptor.forClass(PushHook.class);
    verify(trigger).onPost(pushHookArgumentCaptor.capture());
    assertThat(pushHookArgumentCaptor.getValue().getProject(),is(notNullValue()));
    assertThat(pushHookArgumentCaptor.getValue().getProject().getWebUrl(),is(notNullValue()));
  }
}
Program: 62676
Project: 62676
Buggy source:
@Initializer(after=InitMilestone.JOB_LOADED) public static void migrateJobs() throws IOException {
  GitLabPushTrigger.DescriptorImpl oldConfig=Trigger.all().get(GitLabPushTrigger.DescriptorImpl.class);
  if (!oldConfig.jobsMigrated) {
    GitLabConnectionConfig gitLabConfig=(GitLabConnectionConfig)Jenkins.getInstance().getDescriptor(GitLabConnectionConfig.class);
    gitLabConfig.getConnections().add(new GitLabConnection(oldConfig.gitlabHostUrl,oldConfig.gitlabHostUrl,oldConfig.gitlabApiToken,oldConfig.ignoreCertificateErrors,10,10));
    String defaultConnectionName=gitLabConfig.getConnections().get(0).getName();
    for (    AbstractProject<?,?> project : Jenkins.getInstance().getAllItems(AbstractProject.class)) {
      GitLabPushTrigger trigger=project.getTrigger(GitLabPushTrigger.class);
      if (trigger != null) {
        if (trigger.addCiMessage) {
          project.getPublishersList().add(new GitLabCommitStatusPublisher("String_Node_Str"));
        }
        if (trigger.branchFilterType == null) {
          trigger.branchFilterType=trigger.branchFilterName;
        }
        project.addProperty(new GitLabConnectionProperty(defaultConnectionName));
        project.save();
      }
    }
    gitLabConfig.save();
    oldConfig.jobsMigrated=true;
    oldConfig.save();
  }
}

Fixed version (ground truth):
@Initializer(after=InitMilestone.JOB_LOADED) public static void migrateJobs() throws IOException {
  GitLabPushTrigger.DescriptorImpl oldConfig=Trigger.all().get(GitLabPushTrigger.DescriptorImpl.class);
  if (!oldConfig.jobsMigrated) {
    GitLabConnectionConfig gitLabConfig=(GitLabConnectionConfig)Jenkins.getInstance().getDescriptor(GitLabConnectionConfig.class);
    gitLabConfig.getConnections().add(new GitLabConnection(oldConfig.gitlabHostUrl,oldConfig.gitlabHostUrl,oldConfig.gitlabApiToken,oldConfig.ignoreCertificateErrors,10,10));
    String defaultConnectionName=gitLabConfig.getConnections().get(0).getName();
    for (    AbstractProject<?,?> project : Jenkins.getInstance().getAllItems(AbstractProject.class)) {
      GitLabPushTrigger trigger=project.getTrigger(GitLabPushTrigger.class);
      if (trigger != null) {
        if (trigger.addCiMessage) {
          project.getPublishersList().add(new GitLabCommitStatusPublisher("String_Node_Str"));
        }
        project.addProperty(new GitLabConnectionProperty(defaultConnectionName));
        project.save();
      }
    }
    gitLabConfig.save();
    oldConfig.jobsMigrated=true;
    oldConfig.save();
  }
}
Program: 62677
Project: 62677
Buggy source:
@Override protected Object readResolve() throws ObjectStreamException {
  initializeTriggerHandler();
  initializeBranchFilter();
  return super.readResolve();
}

Fixed version (ground truth):
@Override protected Object readResolve() throws ObjectStreamException {
  if (branchFilterType == null) {
    branchFilterType=StringUtils.isNotBlank(branchFilterName) ? BranchFilterType.valueOf(branchFilterName) : BranchFilterType.All;
  }
  initializeTriggerHandler();
  initializeBranchFilter();
  return super.readResolve();
}
Program: 62681
Project: 62681
Buggy source:
private static List<String> retrieveGitlabProjectIds(Run<?,?> build,EnvVars environment){
  List<String> result=new ArrayList<>();
  for (  String remoteUrl : build.getAction(BuildData.class).getRemoteUrls()) {
    try {
      result.add(ProjectIdUtil.retrieveProjectId(environment.expand(remoteUrl)));
    }
 catch (    ProjectIdUtil.ProjectIdResolutionException e) {
    }
  }
  return result;
}

Fixed version (ground truth):
private static List<String> retrieveGitlabProjectIds(Run<?,?> build,EnvVars environment){
  List<String> result=new ArrayList<>();
  GitLabApi gitLabClient=getClient(build);
  if (gitLabClient == null) {
    return result;
  }
  for (  String remoteUrl : build.getAction(BuildData.class).getRemoteUrls()) {
    try {
      String projectNameWithNameSpace=ProjectIdUtil.retrieveProjectId(environment.expand(remoteUrl));
      if (StringUtils.isNotBlank(projectNameWithNameSpace)) {
        String projectId=projectNameWithNameSpace;
        if (projectNameWithNameSpace.contains("String_Node_Str")) {
          projectId=gitLabClient.getProject(projectNameWithNameSpace).getId().toString();
        }
        result.add(projectId);
      }
    }
 catch (    ProjectIdUtil.ProjectIdResolutionException e) {
    }
  }
  return result;
}
Program: 62682
Project: 62682
Buggy source:
public static void updateCommitStatus(Run<?,?> build,TaskListener listener,BuildState state){
  String commitHash=getBuildRevision(build);
  String buildUrl=getBuildUrl(build);
  try {
    for (    String gitlabProjectId : retrieveGitlabProjectIds(build,build.getEnvironment(listener))) {
      try {
        GitLabApi client=getClient(build);
        if (client == null) {
          println(listener,"String_Node_Str");
        }
 else         if (existsCommit(client,gitlabProjectId,commitHash)) {
          client.changeBuildStatus(gitlabProjectId,commitHash,state,getBuildBranch(build),"String_Node_Str",buildUrl,null);
        }
      }
 catch (      WebApplicationException e) {
        printf(listener,"String_Node_Str",gitlabProjectId,e.getMessage());
        LOGGER.log(Level.SEVERE,String.format("String_Node_Str",gitlabProjectId),e);
      }
    }
  }
 catch (  IOException|InterruptedException e) {
    printf(listener,"String_Node_Str",e.getMessage());
  }
}

Fixed version (ground truth):
public static void updateCommitStatus(Run<?,?> build,TaskListener listener,BuildState state){
  GitLabApi client=getClient(build);
  if (client == null) {
    println(listener,"String_Node_Str");
    return;
  }
  String commitHash=getBuildRevision(build);
  String buildUrl=getBuildUrl(build);
  try {
    for (    String gitlabProjectId : retrieveGitlabProjectIds(build,build.getEnvironment(listener))) {
      try {
        if (existsCommit(client,gitlabProjectId,commitHash)) {
          client.changeBuildStatus(gitlabProjectId,commitHash,state,getBuildBranch(build),"String_Node_Str",buildUrl,null);
        }
      }
 catch (      WebApplicationException e) {
        printf(listener,"String_Node_Str",gitlabProjectId,e.getMessage());
        LOGGER.log(Level.SEVERE,String.format("String_Node_Str",gitlabProjectId),e);
      }
    }
  }
 catch (  IOException|InterruptedException e) {
    printf(listener,"String_Node_Str",e.getMessage());
  }
}
Program: 62683
Project: 62683
Buggy source:
private WebHookAction onPost(Job<?,?> project,StaplerRequest request){
  String requestBody=getRequestBody(request);
  String eventHeader=request.getHeader("String_Node_Str");
  if (StringUtils.equals(eventHeader,"String_Node_Str")) {
    return new MergeRequestBuildAction(project,requestBody);
  }
 else   if (StringUtils.equals(eventHeader,"String_Node_Str")) {
    return new PushBuildAction(project,requestBody);
  }
  LOGGER.log(Level.FINE,"String_Node_Str",eventHeader);
  return new NoopAction();
}

Fixed version (ground truth):
private WebHookAction onPost(Job<?,?> project,StaplerRequest request){
  String requestBody=getRequestBody(request);
  String eventHeader=request.getHeader("String_Node_Str");
  if (StringUtils.equals(eventHeader,"String_Node_Str")) {
    return new MergeRequestBuildAction(project,requestBody);
  }
 else   if (StringUtils.equals(eventHeader,"String_Node_Str") || StringUtils.equals(eventHeader,"String_Node_Str")) {
    return new PushBuildAction(project,requestBody);
  }
  LOGGER.log(Level.FINE,"String_Node_Str",eventHeader);
  return new NoopAction();
}
Program: 62684
Project: 62684
Buggy source:
private void handleMergeRequest(Job<?,?> job,PushHook hook,boolean ciSkip,BranchFilter branchFilter,GitLabApi client,Integer projectId,MergeRequest mergeRequest){
  if (ciSkip && mergeRequest.getDescription() != null && mergeRequest.getDescription().contains("String_Node_Str")) {
    LOGGER.log(Level.INFO,"String_Node_Str" + mergeRequest.getTitle() + "String_Node_Str");
    return;
  }
  String targetBranch=mergeRequest.getTargetBranch();
  String sourceBranch=mergeRequest.getSourceBranch();
  if (targetBranch != null && branchFilter.isBranchAllowed(targetBranch) && hook.getRef().endsWith(targetBranch) && sourceBranch != null) {
    LOGGER.log(Level.INFO,"String_Node_Str",LoggerUtil.toArray(job.getFullName(),mergeRequest.getId()));
    Branch branch=client.getBranch(projectId.toString(),sourceBranch);
    Project project=client.getProject(mergeRequest.getSourceProjectId().toString());
    scheduleBuild(job,new CauseAction(new GitLabWebHookCause(retrieveCauseData(hook,project,mergeRequest,branch))));
  }
}

Fixed version (ground truth):
private void handleMergeRequest(Job<?,?> job,PushHook hook,boolean ciSkip,BranchFilter branchFilter,GitLabApi client,Integer projectId,MergeRequest mergeRequest){
  if (ciSkip && mergeRequest.getDescription() != null && mergeRequest.getDescription().contains("String_Node_Str")) {
    LOGGER.log(Level.INFO,"String_Node_Str" + mergeRequest.getTitle() + "String_Node_Str");
    return;
  }
  String targetBranch=mergeRequest.getTargetBranch();
  String sourceBranch=mergeRequest.getSourceBranch();
  if (targetBranch != null && branchFilter.isBranchAllowed(targetBranch) && hook.getRef().endsWith(targetBranch) && sourceBranch != null) {
    LOGGER.log(Level.INFO,"String_Node_Str",LoggerUtil.toArray(job.getFullName(),mergeRequest.getId()));
    Branch branch=client.getBranch(mergeRequest.getSourceProjectId().toString(),sourceBranch);
    Project project=client.getProject(mergeRequest.getSourceProjectId().toString());
    scheduleBuild(job,new CauseAction(new GitLabWebHookCause(retrieveCauseData(hook,project,mergeRequest,branch))));
  }
}
Program: 62686
Project: 62686
Buggy source:
public List<String> getProjectBranches(){
  projectBranches=new ArrayList<String>();
  try {
    URIish sourceRepository=getSourceRepoURLDefault();
    if (!gitlabHostUrl.isEmpty() && (null != sourceRepository)) {
      List<GitlabProject> projects=getGitlab().instance().getProjects();
      for (      GitlabProject project : projects) {
        if (project.getSshUrl().equalsIgnoreCase(sourceRepository.toString())) {
          List<GitlabBranch> branches=getGitlab().instance().getBranches(project);
          for (          GitlabBranch branch : branches) {
            projectBranches.add(branch.getName());
          }
          break;
        }
      }
    }
  }
 catch (  Exception ex) {
    LOGGER.log(Level.WARNING,"String_Node_Str",new String[]{ex.toString(),ex.getMessage()});
  }
  return projectBranches;
}

Fixed version (ground truth):
public List<String> getProjectBranches(){
  projectBranches=new ArrayList<String>();
  try {
    URIish sourceRepository=getSourceRepoURLDefault();
    if (!gitlabHostUrl.isEmpty() && (null != sourceRepository)) {
      List<GitlabProject> projects=getGitlab().instance().getProjects();
      for (      GitlabProject project : projects) {
        if (project.getSshUrl().equalsIgnoreCase(sourceRepository.toString()) || project.getHttpUrl().equalsIgnoreCase(sourceRepository.toString())) {
          List<GitlabBranch> branches=getGitlab().instance().getBranches(project);
          for (          GitlabBranch branch : branches) {
            projectBranches.add(branch.getName());
          }
          break;
        }
      }
    }
  }
 catch (  Exception ex) {
    LOGGER.log(Level.WARNING,"String_Node_Str",new String[]{ex.toString(),ex.getMessage()});
  }
  return projectBranches;
}
Program: 62688
Project: 62688
Buggy source:
public void run(){
  LOGGER.log(Level.INFO,"String_Node_Str",job.getName());
  String name="String_Node_Str" + job.getNextBuildNumber();
  GitLabMergeCause cause=createGitLabMergeCause(req);
  Action[] actions=createActions(req);
  setBuildCauseInJob(req);
  if (job.scheduleBuild(job.getQuietPeriod(),cause,actions)) {
    LOGGER.log(Level.INFO,"String_Node_Str",new String[]{job.getName(),name});
  }
 else {
    LOGGER.log(Level.INFO,"String_Node_Str",job.getName());
  }
}

Fixed version (ground truth):
public void run(){
  LOGGER.log(Level.INFO,"String_Node_Str",job.getName());
  String name="String_Node_Str" + job.getNextBuildNumber();
  GitLabMergeCause cause=createGitLabMergeCause(req);
  Action[] actions=createActions(req);
  if (job.scheduleBuild(job.getQuietPeriod(),cause,actions)) {
    LOGGER.log(Level.INFO,"String_Node_Str",new String[]{job.getName(),name});
  }
 else {
    LOGGER.log(Level.INFO,"String_Node_Str",job.getName());
  }
}
Program: 62689
Project: 62689
Buggy source:
private void setBuildCauseInJob(GitLabRequest req){
  if (setJobDescription) {
    String name=req.getJenkinsBuildViewName();
    if (name != null && name.length() > 0) {
      try {
        job.setDisplayName(name);
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
private void setBuildCauseInJob(AbstractBuild abstractBuild){
  if (setBuildDescription) {
    Cause pcause=abstractBuild.getCause(GitLabPushCause.class);
    Cause mcause=abstractBuild.getCause(GitLabMergeCause.class);
    String desc=null;
    if (pcause != null)     desc=pcause.getShortDescription();
    if (mcause != null)     desc=mcause.getShortDescription();
    if (desc != null && desc.length() > 0) {
      try {
        abstractBuild.setDescription(desc);
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 62690
Project: 62690
Buggy source:
@DataBoundConstructor public GitLabPushTrigger(boolean triggerOnPush,boolean triggerOnMergeRequest,boolean triggerOpenMergeRequestOnPush,boolean setJobDescription,List<String> allowedBranches){
  this.triggerOnPush=triggerOnPush;
  this.triggerOnMergeRequest=triggerOnMergeRequest;
  this.triggerOpenMergeRequestOnPush=triggerOpenMergeRequestOnPush;
  this.setJobDescription=setJobDescription;
  this.allowedBranches=allowedBranches;
}

Fixed version (ground truth):
@DataBoundConstructor public GitLabPushTrigger(boolean triggerOnPush,boolean triggerOnMergeRequest,boolean triggerOpenMergeRequestOnPush,boolean setBuildDescription,List<String> allowedBranches){
  this.triggerOnPush=triggerOnPush;
  this.triggerOnMergeRequest=triggerOnMergeRequest;
  this.triggerOpenMergeRequestOnPush=triggerOpenMergeRequestOnPush;
  this.setBuildDescription=setBuildDescription;
  this.allowedBranches=allowedBranches;
}
Program: 62692
Project: 62692
Buggy source:
private GitLabPushCause createGitLabPushCause(GitLabPushRequest req){
  GitLabPushCause cause;
  String triggeredByUser=req.getPusher().getName();
  try {
    cause=new GitLabPushCause(triggeredByUser,getLogFile());
  }
 catch (  IOException ex) {
    cause=new GitLabPushCause(triggeredByUser);
  }
  return cause;
}

Fixed version (ground truth):
private GitLabPushCause createGitLabPushCause(GitLabPushRequest req){
  GitLabPushCause cause;
  String triggeredByUser=req.getCommits().get(0).getAuthor().getName();
  try {
    cause=new GitLabPushCause(triggeredByUser,getLogFile());
  }
 catch (  IOException ex) {
    cause=new GitLabPushCause(triggeredByUser);
  }
  return cause;
}
Program: 62694
Project: 62694
Buggy source:
/** 
 * Creates a QueryParameters object used for filtering.
 */
public void generateQueryParameters(String query){
  filterQuery=query.trim();
  try {
    q=parseQuery(filterQuery.toLowerCase());
  }
 catch (  ParseException|InvalidParametersException e) {
    this.queryMessage="String_Node_Str" + e.getMessage();
  }
}

Fixed version (ground truth):
/** 
 * Creates a QueryParameters object used for filtering.
 */
public void generateQueryParameters(String query){
  filterQuery=query.trim();
  try {
    q=parseQuery(filterQuery);
  }
 catch (  ParseException|InvalidParametersException e) {
    this.queryMessage="String_Node_Str" + e.getMessage();
  }
}
Program: 62695
Project: 62695
Buggy source:
@Override public void execute(){
  String inviterId=getRequestParamValue(ParamsNames.INVITER_ID);
  Assumption.assertPostParamNotNull(ParamsNames.INVITER_ID,inviterId);
  String courseId=getRequestParamValue(ParamsNames.COURSE_ID);
  Assumption.assertPostParamNotNull(ParamsNames.COURSE_ID,courseId);
  String instructorEmail=getRequestParamValue(ParamsNames.INSTRUCTOR_EMAIL);
  Assumption.assertPostParamNotNull(ParamsNames.INSTRUCTOR_EMAIL,instructorEmail);
  AccountAttributes inviter=logic.getAccount(inviterId);
  Assumption.assertNotNull(inviter);
  CourseAttributes course=logic.getCourse(courseId);
  Assumption.assertNotNull(course);
  InstructorAttributes instructor=logic.getInstructorById(courseId,instructorEmail);
  Assumption.assertNotNull(instructor);
  EmailWrapper email=new EmailGenerator().generateInstructorCourseJoinEmail(inviter,instructor,course);
  try {
    emailSender.sendEmail(email);
  }
 catch (  Exception e) {
    Assumption.fail("String_Node_Str" + TeammatesException.toStringWithStackTrace(e));
  }
}

Fixed version (ground truth):
@Override public void execute(){
  String inviterId=getRequestParamValue(ParamsNames.INVITER_ID);
  Assumption.assertPostParamNotNull(ParamsNames.INVITER_ID,inviterId);
  String courseId=getRequestParamValue(ParamsNames.COURSE_ID);
  Assumption.assertPostParamNotNull(ParamsNames.COURSE_ID,courseId);
  String instructorEmail=getRequestParamValue(ParamsNames.INSTRUCTOR_EMAIL);
  Assumption.assertPostParamNotNull(ParamsNames.INSTRUCTOR_EMAIL,instructorEmail);
  AccountAttributes inviter=logic.getAccount(inviterId);
  Assumption.assertNotNull(inviter);
  CourseAttributes course=logic.getCourse(courseId);
  Assumption.assertNotNull(course);
  RetryManager rm=new RetryManager(4);
  InstructorAttributes instructor=null;
  try {
    instructor=rm.runUntilNotNull(new RetryableTaskReturns<InstructorAttributes>("String_Node_Str"){
      @Override public InstructorAttributes run(){
        return logic.getInstructorById(courseId,instructorEmail);
      }
    }
);
  }
 catch (  MaximumRetriesExceededException e) {
    Assumption.fail("String_Node_Str" + TeammatesException.toStringWithStackTrace(e));
  }
  Assumption.assertNotNull(instructor);
  EmailWrapper email=new EmailGenerator().generateInstructorCourseJoinEmail(inviter,instructor,course);
  try {
    emailSender.sendEmail(email);
  }
 catch (  Exception e) {
    Assumption.fail("String_Node_Str" + TeammatesException.toStringWithStackTrace(e));
  }
}
Program: 62696
Project: 62696
Buggy source:
@Override public void execute(){
  String courseId=getRequestParamValue(ParamsNames.COURSE_ID);
  Assumption.assertPostParamNotNull(ParamsNames.COURSE_ID,courseId);
  String studentEmail=getRequestParamValue(ParamsNames.STUDENT_EMAIL);
  Assumption.assertPostParamNotNull(ParamsNames.STUDENT_EMAIL,studentEmail);
  String isRejoinString=getRequestParamValue(ParamsNames.IS_STUDENT_REJOINING);
  Assumption.assertPostParamNotNull(ParamsNames.IS_STUDENT_REJOINING,isRejoinString);
  boolean isRejoin=Boolean.parseBoolean(isRejoinString);
  CourseAttributes course=logic.getCourse(courseId);
  Assumption.assertNotNull(course);
  StudentAttributes student=logic.getStudentForEmail(courseId,studentEmail);
  Assumption.assertNotNull(student);
  EmailWrapper email=isRejoin ? new EmailGenerator().generateStudentCourseRejoinEmailAfterGoogleIdReset(course,student) : new EmailGenerator().generateStudentCourseJoinEmail(course,student);
  try {
    emailSender.sendEmail(email);
  }
 catch (  Exception e) {
    Assumption.fail("String_Node_Str" + TeammatesException.toStringWithStackTrace(e));
  }
}

Fixed version (ground truth):
@Override public void execute(){
  String courseId=getRequestParamValue(ParamsNames.COURSE_ID);
  Assumption.assertPostParamNotNull(ParamsNames.COURSE_ID,courseId);
  String studentEmail=getRequestParamValue(ParamsNames.STUDENT_EMAIL);
  Assumption.assertPostParamNotNull(ParamsNames.STUDENT_EMAIL,studentEmail);
  String isRejoinString=getRequestParamValue(ParamsNames.IS_STUDENT_REJOINING);
  Assumption.assertPostParamNotNull(ParamsNames.IS_STUDENT_REJOINING,isRejoinString);
  boolean isRejoin=Boolean.parseBoolean(isRejoinString);
  CourseAttributes course=logic.getCourse(courseId);
  Assumption.assertNotNull(course);
  RetryManager rm=new RetryManager(4);
  StudentAttributes student=null;
  try {
    student=rm.runUntilNotNull(new RetryableTaskReturns<StudentAttributes>("String_Node_Str"){
      @Override public StudentAttributes run() throws RuntimeException {
        return logic.getStudentForEmail(courseId,studentEmail);
      }
    }
);
  }
 catch (  MaximumRetriesExceededException e) {
    Assumption.fail("String_Node_Str" + TeammatesException.toStringWithStackTrace(e));
  }
  Assumption.assertNotNull(student);
  EmailWrapper email=isRejoin ? new EmailGenerator().generateStudentCourseRejoinEmailAfterGoogleIdReset(course,student) : new EmailGenerator().generateStudentCourseJoinEmail(course,student);
  try {
    emailSender.sendEmail(email);
  }
 catch (  Exception e) {
    Assumption.fail("String_Node_Str" + TeammatesException.toStringWithStackTrace(e));
  }
}
Program: 62697
Project: 62697
Buggy source:
private void saveNewCommentsByFeedbackParticipant(List<FeedbackResponseCommentAttributes> commentsToSave) throws EntityDoesNotExistException {
  for (  FeedbackResponseCommentAttributes frc : commentsToSave) {
    try {
      logic.createFeedbackResponseComment(frc);
      logic.putDocument(frc);
      statusToAdmin+=this.getClass().getName() + "String_Node_Str" + "String_Node_Str"+ frc.feedbackResponseId+ "String_Node_Str"+ "String_Node_Str"+ frc.courseId+ "String_Node_Str"+ frc.feedbackSessionName+ "String_Node_Str"+ "String_Node_Str"+ frc.commentGiver+ "String_Node_Str"+ frc.createdAt+ "String_Node_Str"+ "String_Node_Str"+ frc.commentText.getValue();
    }
 catch (    InvalidParametersException e) {
      setStatusForException(e);
    }
  }
}

Fixed version (ground truth):
private void saveNewCommentsByFeedbackParticipant(List<FeedbackResponseCommentAttributes> commentsToSave) throws EntityDoesNotExistException {
  for (  FeedbackResponseCommentAttributes frc : commentsToSave) {
    try {
      frc=logic.createFeedbackResponseComment(frc);
      logic.putDocument(frc);
      statusToAdmin+=this.getClass().getName() + "String_Node_Str" + "String_Node_Str"+ frc.feedbackResponseId+ "String_Node_Str"+ "String_Node_Str"+ frc.courseId+ "String_Node_Str"+ frc.feedbackSessionName+ "String_Node_Str"+ "String_Node_Str"+ frc.commentGiver+ "String_Node_Str"+ frc.createdAt+ "String_Node_Str"+ "String_Node_Str"+ frc.commentText.getValue();
    }
 catch (    InvalidParametersException e) {
      setStatusForException(e);
    }
  }
}
Program: 62702
Project: 62702
Buggy source:
/** 
 * Sets the unique ID for the instructor entity.
 * @param uniqueId The unique ID of the entity (format: googleId%courseId).
 */
public void setUniqueId(String uniqueId){
  this.id=uniqueId;
}

Fixed version (ground truth):
/** 
 * Sets the unique ID for the instructor entity.
 * @param uniqueId The unique ID of the entity (format: email%courseId).
 */
public void setUniqueId(String uniqueId){
  this.id=uniqueId;
}
Program: 62703
Project: 62703
Buggy source:
/** 
 * Returns the unique ID of the entity (format: googleId%courseId).
 */
public String getUniqueId(){
  return id;
}

Fixed version (ground truth):
/** 
 * Returns the unique ID of the entity (format: email%courseId).
 */
public String getUniqueId(){
  return id;
}
Program: 62704
Project: 62704
Buggy source:
@Override public void execute(){
  String inviterId=getRequestParamValue(ParamsNames.INVITER_ID);
  Assumption.assertPostParamNotNull(ParamsNames.INVITER_ID,inviterId);
  String courseId=getRequestParamValue(ParamsNames.COURSE_ID);
  Assumption.assertPostParamNotNull(ParamsNames.COURSE_ID,courseId);
  String instructorEmail=getRequestParamValue(ParamsNames.INSTRUCTOR_EMAIL);
  Assumption.assertPostParamNotNull(ParamsNames.INSTRUCTOR_EMAIL,instructorEmail);
  AccountAttributes inviter=logic.getAccount(inviterId);
  Assumption.assertNotNull(inviter);
  CourseAttributes course=logic.getCourse(courseId);
  Assumption.assertNotNull(course);
  InstructorAttributes instructor=logic.getInstructorForEmail(courseId,instructorEmail);
  Assumption.assertNotNull(instructor);
  EmailWrapper email=new EmailGenerator().generateInstructorCourseJoinEmail(inviter,instructor,course);
  try {
    emailSender.sendEmail(email);
  }
 catch (  Exception e) {
    Assumption.fail("String_Node_Str" + TeammatesException.toStringWithStackTrace(e));
  }
}

Fixed version (ground truth):
@Override public void execute(){
  String inviterId=getRequestParamValue(ParamsNames.INVITER_ID);
  Assumption.assertPostParamNotNull(ParamsNames.INVITER_ID,inviterId);
  String courseId=getRequestParamValue(ParamsNames.COURSE_ID);
  Assumption.assertPostParamNotNull(ParamsNames.COURSE_ID,courseId);
  String instructorEmail=getRequestParamValue(ParamsNames.INSTRUCTOR_EMAIL);
  Assumption.assertPostParamNotNull(ParamsNames.INSTRUCTOR_EMAIL,instructorEmail);
  AccountAttributes inviter=logic.getAccount(inviterId);
  Assumption.assertNotNull(inviter);
  CourseAttributes course=logic.getCourse(courseId);
  Assumption.assertNotNull(course);
  InstructorAttributes instructor=logic.getInstructorById(courseId,instructorEmail);
  Assumption.assertNotNull(instructor);
  EmailWrapper email=new EmailGenerator().generateInstructorCourseJoinEmail(inviter,instructor,course);
  try {
    emailSender.sendEmail(email);
  }
 catch (  Exception e) {
    Assumption.fail("String_Node_Str" + TeammatesException.toStringWithStackTrace(e));
  }
}
Program: 62705
Project: 62705
Buggy source:
/** 
 * Generates the feedback session closed emails for the given   {@code session}.
 */
public List<EmailWrapper> generateFeedbackSessionClosedEmails(FeedbackSessionAttributes session){
  if (session.isPrivateSession()) {
    return new ArrayList<>();
  }
  CourseAttributes course=coursesLogic.getCourse(session.getCourseId());
  boolean isEmailNeededForStudents=false;
  try {
    isEmailNeededForStudents=fsLogic.isFeedbackSessionHasQuestionForStudents(session.getFeedbackSessionName(),session.getCourseId());
  }
 catch (  EntityDoesNotExistException e) {
    log.severe("String_Node_Str" + session.getCourseId() + "String_Node_Str"+ "String_Node_Str"+ session.getFeedbackSessionName()+ "String_Node_Str");
  }
  List<InstructorAttributes> instructors=instructorsLogic.getInstructorsForCourse(session.getCourseId());
  List<StudentAttributes> students=isEmailNeededForStudents ? studentsLogic.getStudentsForCourse(session.getCourseId()) : new ArrayList<StudentAttributes>();
  String template=EmailTemplates.USER_FEEDBACK_SESSION.replace("String_Node_Str",FEEDBACK_STATUS_SESSION_CLOSED);
  String additionalContactInformation=getAdditionalContactInformationFragment(course);
  return generateFeedbackSessionEmailBases(course,session,students,instructors,template,EmailType.FEEDBACK_CLOSED.getSubject(),FEEDBACK_ACTION_VIEW,additionalContactInformation);
}

Fixed version (ground truth):
/** 
 * Generates the feedback session closed emails for the given   {@code session}.
 */
public List<EmailWrapper> generateFeedbackSessionClosedEmails(FeedbackSessionAttributes session){
  if (session.isPrivateSession()) {
    return new ArrayList<>();
  }
  CourseAttributes course=coursesLogic.getCourse(session.getCourseId());
  boolean isEmailNeededForStudents=false;
  try {
    isEmailNeededForStudents=fsLogic.isFeedbackSessionHasQuestionForStudents(session.getFeedbackSessionName(),session.getCourseId());
  }
 catch (  EntityDoesNotExistException e) {
    log.severe("String_Node_Str" + session.getCourseId() + "String_Node_Str"+ "String_Node_Str"+ session.getFeedbackSessionName()+ "String_Node_Str");
  }
  List<InstructorAttributes> instructors=isEmailNeededForStudents ? instructorsLogic.getInstructorsForCourse(session.getCourseId()) : new ArrayList<>();
  List<StudentAttributes> students=isEmailNeededForStudents ? studentsLogic.getStudentsForCourse(session.getCourseId()) : new ArrayList<>();
  String template=EmailTemplates.USER_FEEDBACK_SESSION.replace("String_Node_Str",FEEDBACK_STATUS_SESSION_CLOSED);
  String additionalContactInformation=getAdditionalContactInformationFragment(course);
  return generateFeedbackSessionEmailBases(course,session,students,instructors,template,EmailType.FEEDBACK_CLOSED.getSubject(),FEEDBACK_ACTION_VIEW,additionalContactInformation);
}
Program: 62706
Project: 62706
Buggy source:
public String getDisplayedActionUrl(){
  return Url.addParamToUrl(activityLog.getActionUrl(),Const.ParamsNames.USER_ID,activityLog.getUserGoogleId());
}

Fixed version (ground truth):
public String getDisplayedActionUrl(){
  return SanitizationHelper.sanitizeForHtml(Url.addParamToUrl(activityLog.getActionUrl(),Const.ParamsNames.USER_ID,activityLog.getUserGoogleId()));
}
Program: 62707
Project: 62707
Buggy source:
public boolean getIsActionFailure(){
  return activityLog.getActionName().contains(Const.ACTION_RESULT_FAILURE);
}

Fixed version (ground truth):
public boolean getIsActionFailure(){
  return activityLog.getActionResponse().contains(Const.ACTION_RESULT_FAILURE);
}
Program: 62708
Project: 62708
Buggy source:
@Test public void testAdminLogQuery(){
  ______TS("String_Node_Str");
  List<String> versionList=new ArrayList<>();
  versionList.add("String_Node_Str");
  Calendar cal=new GregorianCalendar();
  cal.set(1994,Calendar.MAY,7,15,30,12);
  long startTime=cal.getTimeInMillis();
  cal.add(Calendar.YEAR,22);
  long endTime=cal.getTimeInMillis();
  AdminLogQuery query=new AdminLogQuery(versionList,startTime,endTime);
  assertEquals(startTime,query.getStartTime());
  assertEquals(endTime,query.getEndTime());
  assertNotNull(query.getQuery());
  ______TS("String_Node_Str");
  query=new AdminLogQuery(versionList,null,null);
  assertEquals(0,query.getStartTime());
  assertTrue(endTime != query.getStartTime());
  query.setTimePeriod(startTime,endTime);
  assertEquals(startTime,query.getStartTime());
  assertEquals(endTime,query.getEndTime());
  assertNotNull(query.getQuery());
}

Fixed version (ground truth):
@Test public void testAdminLogQuery(){
  ______TS("String_Node_Str");
  List<String> versionList=new ArrayList<>();
  versionList.add("String_Node_Str");
  Calendar cal=new GregorianCalendar();
  cal.set(1994,Calendar.MAY,7,15,30,12);
  long startTime=cal.getTimeInMillis();
  cal.add(Calendar.YEAR,22);
  long endTime=cal.getTimeInMillis();
  AdminLogQuery query=new AdminLogQuery(versionList,startTime,endTime);
  assertEquals(startTime,query.getStartTime());
  assertEquals(endTime,query.getEndTime());
  assertNotNull(query.getQuery());
  ______TS("String_Node_Str");
  query=new AdminLogQuery(versionList,null,null);
  assertEquals(0,query.getStartTime());
  assertNotEquals(endTime,query.getStartTime());
  query.setTimePeriod(startTime,endTime);
  assertEquals(startTime,query.getStartTime());
  assertEquals(endTime,query.getEndTime());
  assertNotNull(query.getQuery());
}
Program: 62710
Project: 62710
Buggy source:
private boolean moveRubricCol(int qnNumber,int colNumber,boolean isMoveLeft){
  String elemId;
  if (isMoveLeft) {
    elemId=Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_MOVE_COL_LEFT + "String_Node_Str" + qnNumber+ "String_Node_Str"+ colNumber;
  }
 else {
    elemId=Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_MOVE_COL_RIGHT + "String_Node_Str" + qnNumber+ "String_Node_Str"+ colNumber;
  }
  WebElement moveColButton=browser.driver.findElement(By.id(elemId));
  if (moveColButton.getAttribute("String_Node_Str") == null) {
    moveColButton.click();
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean moveRubricCol(int qnNumber,int colNumber,boolean isMoveLeft){
  String elemId;
  if (isMoveLeft) {
    elemId=Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_MOVE_COL_LEFT + "String_Node_Str" + qnNumber+ "String_Node_Str"+ colNumber;
  }
 else {
    elemId=Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_MOVE_COL_RIGHT + "String_Node_Str" + qnNumber+ "String_Node_Str"+ colNumber;
  }
  WebElement moveColButton=browser.driver.findElement(By.id(elemId));
  if (moveColButton.isEnabled()) {
    click(moveColButton);
    return true;
  }
  return false;
}
Program: 62712
Project: 62712
Buggy source:
private Map<FeedbackParticipantType,Boolean> getResponseVisibilities(){
  FeedbackParticipantType[] relevantTypes={FeedbackParticipantType.RECEIVER,FeedbackParticipantType.OWN_TEAM_MEMBERS,FeedbackParticipantType.RECEIVER_TEAM_MEMBERS,FeedbackParticipantType.STUDENTS,FeedbackParticipantType.INSTRUCTORS};
  Map<FeedbackParticipantType,Boolean> responseVisibilities=new HashMap<>();
  for (  FeedbackParticipantType type : relevantTypes) {
    responseVisibilities.put(type,true);
  }
  return responseVisibilities;
}

Fixed version (ground truth):
private Map<FeedbackParticipantType,Boolean> getResponseVisibilities(){
  FeedbackParticipantType[] relevantTypes={FeedbackParticipantType.RECEIVER,FeedbackParticipantType.OWN_TEAM_MEMBERS,FeedbackParticipantType.RECEIVER_TEAM_MEMBERS,FeedbackParticipantType.STUDENTS,FeedbackParticipantType.INSTRUCTORS};
  Map<FeedbackParticipantType,Boolean> responseVisibilities=new HashMap<>();
  for (  FeedbackParticipantType type : relevantTypes) {
    responseVisibilities.put(type,isResponseVisibleTo(type,question));
  }
  return responseVisibilities;
}
Program: 62714
Project: 62714
Buggy source:
private static void regenerateDataBundleJson(File folder) throws IOException {
  File[] listOfFiles=folder.listFiles();
  for (  File file : listOfFiles) {
    if (!file.getName().endsWith("String_Node_Str") || NON_DATA_BUNDLE_JSON.contains(file.getName())) {
      continue;
    }
    String jsonString=FileHelper.readFile(file.getCanonicalPath());
    DataBundle db=JsonUtils.fromJson(jsonString,DataBundle.class);
    for (    Map.Entry<String,FeedbackResponseAttributes> responseMap : db.feedbackResponses.entrySet()) {
      fixResponse(responseMap.getValue());
    }
    for (    Map.Entry<String,FeedbackQuestionAttributes> questionMap : db.feedbackQuestions.entrySet()) {
      fixQuestion(questionMap.getValue());
    }
    String regeneratedJsonString=JsonUtils.toJson(db).replace("String_Node_Str","String_Node_Str");
    saveFile(file.getCanonicalPath(),regeneratedJsonString);
  }
}

Fixed version (ground truth):
private static void regenerateDataBundleJson(File folder) throws IOException {
  File[] listOfFiles=folder.listFiles();
  if (listOfFiles == null) {
    return;
  }
  for (  File file : listOfFiles) {
    if (!file.getName().endsWith("String_Node_Str") || NON_DATA_BUNDLE_JSON.contains(file.getName())) {
      continue;
    }
    String jsonString=FileHelper.readFile(file.getCanonicalPath());
    DataBundle db=JsonUtils.fromJson(jsonString,DataBundle.class);
    for (    Map.Entry<String,FeedbackResponseAttributes> responseMap : db.feedbackResponses.entrySet()) {
      fixResponse(responseMap.getValue());
    }
    for (    Map.Entry<String,FeedbackQuestionAttributes> questionMap : db.feedbackQuestions.entrySet()) {
      fixQuestion(questionMap.getValue());
    }
    String regeneratedJsonString=JsonUtils.toJson(db).replace("String_Node_Str","String_Node_Str");
    saveFile(file.getCanonicalPath(),regeneratedJsonString);
  }
}
Program: 62715
Project: 62715
Buggy source:
/** 
 * Randomly create students for a particular course
 * @param courseName
 */
public static void generateStudentsDataForCourse(String courseName){
  long numOfStudent=getDeviatedNumberOfStudentInCourse();
  Set<Integer> studentIndexs=new HashSet<Integer>();
  while (studentIndexs.size() < numOfStudent) {
    studentIndexs.add(random.nextInt(NUM_OF_STUDENTS));
  }
  ArrayList<String> studentEmailInCourse=new ArrayList<String>();
  for (  Integer integer : studentIndexs) {
    studentEmailInCourse.add(studentEmails.get(integer));
  }
  int teamCount=1;
  while (!studentEmailInCourse.isEmpty()) {
    long teamSize=Math.round(random.nextInt(MAX_TEAM_SIZE - MIN_TEAM_SIZE + 1) + MIN_TEAM_SIZE);
    ArrayList<String> team=new ArrayList<String>();
    for (int k=0; !studentEmailInCourse.isEmpty() && k < teamSize; k++) {
      String email=studentEmailInCourse.remove(0);
      String studentIndex=email.split("String_Node_Str")[0].split("String_Node_Str")[1];
      String studentId=PREFIX + "String_Node_Str" + studentIndex+ "String_Node_Str"+ teamCount+ "String_Node_Str"+ courseName;
      students.add(studentId);
      team.add(studentId);
    }
    teamCount++;
    teams.add(team);
  }
}

Fixed version (ground truth):
/** 
 * Randomly create students for a particular course
 * @param courseName
 */
public static void generateStudentsDataForCourse(String courseName){
  long numOfStudent=getDeviatedNumberOfStudentInCourse();
  Set<Integer> studentIndexs=new HashSet<Integer>();
  while (studentIndexs.size() < numOfStudent) {
    studentIndexs.add(random.nextInt(NUM_OF_STUDENTS));
  }
  ArrayList<String> studentEmailInCourse=new ArrayList<String>();
  for (  Integer integer : studentIndexs) {
    studentEmailInCourse.add(studentEmails.get(integer));
  }
  int teamCount=1;
  while (!studentEmailInCourse.isEmpty()) {
    long teamSize=random.nextInt(MAX_TEAM_SIZE - MIN_TEAM_SIZE + 1) + MIN_TEAM_SIZE;
    ArrayList<String> team=new ArrayList<String>();
    for (int k=0; !studentEmailInCourse.isEmpty() && k < teamSize; k++) {
      String email=studentEmailInCourse.remove(0);
      String studentIndex=email.split("String_Node_Str")[0].split("String_Node_Str")[1];
      String studentId=PREFIX + "String_Node_Str" + studentIndex+ "String_Node_Str"+ teamCount+ "String_Node_Str"+ courseName;
      students.add(studentId);
      team.add(studentId);
    }
    teamCount++;
    teams.add(team);
  }
}
Program: 62716
Project: 62716
Buggy source:
/** 
 * @return Json string presentation for all instructors
 */
public static String allInstructors(){
  StringBuilder outputBuilder=new StringBuilder(100);
  outputBuilder.append("String_Node_Str");
  for (  String instructor : instructors.keySet()) {
    String course=PREFIX + instructors.get(instructor);
    String instructorWithPrefix=PREFIX + instructor;
    outputBuilder.append('\t').append(instructor(instructorWithPrefix,"String_Node_Str" + instructorWithPrefix,"String_Node_Str" + course,"String_Node_Str" + instructorWithPrefix,"String_Node_Str" + instructorWithPrefix + "String_Node_Str")).append("String_Node_Str");
  }
  String output=outputBuilder.substring(0,outputBuilder.length() - 2);
  return output + "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * @return Json string presentation for all instructors
 */
public static String allInstructors(){
  StringBuilder outputBuilder=new StringBuilder(100);
  outputBuilder.append("String_Node_Str");
  for (  Map.Entry<String,String> entry : instructors.entrySet()) {
    String course=PREFIX + instructors.get(entry.getValue());
    String instructorWithPrefix=PREFIX + entry.getKey();
    outputBuilder.append('\t').append(instructor(instructorWithPrefix,"String_Node_Str" + instructorWithPrefix,"String_Node_Str" + course,"String_Node_Str" + instructorWithPrefix,"String_Node_Str" + instructorWithPrefix + "String_Node_Str")).append("String_Node_Str");
  }
  String output=outputBuilder.substring(0,outputBuilder.length() - 2);
  return output + "String_Node_Str";
}
Program: 62717
Project: 62717
Buggy source:
/** 
 * Randomly create courses, students and evaluations for a particular instructor
 * @param instructorName
 */
public static void generateDataForCourse(String courseName){
  long numOfInstr=Math.round(random.nextInt(MAX_NUM_OF_INSTRUCTOR_PER_COURSES - MIN_NUM_OF_INSTRUCTOR_PER_COURSES + 1) + MIN_NUM_OF_INSTRUCTOR_PER_COURSES);
  for (int j=0; j < numOfInstr; j++) {
    String instrName="String_Node_Str" + j + "String_Node_Str"+ courseName;
    instructors.put(instrName,courseName);
  }
  generateStudentsDataForCourse(courseName);
}

Fixed version (ground truth):
/** 
 * Randomly create courses, students and evaluations for a particular instructor
 * @param instructorName
 */
public static void generateDataForCourse(String courseName){
  long numOfInstr=random.nextInt(MAX_NUM_OF_INSTRUCTOR_PER_COURSES - MIN_NUM_OF_INSTRUCTOR_PER_COURSES + 1) + MIN_NUM_OF_INSTRUCTOR_PER_COURSES;
  for (int j=0; j < numOfInstr; j++) {
    String instrName="String_Node_Str" + j + "String_Node_Str"+ courseName;
    instructors.put(instrName,courseName);
  }
  generateStudentsDataForCourse(courseName);
}
Program: 62719
Project: 62719
Buggy source:
@Override public int compare(InstituteStats inst1,InstituteStats inst2){
  return Integer.valueOf(inst2.studentTotal).compareTo(Integer.valueOf(inst1.studentTotal));
}

Fixed version (ground truth):
@Override public int compare(InstituteStats inst1,InstituteStats inst2){
  return Integer.compare(inst2.studentTotal,inst1.studentTotal);
}
Program: 62720
Project: 62720
Buggy source:
private List<InstituteStats> convertToList(HashMap<String,HashMap<Integer,HashSet<String>>> institutes){
  List<InstituteStats> list=new ArrayList<InstituteStats>();
  for (  String insName : institutes.keySet()) {
    InstituteStats insStat=new InstituteStats();
    insStat.name=insName;
    insStat.studentTotal=institutes.get(insName).get(STUDENT_INDEX).size();
    insStat.instructorTotal=institutes.get(insName).get(INSTRUCTOR_INDEX).size();
    list.add(insStat);
  }
  return list;
}

Fixed version (ground truth):
private List<InstituteStats> convertToList(HashMap<String,HashMap<Integer,HashSet<String>>> institutes){
  List<InstituteStats> list=new ArrayList<InstituteStats>();
  for (  Map.Entry<String,HashMap<Integer,HashSet<String>>> entry : institutes.entrySet()) {
    InstituteStats insStat=new InstituteStats();
    insStat.name=entry.getKey();
    insStat.studentTotal=entry.getValue().get(STUDENT_INDEX).size();
    insStat.instructorTotal=entry.getValue().get(INSTRUCTOR_INDEX).size();
    list.add(insStat);
  }
  return list;
}
Program: 62721
Project: 62721
Buggy source:
private void sortByTotalStudentsDescending(List<InstituteStats> list){
  Collections.sort(list,new Comparator<InstituteStats>(){
    @Override public int compare(    InstituteStats inst1,    InstituteStats inst2){
      return Integer.valueOf(inst2.studentTotal).compareTo(Integer.valueOf(inst1.studentTotal));
    }
  }
);
}

Fixed version (ground truth):
private void sortByTotalStudentsDescending(List<InstituteStats> list){
  Collections.sort(list,new Comparator<InstituteStats>(){
    @Override public int compare(    InstituteStats inst1,    InstituteStats inst2){
      return Integer.compare(inst2.studentTotal,inst1.studentTotal);
    }
  }
);
}
Program: 62722
Project: 62722
Buggy source:
private static FeedbackResponseCommentAttributes adjustFeedbackResponseCommentId(FeedbackResponseCommentAttributes response){
  FeedbackQuestionAttributes question=feedbackQuestionsPersisted.get(response.feedbackQuestionId);
  if (feedbackQuestionIds.containsKey(question.getId())) {
    response.feedbackQuestionId=feedbackQuestionIds.get(question.getId());
  }
 else {
    String newId=feedbackQuestionsLogic.getFeedbackQuestion(response.feedbackSessionName,response.courseId,question.questionNumber).getId();
    response.feedbackQuestionId=newId;
    feedbackQuestionIds.put(question.getId(),newId);
  }
  return response;
}

Fixed version (ground truth):
private static void adjustFeedbackResponseCommentId(FeedbackResponseCommentAttributes response){
  FeedbackQuestionAttributes question=feedbackQuestionsPersisted.get(response.feedbackQuestionId);
  if (feedbackQuestionIds.containsKey(question.getId())) {
    response.feedbackQuestionId=feedbackQuestionIds.get(question.getId());
  }
 else {
    String newId=feedbackQuestionsLogic.getFeedbackQuestion(response.feedbackSessionName,response.courseId,question.questionNumber).getId();
    response.feedbackQuestionId=newId;
    feedbackQuestionIds.put(question.getId(),newId);
  }
}
Program: 62723
Project: 62723
Buggy source:
private static FeedbackResponseAttributes adjustFeedbackResponseId(FeedbackResponseAttributes response){
  FeedbackQuestionAttributes question=feedbackQuestionsPersisted.get(response.feedbackQuestionId);
  if (feedbackQuestionIds.containsKey(question.getId())) {
    response.feedbackQuestionId=feedbackQuestionIds.get(question.getId());
  }
 else {
    String newId=feedbackQuestionsLogic.getFeedbackQuestion(response.feedbackSessionName,response.courseId,question.questionNumber).getId();
    response.feedbackQuestionId=newId;
    feedbackQuestionIds.put(question.getId(),newId);
  }
  return response;
}

Fixed version (ground truth):
private static void adjustFeedbackResponseId(FeedbackResponseAttributes response){
  FeedbackQuestionAttributes question=feedbackQuestionsPersisted.get(response.feedbackQuestionId);
  if (feedbackQuestionIds.containsKey(question.getId())) {
    response.feedbackQuestionId=feedbackQuestionIds.get(question.getId());
  }
 else {
    String newId=feedbackQuestionsLogic.getFeedbackQuestion(response.feedbackSessionName,response.courseId,question.questionNumber).getId();
    response.feedbackQuestionId=newId;
    feedbackQuestionIds.put(question.getId(),newId);
  }
}