nus-yam/ex-repair huggingface dataset:
Program: 69563
Project: 69563
Buggy source:
@Override public BusinessGroup updateDisplayMembers(BusinessGroup group,boolean ownersIntern,boolean participantsIntern,boolean waitingListIntern,boolean ownersPublic,boolean participantsPublic,boolean waitingListPublic,boolean download){
  BusinessGroup reloadedBusinessGroup=businessGroupDAO.loadForUpdate(group.getKey());
  BusinessGroup mergedGroup=null;
  if (reloadedBusinessGroup != null) {
    reloadedBusinessGroup.setOwnersVisibleIntern(ownersIntern);
    reloadedBusinessGroup.setOwnersVisiblePublic(ownersPublic);
    reloadedBusinessGroup.setParticipantsVisibleIntern(participantsIntern);
    reloadedBusinessGroup.setParticipantsVisiblePublic(participantsPublic);
    reloadedBusinessGroup.setWaitingListVisibleIntern(waitingListIntern);
    reloadedBusinessGroup.setWaitingListVisiblePublic(waitingListPublic);
    reloadedBusinessGroup.setDownloadMembersLists(download);
    mergedGroup=businessGroupDAO.merge(reloadedBusinessGroup);
  }
  dbInstance.commit();
  return mergedGroup;
}

Fixed version (ground truth):
@Override public BusinessGroup updateDisplayMembers(BusinessGroup group,boolean ownersIntern,boolean participantsIntern,boolean waitingListIntern,boolean ownersPublic,boolean participantsPublic,boolean waitingListPublic,boolean download){
  BusinessGroup reloadedBusinessGroup=businessGroupDAO.loadForUpdate(group.getKey());
  BusinessGroup mergedGroup=null;
  if (reloadedBusinessGroup != null) {
    reloadedBusinessGroup.setOwnersVisibleIntern(ownersIntern);
    reloadedBusinessGroup.setOwnersVisiblePublic(ownersPublic);
    reloadedBusinessGroup.setParticipantsVisibleIntern(participantsIntern);
    reloadedBusinessGroup.setParticipantsVisiblePublic(participantsPublic);
    reloadedBusinessGroup.setWaitingListVisibleIntern(waitingListIntern);
    reloadedBusinessGroup.setWaitingListVisiblePublic(waitingListPublic);
    reloadedBusinessGroup.setDownloadMembersLists(download);
    mergedGroup=businessGroupDAO.merge(reloadedBusinessGroup);
    mergedGroup.getBaseGroup().getKey();
  }
  dbInstance.commit();
  return mergedGroup;
}
Program: 69564
Project: 69564
Buggy source:
@Override public BusinessGroup updateBusinessGroup(Identity ureqIdentity,BusinessGroup group,String name,String description,Integer minParticipants,Integer maxParticipants,Boolean waitingList,Boolean autoCloseRanks){
  BusinessGroup bg=businessGroupDAO.loadForUpdate(group.getKey());
  Integer previousMaxParticipants=bg.getMaxParticipants();
  bg.setName(name);
  bg.setDescription(description);
  bg.setMaxParticipants(maxParticipants);
  bg.setMinParticipants(minParticipants);
  bg.setWaitingListEnabled(waitingList);
  bg.setAutoCloseRanksEnabled(autoCloseRanks);
  bg.setLastUsage(new Date(System.currentTimeMillis()));
  List<BusinessGroupModifiedEvent.Deferred> events=new ArrayList<BusinessGroupModifiedEvent.Deferred>();
  autoRankCheck(ureqIdentity,bg,previousMaxParticipants,events);
  BusinessGroup mergedGroup=businessGroupDAO.merge(bg);
  dbInstance.commit();
  BusinessGroupModifiedEvent.fireDeferredEvents(events);
  return mergedGroup;
}

Fixed version (ground truth):
@Override public BusinessGroup updateBusinessGroup(Identity ureqIdentity,BusinessGroup group,String name,String description,Integer minParticipants,Integer maxParticipants,Boolean waitingList,Boolean autoCloseRanks){
  BusinessGroup bg=businessGroupDAO.loadForUpdate(group.getKey());
  Integer previousMaxParticipants=bg.getMaxParticipants();
  bg.setName(name);
  bg.setDescription(description);
  bg.setMaxParticipants(maxParticipants);
  bg.setMinParticipants(minParticipants);
  bg.setWaitingListEnabled(waitingList);
  bg.setAutoCloseRanksEnabled(autoCloseRanks);
  bg.setLastUsage(new Date(System.currentTimeMillis()));
  List<BusinessGroupModifiedEvent.Deferred> events=new ArrayList<BusinessGroupModifiedEvent.Deferred>();
  autoRankCheck(ureqIdentity,bg,previousMaxParticipants,events);
  BusinessGroup mergedGroup=businessGroupDAO.merge(bg);
  mergedGroup.getBaseGroup().getKey();
  dbInstance.commit();
  BusinessGroupModifiedEvent.fireDeferredEvents(events);
  return mergedGroup;
}
Program: 69568
Project: 69568
Buggy source:
@Test public void queryByEditor(){
  Identity id=JunitTestHelper.createAndPersistIdentityAsUser("String_Node_Str" + UUID.randomUUID().toString());
  RepositoryEntry re=JunitTestHelper.createAndPersistRepositoryEntry();
  dbInstance.commitAndCloseSession();
  repositoryEntryRelationDao.addRole(id,re,GroupRoles.owner.name());
  dbInstance.commitAndCloseSession();
  List<RepositoryEntry> entries=repositoryManager.queryByEditor(id);
  Assert.assertNotNull(entries);
  Assert.assertEquals(1,entries.size());
  Assert.assertTrue(entries.contains(re));
}

Fixed version (ground truth):
@Test public void queryByEditor(){
  Identity owner=JunitTestHelper.createAndPersistIdentityAsUser("String_Node_Str" + UUID.randomUUID().toString());
  Identity participant=JunitTestHelper.createAndPersistIdentityAsUser("String_Node_Str" + UUID.randomUUID().toString());
  RepositoryEntry re=JunitTestHelper.createAndPersistRepositoryEntry();
  dbInstance.commitAndCloseSession();
  repositoryEntryRelationDao.addRole(owner,re,GroupRoles.owner.name());
  repositoryEntryRelationDao.addRole(participant,re,GroupRoles.participant.name());
  dbInstance.commitAndCloseSession();
  List<RepositoryEntry> entries=repositoryManager.queryByEditor(owner);
  Assert.assertNotNull(entries);
  Assert.assertEquals(1,entries.size());
  Assert.assertTrue(entries.contains(re));
  List<RepositoryEntry> partEntries=repositoryManager.queryByEditor(participant);
  Assert.assertNotNull(partEntries);
  Assert.assertEquals(0,partEntries.size());
}
Program: 69570
Project: 69570
Buggy source:
public void setTaxonomyLevel(TaxonomyLevel taxonomyLevel){
  this.taxonomyLevel=taxonomyLevel;
  flc.setVisible(taxonomyLevel != null);
  if (taxonomyLevel != null) {
    String parentLine=null;
    if (this.taxonomyLevel != null) {
      parentLine=taxonomyLevel.getMaterializedPathNames();
    }
 else {
      parentLine="String_Node_Str";
    }
    pathEl.setValue(parentLine);
    fieldEl.setValue(taxonomyLevel.getField());
  }
}

