Program: 69989
Project: 69989
Buggy source:
private void updateSearchGroupList(){
  List<BusinessGroup> groups;
  if (searchController.isEmpty()) {
    groups=Collections.emptyList();
  }
 else {
    Long id=searchController.getId();
    String name=searchController.getName();
    String description=searchController.getDescription();
    String owner=searchController.getOwner();
    SearchBusinessGroupParams params=new SearchBusinessGroupParams();
    if (id != null) {
      params.setKeys(Collections.singletonList(id));
    }
    params.setName(name);
    params.setDescription(description);
    params.setOwnerName(owner);
    groups=businessGroupService.findBusinessGroups(params,null,0,-1);
  }
  List<BGTableItem> wrapped=new ArrayList<BGTableItem>();
  Set<Long> membership=new HashSet<Long>();
  Map<Long,Long> resourceKeys=new HashMap<Long,Long>();
  for (  BusinessGroup group : groups) {
    OLATResource ores=OLATResourceManager.getInstance().findResourceable(group);
    resourceKeys.put(group.getKey(),ores.getKey());
    if (businessGroupService.isIdentityInBusinessGroup(getIdentity(),group)) {
      membership.add(group.getKey());
    }
  }
  List<OLATResourceAccess> resourcesWithAC=acFrontendManager.getAccessMethodForResources(resourceKeys.values(),true,new Date());
  for (  BusinessGroup group : groups) {
    Long oresKey=resourceKeys.get(group.getKey());
    OLATResourceAccess bgAccess=null;
    for (    OLATResourceAccess access : resourcesWithAC) {
      if (oresKey.equals(access.getResource().getKey())) {
        bgAccess=access;
        break;
      }
    }
    if (bgAccess != null) {
      wrapped.add(wrapGroup(group,true,Boolean.TRUE,null,true,bgAccess.getMethods()));
    }
  }
  groupListModel.setEntries(wrapped);
  groupListCtr.modelChanged();
}

Fixed version (ground truth):
private void updateSearchGroupList(){
  List<BusinessGroup> groups;
  if (searchController.isEmpty()) {
    groups=Collections.emptyList();
  }
 else {
    Long id=searchController.getId();
    String name=searchController.getName();
    String description=searchController.getDescription();
    String owner=searchController.getOwner();
    SearchBusinessGroupParams params=new SearchBusinessGroupParams();
    if (id != null) {
      params.setGroupKeys(Collections.singletonList(id));
    }
    params.setName(name);
    params.setDescription(description);
    params.setOwnerName(owner);
    groups=businessGroupService.findBusinessGroups(params,null,0,-1);
  }
  List<BGTableItem> wrapped=new ArrayList<BGTableItem>();
  Set<Long> membership=new HashSet<Long>();
  Map<Long,Long> resourceKeys=new HashMap<Long,Long>();
  for (  BusinessGroup group : groups) {
    OLATResource ores=OLATResourceManager.getInstance().findResourceable(group);
    resourceKeys.put(group.getKey(),ores.getKey());
    if (businessGroupService.isIdentityInBusinessGroup(getIdentity(),group)) {
      membership.add(group.getKey());
    }
  }
  List<OLATResourceAccess> resourcesWithAC=acFrontendManager.getAccessMethodForResources(resourceKeys.values(),true,new Date());
  for (  BusinessGroup group : groups) {
    Long oresKey=resourceKeys.get(group.getKey());
    OLATResourceAccess bgAccess=null;
    for (    OLATResourceAccess access : resourcesWithAC) {
      if (oresKey.equals(access.getResource().getKey())) {
        bgAccess=access;
        break;
      }
    }
    if (bgAccess != null) {
      wrapped.add(wrapGroup(group,true,Boolean.TRUE,null,true,bgAccess.getMethods()));
    }
  }
  groupListModel.setEntries(wrapped);
  groupListCtr.modelChanged();
}