Fixed version (ground truth):
public void setTaxonomyLevel(TaxonomyLevel taxonomyLevel){
  this.taxonomyLevel=taxonomyLevel;
  flc.setVisible(taxonomyLevel != null);
  if (taxonomyLevel != null) {
    String parentLine=null;
    if (this.taxonomyLevel != null) {
      parentLine=taxonomyLevel.getMaterializedPathNames();
    }
 else {
      parentLine="String_Node_Str";
    }
    pathEl.setValue(parentLine);
    fieldEl.setValue(taxonomyLevel.getField());
  }
  initialPanel.setDirty(true);
}
Program: 69571
Project: 69571
Buggy source:
/** 
 * @param res
 * @return Get resourceable as file.
 */
private File getFileResource(OLATResourceable res,String resourceFolderName){
  FileResource fr=getAsGenericFileResource(res);
  File f=getFile(fr,resourceFolderName);
  if (f == null)   throw new OLATRuntimeException(FileResourceManager.class,"String_Node_Str" + res.getResourceableId() + "String_Node_Str"+ res.getResourceableTypeName(),null);
  return f;
}

Fixed version (ground truth):
/** 
 * @param res
 * @return Get resourceable as file.
 */
private File getFileResource(OLATResourceable res,String resourceFolderName){
  FileResource fr=getAsGenericFileResource(res);
  File f=getFile(fr,resourceFolderName);
  if (f == null) {
    throw new OLATRuntimeException(FileResourceManager.class,"String_Node_Str" + res.getResourceableId() + "String_Node_Str"+ res.getResourceableTypeName(),null);
  }
  return f;
}
Program: 69572
Project: 69572
Buggy source:
public File execute(){
  File zipTargetDir=null;
  zipTargetDir=new File(dir,ZIPDIR);
  if (!zipTargetDir.exists()) {
    zipTargetDir.mkdir();
    File zipFile=getFileResource(res);
    if (!ZipUtil.unzip(zipFile,zipTargetDir))     return null;
  }
  return zipTargetDir;
}

Fixed version (ground truth):
public File execute(){
  File targetDir=null;
  targetDir=new File(dir,ZIPDIR);
  if (!targetDir.exists()) {
    targetDir.mkdir();
    File zipFile=getFileResource(res);
    if (!ZipUtil.unzip(zipFile,targetDir)) {
      return null;
    }
  }
  return targetDir;
}
Program: 69573
Project: 69573
Buggy source:
private final File unzipFileResource(final OLATResourceable res,final File dir){
  if (!dir.exists()) {
    return null;
  }
  File zipTargetDir=new File(dir,ZIPDIR);
  if (!zipTargetDir.exists()) {
    zipTargetDir=CoordinatorManager.getInstance().getCoordinator().getSyncer().doInSync(res,new SyncerCallback<File>(){
      public File execute(){
        File zipTargetDir=null;
        zipTargetDir=new File(dir,ZIPDIR);
        if (!zipTargetDir.exists()) {
          zipTargetDir.mkdir();
          File zipFile=getFileResource(res);
          if (!ZipUtil.unzip(zipFile,zipTargetDir))           return null;
        }
        return zipTargetDir;
      }
    }
);
  }
  return zipTargetDir;
}

Fixed version (ground truth):
private final File unzipFileResource(final OLATResourceable res,final File dir){
  if (!dir.exists()) {
    return null;
  }
  File zipTargetDir=new File(dir,ZIPDIR);
  if (!zipTargetDir.exists()) {
    zipTargetDir=CoordinatorManager.getInstance().getCoordinator().getSyncer().doInSync(res,new SyncerCallback<File>(){
      public File execute(){
        File targetDir=null;
        targetDir=new File(dir,ZIPDIR);
        if (!targetDir.exists()) {
          targetDir.mkdir();
          File zipFile=getFileResource(res);
          if (!ZipUtil.unzip(zipFile,targetDir)) {
            return null;
          }
        }
        return targetDir;
      }
    }
);
  }
  return zipTargetDir;
}
Program: 69574
Project: 69574
Buggy source:
protected void doEdit(UserRequest ureq){
  if (!reSecurity.isEntryAdmin())   return;
  Controller ctrl=handler.createEditorController(re,ureq,getWindowControl());
  listenTo(ctrl);
  editorCtrl=pushController(ureq,translate("String_Node_Str"),ctrl);
  currentToolCtr=editorCtrl;
  setActiveTool(editLink);
}

Fixed version (ground truth):
protected void doEdit(UserRequest ureq){
  if (!reSecurity.isEntryAdmin())   return;
  Controller ctrl=handler.createEditorController(re,ureq,getWindowControl());
  if (ctrl != null) {
    listenTo(ctrl);
    editorCtrl=pushController(ureq,translate("String_Node_Str"),ctrl);
    currentToolCtr=editorCtrl;
    setActiveTool(editLink);
  }
}
Program: 69575
Project: 69575
Buggy source:
/** 
 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,org.olat.core.gui.control.WindowControl,org.olat.course.run.userview.UserCourseEnvironment,org.olat.course.run.userview.NodeEvaluation)
 */
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq,WindowControl wControl,UserCourseEnvironment userCourseEnv,NodeEvaluation ne,String nodecmd){
  Controller controller;
  Roles roles=ureq.getUserSession().getRoles();
  if (roles.isGuestOnly()) {
    Translator trans=new PackageTranslator(PACKAGE,ureq.getLocale());
    String title=trans.translate("String_Node_Str");
    String message=trans.translate("String_Node_Str");
    controller=MessageUIFactory.createInfoMessage(ureq,wControl,title,message);
  }
 else {
    controller=new CORunController(getModuleConfiguration(),ureq,wControl,userCourseEnv,this);
  }
  Controller ctrl=TitledWrapperHelper.getWrapper(ureq,wControl,controller,this,"String_Node_Str");
  return new NodeRunConstructionResult(ctrl);
}

Fixed version (ground truth):
/** 
 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,org.olat.core.gui.control.WindowControl,org.olat.course.run.userview.UserCourseEnvironment,org.olat.course.run.userview.NodeEvaluation)
 */
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq,WindowControl wControl,UserCourseEnvironment userCourseEnv,NodeEvaluation ne,String nodecmd){
  Controller controller;
  Roles roles=ureq.getUserSession().getRoles();
  if (roles.isGuestOnly()) {
    Translator trans=new PackageTranslator(PACKAGE,ureq.getLocale());
    String title=trans.translate("String_Node_Str");
    String message=trans.translate("String_Node_Str");
    controller=MessageUIFactory.createInfoMessage(ureq,wControl,title,message);
  }
 else {
    controller=new CORunController(getModuleConfiguration(),ureq,wControl,userCourseEnv);
  }
  Controller ctrl=TitledWrapperHelper.getWrapper(ureq,wControl,controller,this,"String_Node_Str");
  return new NodeRunConstructionResult(ctrl);
}
Program: 69584
Project: 69584
Buggy source:
/** 
 * Add a custom css to the view and mark it as the curent custom CSS.
 * @param customCSS
 */
@Override public void addCurrentCustomCSSToView(CustomCSS customCSS){
  if (customCSS == null)   return;
  Window myWindow=getWindowControl().getWindowBackOffice().getWindow();
  myWindow.setCustomCSS(customCSS);
  cssHolder.setContent(customCSS.getJSAndCSSComponent());
  addCustomThemeJS();
}

Fixed version (ground truth):
/** 
 * Add a custom css to the view and mark it as the current custom CSS.
 * @param customCSS
 */
@Override public void addCurrentCustomCSSToView(CustomCSS customCSS){
  if (customCSS == null)   return;
  Window myWindow=getWindowControl().getWindowBackOffice().getWindow();
  myWindow.setCustomCSS(customCSS);
  cssHolder.setContent(customCSS.getJSAndCSSComponent());
}
Program: 69587
Project: 69587
Buggy source:
@Override protected void formInnerEvent(UserRequest ureq,FormItem source,FormEvent event){
  if (source == tableEl) {
    if (event instanceof SelectionEvent) {
      SelectionEvent se=(SelectionEvent)event;
      RuleWrapper row=model.getObject(se.getIndex());
      if ("String_Node_Str".equals(se.getCommand())) {
        moveUp(row);
      }
 else       if ("String_Node_Str".equals(se.getCommand())) {
        moveDown(row);
      }
 else       if ("String_Node_Str".equals(se.getCommand())) {
        addRow(row);
      }
 else       if ("String_Node_Str".equals(se.getCommand())) {
        deleteRow(row);
      }
      tableEl.reset();
      tableEl.getComponent().setDirty(true);
    }
  }
 else   if (source instanceof FormLink && source.getUserObject() instanceof RuleWrapper) {
    RuleWrapper rule=(RuleWrapper)source.getUserObject();
    String cmd=((FormLink)source).getCmd();
    if ("String_Node_Str".equals(cmd)) {
    }
 else     if ("String_Node_Str".equals(cmd)) {
    }
 else {
      LandingPages lp=LandingPages.landingPageFromCmd(cmd);
      if (lp != null) {
        rule.getLandingPageEl().setValue(lp.businessPath());
      }
    }
  }
  super.formInnerEvent(ureq,source,event);
}

Fixed version (ground truth):
@Override protected void formInnerEvent(UserRequest ureq,FormItem source,FormEvent event){
  if (source == tableEl) {
    if (event instanceof SelectionEvent) {
      SelectionEvent se=(SelectionEvent)event;
      RuleWrapper row=model.getObject(se.getIndex());
      if ("String_Node_Str".equals(se.getCommand())) {
        moveUp(row);
      }
 else       if ("String_Node_Str".equals(se.getCommand())) {
        moveDown(row);
      }
 else       if ("String_Node_Str".equals(se.getCommand())) {
        addRow(row);
      }
 else       if ("String_Node_Str".equals(se.getCommand())) {
        deleteRow(row);
      }
      tableEl.reset();
      tableEl.getComponent().setDirty(true);
    }
  }
 else   if (source instanceof FormLink && source.getUserObject() instanceof RuleWrapper) {
    RuleWrapper rule=(RuleWrapper)source.getUserObject();
    String cmd=((FormLink)source).getCmd();
    if ("String_Node_Str".equals(cmd)) {
      FormLink link=(FormLink)source;
      openChooser(ureq,rule,link);
    }
    saveButton.getComponent().setDirty(false);
    source.getComponent().setDirty(false);
    tableEl.getComponent().setDirty(false);
    flc.setDirty(false);
  }
  super.formInnerEvent(ureq,source,event);
}
Program: 69588
Project: 69588
Buggy source:
public DropdownItem getLandingPageChooser(){
  return landingPageChooser;
}

Fixed version (ground truth):
public FormLink getLandingPageChooser(){
  return landingPageChooser;
}
Program: 69589
Project: 69589
Buggy source:
public void setLandingPageChooser(DropdownItem landingPageChooser){
  this.landingPageChooser=landingPageChooser;
}

Fixed version (ground truth):
public void setLandingPageChooser(FormLink landingPageChooser){
  this.landingPageChooser=landingPageChooser;
}
Program: 69592
Project: 69592
Buggy source:
@Override protected void sort(List<BGTableItem> rows){
  int columnIndex=getColumnIndex();
  Cols column=Cols.values()[columnIndex];
switch (column) {
case mark:
    Collections.sort(rows,new MarkComparator());
  break;
case resources:
Collections.sort(rows,new ResourcesComparator());
break;
case role:
Collections.sort(rows,new RoleComparator());
break;
default :
{
super.sort(rows);
}
}
}

Fixed version (ground truth):
@Override protected void sort(List<BGTableItem> rows){
  int columnIndex=getColumnIndex();
  Cols column=Cols.values()[columnIndex];
switch (column) {
case name:
    Collections.sort(rows,new BusinessGroupNameComparator());
  break;
case mark:
Collections.sort(rows,new MarkComparator());
break;
case resources:
Collections.sort(rows,new ResourcesComparator());
break;
case role:
Collections.sort(rows,new RoleComparator());
break;
default :
{
super.sort(rows);
}
}
}
Program: 69593
Project: 69593
Buggy source:
@Override public int compare(BusinessGroupMembership m1,BusinessGroupMembership m2){
  if (m1.isOwner()) {
    if (m2.isOwner()) {
      return 0;
    }
    return 1;
  }
 else   if (m2.isOwner()) {
    return -1;
  }
  if (m1.isParticipant() || m1.isParticipant()) {
    if (m2.isParticipant() || m2.isParticipant()) {
      return 0;
    }
    return 1;
  }
 else   if (m2.isParticipant() || m2.isParticipant()) {
    return -1;
  }
  if (m1.isWaiting()) {
    if (m2.isWaiting()) {
      return 0;
    }
    return 1;
  }
 else   if (m2.isWaiting()) {
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compare(BusinessGroupMembership m1,BusinessGroupMembership m2){
  if (m1 == null) {
    if (m2 == null) {
      return 0;
    }
 else {
      return -1;
    }
  }
 else   if (m2 == null) {
    return 1;
  }
  if (m1.isOwner()) {
    if (m2.isOwner()) {
      return 0;
    }
    return 1;
  }
 else   if (m2.isOwner()) {
    return -1;
  }
  if (m1.isParticipant() || m1.isParticipant()) {
    if (m2.isParticipant() || m2.isParticipant()) {
      return 0;
    }
    return 1;
  }
 else   if (m2.isParticipant() || m2.isParticipant()) {
    return -1;
  }
  if (m1.isWaiting()) {
    if (m2.isWaiting()) {
      return 0;
    }
    return 1;
  }
 else   if (m2.isWaiting()) {
    return -1;
  }
  return 0;
}
Program: 69595
Project: 69595
Buggy source:
/** 
 * Register any referenced repository entries.
 * @param course
 * @param currentNode
 */
private static void registerReferences(ICourse course,CourseNode currentNode){
  for (int i=0; i < currentNode.getChildCount(); i++) {
    CourseNode childNode=(CourseNode)currentNode.getChildAt(i);
    if (childNode.needsReferenceToARepositoryEntry()) {
      referenceManager.addReference(course,childNode.getReferencedRepositoryEntry().getOlatResource(),childNode.getIdent());
    }
    registerReferences(course,childNode);
  }
}

Fixed version (ground truth):
/** 
 * Register any referenced repository entries.
 * @param course
 * @param currentNode
 */
private static void registerReferences(ICourse course,CourseEditorTreeNode currentNode){
  for (int i=0; i < currentNode.getChildCount(); i++) {
    CourseEditorTreeNode childNode=(CourseEditorTreeNode)currentNode.getChildAt(i);
    CourseNode childCourseNode=childNode.getCourseNode();
    if (childCourseNode.needsReferenceToARepositoryEntry()) {
      RepositoryEntry re=childCourseNode.getReferencedRepositoryEntry();
      referenceManager.addReference(course,re.getOlatResource(),childNode.getIdent());
    }
    registerReferences(course,childNode);
  }
}
Program: 69596
Project: 69596
Buggy source:
public List<EfficiencyStatementEntry> getCourse(Identity coach,RepositoryEntry entry,int firstResult,int maxResults);

Fixed version (ground truth):
public List<EfficiencyStatementEntry> getCourse(Identity coach,RepositoryEntry entry);
Program: 69597
Project: 69597
Buggy source:
public List<Long> getStudents(Identity coach,RepositoryEntry entry,int firstResult,int maxResults){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  return dbInstance.getCurrentEntityManager().createQuery(sb.toString(),Long.class).setParameter("String_Node_Str",coach.getKey()).setParameter("String_Node_Str",entry.getKey()).getResultList();
}

Fixed version (ground truth):
public List<Long> getStudents(Identity coach,RepositoryEntry entry){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  return dbInstance.getCurrentEntityManager().createQuery(sb.toString(),Long.class).setParameter("String_Node_Str",coach.getKey()).setParameter("String_Node_Str",entry.getKey()).getResultList();
}
Program: 69598
Project: 69598
Buggy source:
public List<GroupStatEntry> getGroupsStatistics(Identity coach){
  return coachingDao.getGroupsStatistics(coach);
}

Fixed version (ground truth):
@Override public List<GroupStatEntry> getGroupsStatistics(Identity coach){
  return coachingDao.getGroupsStatistics(coach);
}
Program: 69599
Project: 69599
Buggy source:
public List<UserEfficiencyStatement> getEfficencyStatements(Identity student){
  return coachingDao.getEfficencyStatementEntries(student);
}

Fixed version (ground truth):
@Override public List<UserEfficiencyStatement> getEfficencyStatements(Identity student){
  return coachingDao.getEfficencyStatementEntries(student);
}
Program: 69600
Project: 69600
Buggy source:
public List<StudentStatEntry> getStudentsStatistics(Identity coach){
  return coachingDao.getStudentsStatistics(coach);
}

Fixed version (ground truth):
@Override public List<StudentStatEntry> getStudentsStatistics(Identity coach){
  return coachingDao.getStudentsStatistics(coach);
}
Program: 69601
Project: 69601
Buggy source:
public EfficiencyStatementEntry getEfficencyStatement(UserEfficiencyStatement statement){
  return coachingDao.getEfficencyStatementEntry(statement);
}

Fixed version (ground truth):
@Override public EfficiencyStatementEntry getEfficencyStatement(UserEfficiencyStatement statement){
  return coachingDao.getEfficencyStatementEntry(statement);
}
Program: 69602
Project: 69602
Buggy source:
public List<RepositoryEntry> getStudentsCourses(Identity coach,Identity student,int firstResult,int maxResults){
  return coachingDao.getStudentsCourses(coach,student,firstResult,maxResults);
}

Fixed version (ground truth):
@Override public List<RepositoryEntry> getStudentsCourses(Identity coach,Identity student,int firstResult,int maxResults){
  return coachingDao.getStudentsCourses(coach,student,firstResult,maxResults);
}
Program: 69603
Project: 69603
Buggy source:
public List<EfficiencyStatementEntry> getGroup(BusinessGroup group){
  List<Identity> students=businessGroupService.getMembers(group,GroupRoles.participant.name());
  List<RepositoryEntry> courses=businessGroupService.findRepositoryEntries(Collections.singletonList(group),0,-1);
  return coachingDao.getEfficencyStatementEntriesAlt(students,courses);
}

Fixed version (ground truth):
@Override public List<EfficiencyStatementEntry> getGroup(BusinessGroup group){
  List<Identity> students=businessGroupService.getMembers(group,GroupRoles.participant.name());
  List<RepositoryEntry> courses=businessGroupService.findRepositoryEntries(Collections.singletonList(group),0,-1);
  return coachingDao.getEfficencyStatementEntriesAlt(students,courses);
}
Program: 69604
Project: 69604
Buggy source:
public List<CourseStatEntry> getCoursesStatistics(Identity coach){
  return coachingDao.getCoursesStatistics(coach);
}

Fixed version (ground truth):
@Override public List<CourseStatEntry> getCoursesStatistics(Identity coach){
  return coachingDao.getCoursesStatistics(coach);
}
Program: 69605
Project: 69605
Buggy source:
public List<EfficiencyStatementEntry> getCourse(Identity coach,RepositoryEntry entry,int firstResult,int maxResults){
  List<Long> studentKeys=coachingDao.getStudents(coach,entry,firstResult,maxResults);
  List<IdentityShort> students=securityManager.findShortIdentitiesByKey(studentKeys);
  return coachingDao.getEfficencyStatementEntries(students,Collections.singletonList(entry));
}

Fixed version (ground truth):
@Override public List<EfficiencyStatementEntry> getCourse(Identity coach,RepositoryEntry entry){
  List<Long> studentKeys=coachingDao.getStudents(coach,entry);
  List<IdentityShort> students=securityManager.findShortIdentitiesByKey(studentKeys);
  return coachingDao.getEfficencyStatementEntries(students,Collections.singletonList(entry));
}
Program: 69606
Project: 69606
Buggy source:
public Map<Long,String> getIdentities(Collection<Long> identityNames){
  Map<Long,String> identityMap=new HashMap<Long,String>();
  List<IdentityShort> identities=securityManager.findShortIdentitiesByKey(identityNames);
  for (  IdentityShort identity : identities) {
    String fullName=identity.getFirstName() + "String_Node_Str" + identity.getLastName();
    identityMap.put(identity.getKey(),fullName);
  }
  return identityMap;
}

Fixed version (ground truth):
@Override public Map<Long,String> getIdentities(Collection<Long> identityNames){
  Map<Long,String> identityMap=new HashMap<Long,String>();
  List<IdentityShort> identities=securityManager.findShortIdentitiesByKey(identityNames);
  for (  IdentityShort identity : identities) {
    String fullName=identity.getFirstName() + "String_Node_Str" + identity.getLastName();
    identityMap.put(identity.getKey(),fullName);
  }
  return identityMap;
}
Program: 69607
Project: 69607
Buggy source:
public boolean isCoach(Identity coach){
  return coachingDao.isCoach(coach);
}

Fixed version (ground truth):
@Override public boolean isCoach(Identity coach){
  return coachingDao.isCoach(coach);
}
Program: 69608
Project: 69608
Buggy source:
public List<EfficiencyStatementEntry> loadModel(){
  List<EfficiencyStatementEntry> entries=coachingService.getCourse(getIdentity(),course,0,-1);
  TableDataModel<EfficiencyStatementEntry> model=new EfficiencyStatementEntryTableDataModel(entries);
  tableCtr.setTableDataModel(model);
  return entries;
}

Fixed version (ground truth):
public List<EfficiencyStatementEntry> loadModel(){
  List<EfficiencyStatementEntry> entries=coachingService.getCourse(getIdentity(),course);
  TableDataModel<EfficiencyStatementEntry> model=new EfficiencyStatementEntryTableDataModel(entries);
  tableCtr.setTableDataModel(model);
  return entries;
}
Program: 69609
Project: 69609
Buggy source:
public boolean hasRole(IdentityRef identity,RepositoryEntryRef re,String... roles){
  List<String> roleList=GroupRoles.toList(roles);
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(RepositoryEntry.class.getName()).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  if (roleList.size() > 0) {
    sb.append("String_Node_Str");
  }
  TypedQuery<Number> query=dbInstance.getCurrentEntityManager().createQuery(sb.toString(),Number.class).setParameter("String_Node_Str",identity.getKey()).setParameter("String_Node_Str",re.getKey());
  if (roleList.size() > 0) {
    query.setParameter("String_Node_Str",roleList);
  }
  Number count=query.getSingleResult();
  return count == null ? false : count.intValue() > 0;
}

Fixed version (ground truth):
/** 
 * Has role in the repository entry only (without business groups)
 * @param identity
 * @param re
 * @param roles
 * @return
 */
public boolean hasRole(IdentityRef identity,RepositoryEntryRef re,String... roles){
  List<String> roleList=GroupRoles.toList(roles);
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(RepositoryEntry.class.getName()).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  if (roleList.size() > 0) {
    sb.append("String_Node_Str");
  }
  TypedQuery<Number> query=dbInstance.getCurrentEntityManager().createQuery(sb.toString(),Number.class).setParameter("String_Node_Str",identity.getKey()).setParameter("String_Node_Str",re.getKey());
  if (roleList.size() > 0) {
    query.setParameter("String_Node_Str",roleList);
  }
  Number count=query.getSingleResult();
  return count == null ? false : count.intValue() > 0;
}
Program: 69610
Project: 69610
Buggy source:
public List<String> getRoles(IdentityRef identity,RepositoryEntryRef re){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(RepositoryEntry.class.getName()).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  return dbInstance.getCurrentEntityManager().createQuery(sb.toString(),String.class).setParameter("String_Node_Str",identity.getKey()).setParameter("String_Node_Str",re.getKey()).getResultList();
}

Fixed version (ground truth):
/** 
 * Get roles in the repository entry, with business groups too
 * @param identity
 * @param re
 * @return
 */
public List<String> getRoles(IdentityRef identity,RepositoryEntryRef re){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(RepositoryEntry.class.getName()).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  return dbInstance.getCurrentEntityManager().createQuery(sb.toString(),String.class).setParameter("String_Node_Str",identity.getKey()).setParameter("String_Node_Str",re.getKey()).getResultList();
}
Program: 69611
Project: 69611
Buggy source:
@Override public List<String> getRoles(Identity identity,RepositoryEntryRef re){
  return reToGroupDao.getRoles(identity,re);
}

Fixed version (ground truth):
/** 
 * Get the role in the specified resource, business group are included in the query.
 */
@Override public List<String> getRoles(Identity identity,RepositoryEntryRef re){
  return reToGroupDao.getRoles(identity,re);
}
Program: 69612
Project: 69612
Buggy source:
@Override public boolean hasRole(Identity identity,RepositoryEntryRef re,String... roles){
  return reToGroupDao.hasRole(identity,re,roles);
}

Fixed version (ground truth):
/** 
 * Has specific role in the specified resource WITHOUT business groups included in the query.
 */
@Override public boolean hasRole(Identity identity,RepositoryEntryRef re,String... roles){
  return reToGroupDao.hasRole(identity,re,roles);
}
Program: 69613
Project: 69613
Buggy source:
private void cleanUp(){
  if (catModificationLock != null && catModificationLock.isSuccess()) {
    CoordinatorManager.getInstance().getCoordinator().getLocker().releaseLock(catModificationLock);
    catModificationLock=null;
  }
  removeAsListenerAndDispose(cfc);
  removeAsListenerAndDispose(cmc);
  removeAsListenerAndDispose(addEntryForm);
  removeAsListenerAndDispose(editEntryForm);
  removeAsListenerAndDispose(groupController);
  cmc=null;
  cfc=null;
  addEntryForm=null;
  editEntryForm=null;
  groupController=null;
}

Fixed version (ground truth):
private void cleanUp(){
  if (catModificationLock != null && catModificationLock.isSuccess()) {
    CoordinatorManager.getInstance().getCoordinator().getLocker().releaseLock(catModificationLock);
    catModificationLock=null;
  }
  removeAsListenerAndDispose(cfc);
  removeAsListenerAndDispose(cmc);
  removeAsListenerAndDispose(addEntryForm);
  removeAsListenerAndDispose(editEntryForm);
  removeAsListenerAndDispose(groupController);
  removeAsListenerAndDispose(repositoryEntryDetailsCtrl);
  removeAsListenerAndDispose(repositoryEditDescriptionController);
  cmc=null;
  cfc=null;
  addEntryForm=null;
  editEntryForm=null;
  groupController=null;
  repositoryEntryDetailsCtrl=null;
  repositoryEditDescriptionController=null;
}
Program: 69614
Project: 69614
Buggy source:
private DueDateWrapper forgeRow(int i,FormLayoutContainer tableCont){
  String title=data.getNodePrefix() + "String_Node_Str" + (i + 1);
  TextElement titleEl=uifactory.addTextElement("String_Node_Str" + i,null,32,title,tableCont);
  titleEl.setDisplaySize(60);
  DateChooser dueDateEl=uifactory.addDateChooser("String_Node_Str" + i,"String_Node_Str",null,tableCont);
  dueDateEl.setDateChooserTimeEnabled(true);
  DueDateWrapper wrapper=new DueDateWrapper(titleEl,dueDateEl);
  return wrapper;
}

Fixed version (ground truth):
private DueDateWrapper forgeRow(int i,FormLayoutContainer tableCont){
  String title=data.getNodePrefix() + "String_Node_Str" + (i + 1);
  TextElement titleEl=uifactory.addTextElement("String_Node_Str" + i,null,32,title,tableCont);
  titleEl.setDisplaySize(21);
  DateChooser dueDateEl=uifactory.addDateChooser("String_Node_Str" + i,"String_Node_Str",null,tableCont);
  dueDateEl.setDateChooserTimeEnabled(true);
  DueDateWrapper wrapper=new DueDateWrapper(titleEl,dueDateEl);
  return wrapper;
}
Program: 69615
Project: 69615
Buggy source:
public void setLabel(String label,String[] params,boolean translate){
  if (label == null) {
    hasLabel=false;
  }
  hasLabel=true;
  translateLabel=translate;
  labelKey=label;
  labelParams=params;
  if (getTranslator() != null && labelKey != null) {
    labelC=new SimpleLabelText(label,getLabelText(),componentIsMandatory);
    labelC.setTranslator(getTranslator());
    labelPanel.setContent(labelC);
  }
 else   if (label == null) {
    labelC=null;
    labelPanel.setContent(labelC);
  }
}

Fixed version (ground truth):
public void setLabel(String label,String[] params,boolean translate){
  hasLabel=(label != null);
  translateLabel=translate;
  labelKey=label;
  labelParams=params;
  if (getTranslator() != null && labelKey != null) {
    labelC=new SimpleLabelText(label,getLabelText(),componentIsMandatory);
    labelC.setTranslator(getTranslator());
    labelPanel.setContent(labelC);
  }
 else   if (label == null) {
    labelC=null;
    labelPanel.setContent(labelC);
  }
}
Program: 69616
Project: 69616
Buggy source:
@Override public BusinessGroupEnvironment importGroups(RepositoryEntry re,File fGroupExportXML){
  return businessGroupImportExport.importGroups(re,fGroupExportXML);
}

Fixed version (ground truth):
@Override public BusinessGroupEnvironment importGroups(RepositoryEntry re,File fGroupExportXML){
  BusinessGroupImportExport importer=new BusinessGroupImportExport(dbInstance,areaManager,this,groupModule);
  return importer.importGroups(re,fGroupExportXML);
}
Program: 69617
Project: 69617
Buggy source:
@Override public void archiveGroups(List<BusinessGroup> groups,File exportFile){
  businessGroupArchiver.archiveGroups(groups,exportFile);
}

Fixed version (ground truth):
@Override public void archiveGroups(List<BusinessGroup> groups,File exportFile){
  BusinessGroupArchiver archiver=new BusinessGroupArchiver(dbInstance);
  archiver.archiveGroups(groups,exportFile);
}
Program: 69618
Project: 69618
Buggy source:
@Override public void exportGroups(List<BusinessGroup> groups,List<BGArea> areas,File fExportFile,BusinessGroupEnvironment env,boolean runtimeDatas,boolean backwardsCompatible){
  businessGroupImportExport.exportGroups(groups,areas,fExportFile,env,runtimeDatas,backwardsCompatible);
}

Fixed version (ground truth):
@Override public void exportGroups(List<BusinessGroup> groups,List<BGArea> areas,File fExportFile,BusinessGroupEnvironment env,boolean runtimeDatas,boolean backwardsCompatible){
  BusinessGroupImportExport exporter=new BusinessGroupImportExport(dbInstance,areaManager,this,groupModule);
  exporter.exportGroups(groups,areas,fExportFile,env,runtimeDatas,backwardsCompatible);
}
Program: 69623
Project: 69623
Buggy source:
@Override protected void initForm(FormItemContainer formLayout,Controller listener,UserRequest ureq){
  FlexiTableColumnModel columnModel=initColumnModel();
  groupTableModel=new BusinessGroupFlexiTableModel(getTranslator(),columnModel);
  tableEl=uifactory.addTableElement(ureq,getWindowControl(),"String_Node_Str",groupTableModel,20,false,getTranslator(),formLayout);
  FlexiTableSortOptions options=new FlexiTableSortOptions();
  options.setFromColumnModel(true);
  tableEl.setSortSettings(options);
  searchCtrl=new BusinessGroupSearchController(ureq,getWindowControl(),isAdmin(),true,false,mainForm);
  listenTo(searchCtrl);
  tableEl.setSearchEnabled(true);
  tableEl.setExtendedSearch(searchCtrl);
  initButtons(formLayout,ureq);
}

Fixed version (ground truth):
@Override protected void initForm(FormItemContainer formLayout,Controller listener,UserRequest ureq){
  FlexiTableColumnModel columnModel=initColumnModel();
  groupTableModel=new BusinessGroupFlexiTableModel(getTranslator(),columnModel);
  tableEl=uifactory.addTableElement(ureq,getWindowControl(),"String_Node_Str",groupTableModel,20,false,getTranslator(),formLayout);
  FlexiTableSortOptions options=new FlexiTableSortOptions();
  options.setFromColumnModel(true);
  tableEl.setSortSettings(options);
  searchCtrl=new BusinessGroupSearchController(ureq,getWindowControl(),isAdmin(),true,false,mainForm);
  searchCtrl.setEnabled(false);
  listenTo(searchCtrl);
  tableEl.setSearchEnabled(true);
  tableEl.setExtendedSearch(searchCtrl);
  initButtons(formLayout,ureq);
}
Program: 69624
Project: 69624
Buggy source:
public AbstractItemListController(UserRequest ureq,WindowControl wControl,QuestionItemsSource source,String key){
  super(ureq,wControl,"String_Node_Str");
  this.itemsSource=source;
  markManager=CoreSpringFactory.getImpl(MarkManager.class);
  qpoolService=CoreSpringFactory.getImpl(QPoolService.class);
  eventBus=ureq.getUserSession().getSingleUserEventCenter();
  eventBus.registerFor(this,getIdentity(),QuestionPoolMainEditorController.QITEM_MARKED);
  extendedSearchCtrl=new ExtendedSearchController(ureq,getWindowControl(),key,mainForm);
  listenTo(extendedSearchCtrl);
  initForm(ureq);
}

Fixed version (ground truth):
public AbstractItemListController(UserRequest ureq,WindowControl wControl,QuestionItemsSource source,String key){
  super(ureq,wControl,"String_Node_Str");
  this.itemsSource=source;
  markManager=CoreSpringFactory.getImpl(MarkManager.class);
  qpoolService=CoreSpringFactory.getImpl(QPoolService.class);
  eventBus=ureq.getUserSession().getSingleUserEventCenter();
  eventBus.registerFor(this,getIdentity(),QuestionPoolMainEditorController.QITEM_MARKED);
  extendedSearchCtrl=new ExtendedSearchController(ureq,getWindowControl(),key,mainForm);
  extendedSearchCtrl.setEnabled(false);
  listenTo(extendedSearchCtrl);
  initForm(ureq);
}
Program: 69626
Project: 69626
Buggy source:
String getFormDispatchId(){
  return name;
}

Fixed version (ground truth):
String getFormDispatchId(){
  return selectionWrapper.getFormDispatchId() + "String_Node_Str" + which;
}
Program: 69627
Project: 69627
Buggy source:
RadioElementComponent(String name,SingleSelection selectionWrapper,int which){
  this.selectionWrapper=selectionWrapper;
  this.which=which;
  this.name=name;
}

Fixed version (ground truth):
RadioElementComponent(SingleSelection selectionWrapper,int which){
  this.selectionWrapper=selectionWrapper;
  this.which=which;
}
Program: 69628
Project: 69628
Buggy source:
private void initSelectionElements(){
  boolean createValues=(values == null) || (values.length == 0);
  if (createValues) {
    values=new String[keys.length];
    for (int i=0; i < keys.length; i++) {
      values[i]=translator.translate(keys[i]);
    }
  }
  if (layout == Layout.select) {
    String ssscId=getFormItemId() == null ? null : getFormItemId() + "String_Node_Str";
    component=new SelectboxComponent(ssscId,getName() + "String_Node_Str",translator,this,keys,values,cssClasses);
  }
 else {
    RadioElementComponent[] radios=new RadioElementComponent[keys.length];
    for (int i=0; i < keys.length; i++) {
      String radioName=getName() + "String_Node_Str" + keys[i];
      radios[i]=new RadioElementComponent(radioName,this,i);
    }
    String ssscId=getFormItemId() == null ? null : getFormItemId() + "String_Node_Str";
    SingleSelectionComponent ssc=new SingleSelectionComponent(ssscId,this);
    ssc.setRadioComponents(radios);
    component=ssc;
  }
}

Fixed version (ground truth):
private void initSelectionElements(){
  boolean createValues=(values == null) || (values.length == 0);
  if (createValues) {
    values=new String[keys.length];
    for (int i=0; i < keys.length; i++) {
      values[i]=translator.translate(keys[i]);
    }
  }
  if (layout == Layout.select) {
    String ssscId=getFormItemId() == null ? null : getFormItemId() + "String_Node_Str";
    component=new SelectboxComponent(ssscId,getName() + "String_Node_Str",translator,this,keys,values,cssClasses);
  }
 else {
    RadioElementComponent[] radios=new RadioElementComponent[keys.length];
    for (int i=0; i < keys.length; i++) {
      radios[i]=new RadioElementComponent(this,i);
    }
    String ssscId=getFormItemId() == null ? null : getFormItemId() + "String_Node_Str";
    SingleSelectionComponent ssc=new SingleSelectionComponent(ssscId,this);
    ssc.setRadioComponents(radios);
    component=ssc;
  }
}
Program: 69629
Project: 69629
Buggy source:
private void renderRadio(StringOutput sb,SingleSelectionComponent source,RadioElementComponent ssec,boolean inline){
  String subStrName="String_Node_Str" + ssec.getGroupingName() + "String_Node_Str";
  String key=ssec.getKey();
  String value=ssec.getValue();
  boolean selected=ssec.isSelected();
  sb.append("String_Node_Str").append("String_Node_Str",inline).append("String_Node_Str").append(ssec.getFormDispatchId()).append("String_Node_Str").append("String_Node_Str").append(ssec.getFormDispatchId()).append("String_Node_Str").append("String_Node_Str").append(subStrName).append("String_Node_Str").append(key).append("String_Node_Str").append("String_Node_Str",selected);
  if (source.isEnabled()) {
    sb.append(FormJSHelper.getRawJSFor(ssec.getRootForm(),ssec.getSelectionElementFormDisId(),ssec.getAction()));
  }
 else {
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str").append(value).append("String_Node_Str");
  if (source.isEnabled()) {
    sb.append(FormJSHelper.getJSStartWithVarDeclaration(ssec.getFormDispatchId()));
    sb.append(FormJSHelper.getSetFlexiFormDirtyForCheckbox(ssec.getRootForm(),ssec.getFormDispatchId()));
    sb.append(FormJSHelper.getJSEnd());
  }
}

Fixed version (ground truth):
private void renderRadio(StringOutput sb,SingleSelectionComponent source,RadioElementComponent ssec,boolean inline){
  String subStrName="String_Node_Str" + ssec.getGroupingName() + "String_Node_Str";
  String key=ssec.getKey();
  String value=ssec.getValue();
  boolean selected=ssec.isSelected();
  String formDispatchId=ssec.getFormDispatchId();
  sb.append("String_Node_Str").append("String_Node_Str",inline).append("String_Node_Str").append(formDispatchId).append("String_Node_Str").append("String_Node_Str").append(formDispatchId).append("String_Node_Str").append("String_Node_Str").append(subStrName).append("String_Node_Str").append(key).append("String_Node_Str").append("String_Node_Str",selected);
  if (source.isEnabled()) {
    sb.append(FormJSHelper.getRawJSFor(ssec.getRootForm(),ssec.getSelectionElementFormDisId(),ssec.getAction()));
  }
 else {
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str").append(value).append("String_Node_Str");
  if (source.isEnabled()) {
    sb.append(FormJSHelper.getJSStartWithVarDeclaration(formDispatchId)).append(FormJSHelper.getSetFlexiFormDirtyForCheckbox(ssec.getRootForm(),formDispatchId)).append(FormJSHelper.getJSEnd());
  }
}
Program: 69630
Project: 69630
Buggy source:
@Override public MediaResource handle(String relPath,HttpServletRequest request){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(themeBaseUri).append("String_Node_Str").append("String_Node_Str").append(themeBaseUri).append("String_Node_Str").append("String_Node_Str");
  List<KalendarEventRenderWrapper> sortedEventsWithin=new ArrayList<KalendarEventRenderWrapper>();
  collectEvents(sortedEventsWithin,calendarWrappers);
  collectEvents(sortedEventsWithin,importedCalendarWrappers);
  Collections.sort(sortedEventsWithin,KalendarEventDateComparator.getInstance());
  renderEvents(sb,sortedEventsWithin,from,to);
  renderCalendars(sb);
  sb.append("String_Node_Str");
  StringMediaResource smr=new StringMediaResource();
  smr.setContentType("String_Node_Str");
  smr.setEncoding("String_Node_Str");
  smr.setData(sb.toString());
  return smr;
}

Fixed version (ground truth):
@Override public MediaResource handle(String relPath,HttpServletRequest request){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(themeBaseUri).append("String_Node_Str").append("String_Node_Str").append(themeBaseUri).append("String_Node_Str").append("String_Node_Str");
  List<KalendarEventRenderWrapper> sortedEventsWithin=new ArrayList<KalendarEventRenderWrapper>();
  collectEvents(sortedEventsWithin,calendarWrappers);
  collectEvents(sortedEventsWithin,importedCalendarWrappers);
  Collections.sort(sortedEventsWithin,KalendarEventDateComparator.getInstance());
  renderEvents(sb,sortedEventsWithin,from,to);
  renderCalendars(sb);
  sb.append("String_Node_Str");
  StringMediaResource smr=new StringMediaResource();
  smr.setContentType("String_Node_Str");
  smr.setEncoding("String_Node_Str");
  smr.setData(sb.toString());
  return smr;
}
Program: 69631
Project: 69631
Buggy source:
@Override public void setSortSettings(FlexiTableSortOptions options){
  this.sortOptions=options;
}

Fixed version (ground truth):
@Override public void setSortSettings(FlexiTableSortOptions options){
  this.sortOptions=options;
  if (options.getDefaultOrderBy() != null) {
    orderBy=new SortKey[]{options.getDefaultOrderBy()};
  }
}
Program: 69632
Project: 69632
Buggy source:
@Override public void reloadData(){
  if (dataSource != null) {
    dataSource.clear();
    dataSource.load(getSearchText(),getConditionalQueries(),0,getPageSize());
  }
 else {
    if (dataModel instanceof FilterableFlexiTableModel) {
      if (isFilterEnabled()) {
        String filter=getSelectedFilterKey();
        ((FilterableFlexiTableModel)dataModel).filter(filter);
      }
    }
    if (dataModel instanceof SortableFlexiTableDataModel) {
      if (orderBy != null && orderBy.length > 0) {
        ((SortableFlexiTableDataModel<?>)dataModel).sort(orderBy[0]);
      }
    }
  }
  component.setDirty(true);
}

Fixed version (ground truth):
@Override public void reloadData(){
  if (dataSource != null) {
    dataSource.clear();
    dataSource.load(getSearchText(),getConditionalQueries(),0,getPageSize(),orderBy);
  }
 else {
    if (dataModel instanceof FilterableFlexiTableModel) {
      if (isFilterEnabled()) {
        String filter=getSelectedFilterKey();
        ((FilterableFlexiTableModel)dataModel).filter(filter);
      }
    }
    if (dataModel instanceof SortableFlexiTableDataModel) {
      if (orderBy != null && orderBy.length > 0) {
        ((SortableFlexiTableDataModel<?>)dataModel).sort(orderBy[0]);
      }
    }
  }
  component.setDirty(true);
}
Program: 69633
Project: 69633
Buggy source:
@Override public void collapseExtendedSearch(){
  extendedSearchExpanded=false;
  extendedSearchCtrl.setEnabled(false);
}

Fixed version (ground truth):
@Override public void collapseExtendedSearch(){
  extendedSearchExpanded=false;
  extendedSearchCtrl.setEnabled(false);
  if (searchFieldEl != null) {
    searchFieldEl.setVisible(true);
  }
}
Program: 69634
Project: 69634
Buggy source:
protected void evalSearchRequest(UserRequest ureq){
  if (searchFieldEl == null)   return;
  searchFieldEl.evalFormRequest(ureq);
  String search=searchFieldEl.getValue();
  if (StringHelper.containsNonWhitespace(search)) {
    doSearch(ureq,search,null);
  }
 else {
    doResetSearch();
  }
}

Fixed version (ground truth):
protected void evalSearchRequest(UserRequest ureq){
  if (searchFieldEl == null || !searchFieldEl.isEnabled() || !searchFieldEl.isVisible()) {
    return;
  }
  searchFieldEl.evalFormRequest(ureq);
  String search=searchFieldEl.getValue();
  if (StringHelper.containsNonWhitespace(search)) {
    doSearch(ureq,search,null);
  }
 else {
    doResetSearch();
  }
}