nus-yam/ex-repair huggingface dataset:
Program: 69863
Project: 69863
Buggy source:
/** 
 * @see org.olat.modules.webFeed.managers.FeedManager#remove(org.olat.modules.webFeed.models.Item,org.olat.modules.webFeed.models.Feed)
 */
@Override public void remove(final Item item,final Feed feed){
  coordinator.getSyncer().doInSync(feed,new SyncerCallback<Object>(){
    public VFSLeaf execute(){
      @SuppressWarnings("String_Node_Str") Feed reloadedFeed=getFeed(feed,false);
      reloadedFeed.remove(item);
      if (!reloadedFeed.hasItems()) {
        reloadedFeed.setExternal(null);
      }
      VFSContainer itemContainer=getItemContainer(item,reloadedFeed);
      if (itemContainer != null) {
        itemContainer.delete();
      }
      reloadedFeed.setLastModified(new Date());
      update(reloadedFeed,false);
      CommentAndRatingService commentAndRatingService=CoreSpringFactory.getImpl(CommentAndRatingService.class);
      if (commentAndRatingService != null) {
        commentAndRatingService.init(null,feed,item.getGuid(),true,false);
        commentAndRatingService.deleteAll();
      }
      return null;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @see org.olat.modules.webFeed.managers.FeedManager#remove(org.olat.modules.webFeed.models.Item,org.olat.modules.webFeed.models.Feed)
 */
@Override public Feed remove(final Item item,final Feed feed){
  return coordinator.getSyncer().doInSync(feed,new SyncerCallback<Feed>(){
    public Feed execute(){
      @SuppressWarnings("String_Node_Str") Feed reloadedFeed=getFeed(feed,false);
      reloadedFeed.remove(item);
      if (!reloadedFeed.hasItems()) {
        reloadedFeed.setExternal(null);
      }
      VFSContainer itemContainer=getItemContainer(item,reloadedFeed);
      if (itemContainer != null) {
        itemContainer.delete();
      }
      reloadedFeed.setLastModified(new Date());
      update(reloadedFeed,false);
      CommentAndRatingService commentAndRatingService=CoreSpringFactory.getImpl(CommentAndRatingService.class);
      if (commentAndRatingService != null) {
        commentAndRatingService.init(null,feed,item.getGuid(),true,false);
        commentAndRatingService.deleteAll();
      }
      return reloadedFeed;
    }
  }
);
}
Program: 69864
Project: 69864
Buggy source:
/** 
 * @see org.olat.modules.webFeed.managers.FeedManager#addItem(org.olat.modules.webFeed.models.Item,org.olat.core.gui.components.form.flexible.elements.FileElement,org.olat.modules.webFeed.models.Feed)
 */
@Override public void addItem(final Item item,final FileElement file,final Feed feed){
  if (feed.isInternal()) {
    coordinator.getSyncer().doInSync(feed,new SyncerCallback<Object>(){
      @SuppressWarnings("String_Node_Str") public VFSLeaf execute(){
        Feed reloadedFeed=getFeed(feed,false);
        if (item.getPublishDate() == null)         item.setPublishDate(new Date());
        setEnclosure(file,item,reloadedFeed);
        VFSContainer itemContainer=createItemContainer(feed,item);
        VFSLeaf itemFile=itemContainer.createChildLeaf(ITEM_FILE_NAME);
        XStreamHelper.writeObject(xstream,itemFile,item);
        reloadedFeed.add(item);
        reloadedFeed.setLastModified(item.getLastModified());
        update(reloadedFeed,false);
        return null;
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * @see org.olat.modules.webFeed.managers.FeedManager#addItem(org.olat.modules.webFeed.models.Item,org.olat.core.gui.components.form.flexible.elements.FileElement,org.olat.modules.webFeed.models.Feed)
 */
@Override public Feed addItem(final Item item,final FileElement file,final Feed feed){
  if (feed.isInternal()) {
    return coordinator.getSyncer().doInSync(feed,new SyncerCallback<Feed>(){
      @SuppressWarnings("String_Node_Str") public Feed execute(){
        Feed reloadedFeed=getFeed(feed,false);
        if (item.getPublishDate() == null)         item.setPublishDate(new Date());
        setEnclosure(file,item,reloadedFeed);
        VFSContainer itemContainer=createItemContainer(feed,item);
        VFSLeaf itemFile=itemContainer.createChildLeaf(ITEM_FILE_NAME);
        XStreamHelper.writeObject(xstream,itemFile,item);
        reloadedFeed.add(item);
        reloadedFeed.setLastModified(item.getLastModified());
        update(reloadedFeed,false);
        return reloadedFeed;
      }
    }
);
  }
  return null;
}
Program: 69865
Project: 69865
Buggy source:
/** 
 * @param item
 * @param buttons
 * @return The Link in buttons which has the item attached as user object ornull
 */
private Link getButtonByUserObject(Item item,List<Link> buttons){
  Link result=null;
  if (buttons != null && item != null) {
    for (    Link button : buttons) {
      if (button.getUserObject() == item) {
        result=button;
        break;
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param item
 * @param buttons
 * @return The Link in buttons which has the item attached as user object ornull
 */
private Link getButtonByUserObject(Item item,List<Link> buttons){
  Link result=null;
  if (buttons != null && item != null) {
    for (    Link button : buttons) {
      if (item.equals(button.getUserObject())) {
        result=button;
        break;
      }
    }
  }
  return result;
}
Program: 69867
Project: 69867
Buggy source:
/** 
 * @see org.olat.course.nodes.SelfAssessableCourseNode#getUserScoreEvaluation(org.olat.course.run.userview.UserCourseEnvironment)
 */
public ScoreEvaluation getUserScoreEvaluation(UserCourseEnvironment userCourseEnv){
  Identity identity=userCourseEnv.getIdentityEnvironment().getIdentity();
  long olatResourceId=userCourseEnv.getCourseEnvironment().getCourseResourceableId().longValue();
  QTIResultSet qTIResultSet=IQManager.getInstance().getLastResultSet(identity,olatResourceId,this.getIdent());
  if (qTIResultSet != null) {
    ScoreEvaluation scoreEvaluation=new ScoreEvaluation(new Float(qTIResultSet.getScore()),new Boolean(qTIResultSet.getIsPassed()),new Long(qTIResultSet.getAssessmentID()));
    return scoreEvaluation;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @see org.olat.course.nodes.SelfAssessableCourseNode#getUserScoreEvaluation(org.olat.course.run.userview.UserCourseEnvironment)
 */
public ScoreEvaluation getUserScoreEvaluation(UserCourseEnvironment userCourseEnv){
  Identity identity=userCourseEnv.getIdentityEnvironment().getIdentity();
  long olatResourceId=userCourseEnv.getCourseEnvironment().getCourseResourceableId().longValue();
  QTIResultSet qTIResultSet=IQManager.getInstance().getLastResultSet(identity,olatResourceId,this.getIdent());
  if (qTIResultSet != null) {
    ScoreEvaluation scoreEvaluation=new ScoreEvaluation(new Float(qTIResultSet.getScore()),qTIResultSet.getIsPassed(),new Long(qTIResultSet.getAssessmentID()));
    return scoreEvaluation;
  }
  return null;
}
Program: 69868
Project: 69868
Buggy source:
protected void resort(){
  if (isSortingEnabled()) {
    currentSortingCd=getColumnDescriptor(sortColumn);
    int cdcnt=getColumnCount();
    for (int i=0; i < cdcnt; i++) {
      ColumnDescriptor cd=getColumnDescriptor(i);
      if (cd != currentSortingCd) {
        cd.otherColumnDescriptorSorted();
      }
    }
    if (currentSortingCd == null) {
      throw new RuntimeException("String_Node_Str" + sortColumn + "String_Node_Str");
    }
    currentSortingCd.sortingAboutToStart();
    long start=0;
    boolean logDebug=Tracing.isDebugEnabled(Table.class);
    if (logDebug) {
      start=System.currentTimeMillis();
    }
    Collections.sort(sorter,this);
    if (logDebug) {
      long stop=System.currentTimeMillis();
      TableDataModel model=getTableDataModel();
      Tracing.logDebug("String_Node_Str" + (model == null ? "String_Node_Str" : model.getRowCount()) + "String_Node_Str"+ (stop - start)+ "String_Node_Str",Table.class);
    }
  }
}

Fixed version (ground truth):
protected void resort(){
  if (isSortingEnabled()) {
    ColumnDescriptor currentSortingCd=getColumnDescriptor(sortColumn);
    int cdcnt=getColumnCount();
    for (int i=0; i < cdcnt; i++) {
      ColumnDescriptor cd=getColumnDescriptor(i);
      if (cd != currentSortingCd) {
        cd.otherColumnDescriptorSorted();
      }
    }
    if (currentSortingCd == null) {
      throw new RuntimeException("String_Node_Str" + sortColumn + "String_Node_Str");
    }
    currentSortingCd.sortingAboutToStart();
    Collections.sort(sorter,new TableComparator(currentSortingCd,sortAscending));
  }
}
Program: 69869
Project: 69869
Buggy source:
/** 
 * Sorts the selected table row indexes according with the table Comparator, and then retrieves the rows from the input defaultTableDataModel. It is assumed that the defaultTableDataModel IS THE MODEL for the table.
 * @param objectMarkers
 * @return the List with the sorted selected objects in this table.
 */
public List getSelectedSortedObjects(final BitSet objectMarkers,final DefaultTableDataModel defaultTableDataModel){
  List results=new ArrayList();
  List<Integer> sortedIndexes=new ArrayList<Integer>();
  if (objectMarkers.isEmpty()) {
    sortedIndexes.clear();
  }
  for (int i=objectMarkers.nextSetBit(0); i >= 0; i=objectMarkers.nextSetBit(i + 1)) {
    sortedIndexes.add(i);
  }
  Collections.sort(sortedIndexes,table);
  Iterator<Integer> indexesIterator=sortedIndexes.iterator();
  while (indexesIterator.hasNext()) {
    results.add(defaultTableDataModel.getObject(indexesIterator.next()));
  }
  return results;
}

Fixed version (ground truth):
/** 
 * Sorts the selected table row indexes according with the table Comparator, and then retrieves the rows from the input defaultTableDataModel. It is assumed that the defaultTableDataModel IS THE MODEL for the table.
 * @param objectMarkers
 * @return the List with the sorted selected objects in this table.
 */
public List getSelectedSortedObjects(final BitSet objectMarkers,final DefaultTableDataModel defaultTableDataModel){
  List results=new ArrayList();
  List<Integer> sortedIndexes=new ArrayList<Integer>();
  if (objectMarkers.isEmpty()) {
    sortedIndexes.clear();
  }
  for (int i=objectMarkers.nextSetBit(0); i >= 0; i=objectMarkers.nextSetBit(i + 1)) {
    sortedIndexes.add(i);
  }
  Collections.sort(sortedIndexes,table.getComparator());
  Iterator<Integer> indexesIterator=sortedIndexes.iterator();
  while (indexesIterator.hasNext()) {
    results.add(defaultTableDataModel.getObject(indexesIterator.next()));
  }
  return results;
}
Program: 69870
Project: 69870
Buggy source:
private IdentityImpl loadForUpdate(Long identityKey){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(IdentityImpl.class.getName()).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  List<IdentityImpl> identity=dbInstance.getCurrentEntityManager().createQuery(sb.toString(),IdentityImpl.class).setParameter("String_Node_Str",identityKey).setLockMode(LockModeType.PESSIMISTIC_WRITE).getResultList();
  if (identity.isEmpty()) {
    return null;
  }
  return identity.get(0);
}

Fixed version (ground truth):
/** 
 * Don't forget to commit/roolback the transaction as soon as possible
 * @param identityKey
 * @return
 */
private IdentityImpl loadForUpdate(Long identityKey){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(IdentityImpl.class.getName()).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  List<IdentityImpl> identity=dbInstance.getCurrentEntityManager().createQuery(sb.toString(),IdentityImpl.class).setParameter("String_Node_Str",identityKey).setLockMode(LockModeType.PESSIMISTIC_WRITE).getResultList();
  if (identity.isEmpty()) {
    return null;
  }
  return identity.get(0);
}
Program: 69871
Project: 69871
Buggy source:
/** 
 * @see org.olat.basesecurity.Manager#saveIdentityStatus(org.olat.core.id.Identity)
 */
@Override public Identity saveIdentityStatus(Identity identity,Integer status){
  Identity reloadedIdentity=loadForUpdate(identity.getKey());
  reloadedIdentity.setStatus(status);
  return dbInstance.getCurrentEntityManager().merge(reloadedIdentity);
}

Fixed version (ground truth):
/** 
 * @see org.olat.basesecurity.Manager#saveIdentityStatus(org.olat.core.id.Identity)
 */
@Override @Transactional public Identity saveIdentityStatus(Identity identity,Integer status){
  Identity reloadedIdentity=loadForUpdate(identity.getKey());
  reloadedIdentity.setStatus(status);
  reloadedIdentity=dbInstance.getCurrentEntityManager().merge(reloadedIdentity);
  return reloadedIdentity;
}
Program: 69872
Project: 69872
Buggy source:
@Override public Identity setIdentityLastLogin(Identity identity){
  Identity reloadedIdentity=loadForUpdate(identity.getKey());
  reloadedIdentity.setLastLogin(new Date());
  return dbInstance.getCurrentEntityManager().merge(reloadedIdentity);
}

Fixed version (ground truth):
@Override @Transactional public Identity setIdentityLastLogin(Identity identity){
  Identity reloadedIdentity=loadForUpdate(identity.getKey());
  reloadedIdentity.setLastLogin(new Date());
  reloadedIdentity=dbInstance.getCurrentEntityManager().merge(reloadedIdentity);
  return reloadedIdentity;
}
Program: 69873
Project: 69873
Buggy source:
public void cleanUpSession(){
  if (data.get() == null)   return;
  closeSession();
}

Fixed version (ground truth):
public void cleanUpSession(){
  EntityManager threadBoundedEm=EntityManagerFactoryUtils.getTransactionalEntityManager(emf);
  if (threadBoundedEm != null) {
    EntityManagerFactoryUtils.closeEntityManager(threadBoundedEm);
  }
  if (data.get() == null)   return;
  closeSession();
}
Program: 69874
Project: 69874
Buggy source:
@Override public EntityManager getCurrentEntityManager(){
  DBImpl current=getInstance(true);
  DBManager dbm=current.getData().getManager();
  if (dbm == null) {
    logDebug("String_Node_Str",null);
    return null;
  }
  beginTransaction("String_Node_Str");
  return dbm.getDbSession().getEntityManager();
}

Fixed version (ground truth):
@Override public EntityManager getCurrentEntityManager(){
  EntityManager threadBoundedEm=EntityManagerFactoryUtils.getTransactionalEntityManager(emf);
  if (threadBoundedEm != null) {
    return threadBoundedEm;
  }
  DBImpl current=getInstance(true);
  DBManager dbm=current.getData().getManager();
  if (dbm == null) {
    logDebug("String_Node_Str",null);
    return null;
  }
  beginTransaction("String_Node_Str");
  return dbm.getDbSession().getEntityManager();
}
Program: 69875
Project: 69875
Buggy source:
/** 
 * check if event in the same VM this is used only in ClusterLocker to check if Release All Locks or users should be executed. (release locks for a  use is a "single node service") FIXME:2008-11-27:pb == comparison to see if in the same VM. 
 * @return
 */
public boolean isEventOnThisNode(){
  return vm_marker == VM_MARKER;
}

Fixed version (ground truth):
/** 
 * check if event in the same VM this is used only in ClusterLocker to check if Release All Locks or users should be executed. (release locks for a  use is a "single node service") FIXME:2008-11-27:pb == comparison to see if in the same VM. 
 * @return
 */
public boolean isEventOnThisNode(){
  return vm_marker == WebappHelper.getNodeId();
}
Program: 69876
Project: 69876
Buggy source:
@Override public int hashCode(){
  int hc=3;
  int hcMul=7;
  hc=hc * hcMul + vm_marker.hashCode();
  return hc * hcMul + super.hashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  int hc=3;
  int hcMul=7;
  hc=hc * hcMul + vm_marker;
  return hc * hcMul + super.hashCode();
}
Program: 69877
Project: 69877
Buggy source:
/** 
 * should be overridden by subclasses for debug info
 */
public String toString(){
  return "String_Node_Str" + getCommand();
}

Fixed version (ground truth):
/** 
 * should be overridden by subclasses for debug info
 */
@Override public String toString(){
  return "String_Node_Str" + getCommand();
}
Program: 69878
Project: 69878
Buggy source:
/** 
 * @param command
 */
public MultiUserEvent(String command){
  super(command);
  vm_marker=VM_MARKER;
}

Fixed version (ground truth):
/** 
 * @param command
 */
public MultiUserEvent(String command){
  super(command);
  vm_marker=WebappHelper.getNodeId();
}
Program: 69879
Project: 69879
Buggy source:
/** 
 * is called repeatedly caused by Collections.sort(...);
 * @see org.olat.core.gui.components.table.ColumnDescriptor#compareTo(int,int)
 */
@Override public int compareTo(final int rowa,final int rowb){
  Object a=table.getTableDataModel().getValueAt(rowa,dataColumn);
  Object b=table.getTableDataModel().getValueAt(rowb,dataColumn);
  if (a == null || b == null) {
    return compareNullObjects(a,b);
  }
  if (a instanceof String && b instanceof String) {
    return collator.compare(a,b);
  }
 else   if (a instanceof Comparable && b instanceof Comparable) {
    return compareComparablesAndTimestamps(a,b);
  }
 else   if (a instanceof Boolean && b instanceof Boolean) {
    return compareBooleans((Boolean)a,(Boolean)b);
  }
 else {
    return a.toString().compareTo(b.toString());
  }
}

Fixed version (ground truth):
/** 
 * is called repeatedly caused by Collections.sort(...);
 * @see org.olat.core.gui.components.table.ColumnDescriptor#compareTo(int,int)
 */
@Override public int compareTo(final int rowa,final int rowb){
  Object a=table.getTableDataModel().getValueAt(rowa,dataColumn);
  Object b=table.getTableDataModel().getValueAt(rowb,dataColumn);
  if (a == null || b == null) {
    return compareNullObjects(a,b);
  }
  if (a instanceof String && b instanceof String) {
    return collator.compare(a,b);
  }
  if (a instanceof Date && b instanceof Date) {
    return compareDateAndTimestamps((Date)a,(Date)b);
  }
  if (a instanceof Comparable && b instanceof Comparable) {
    return ((Comparable)a).compareTo((Comparable)b);
  }
  return a.toString().compareTo(b.toString());
}
Program: 69880
Project: 69880
Buggy source:
protected void resort(){
  if (isSortingEnabled()) {
    currentSortingCd=getColumnDescriptor(sortColumn);
    int cdcnt=getColumnCount();
    for (int i=0; i < cdcnt; i++) {
      ColumnDescriptor cd=getColumnDescriptor(i);
      if (cd != currentSortingCd) {
        cd.otherColumnDescriptorSorted();
      }
    }
    if (currentSortingCd == null) {
      throw new RuntimeException("String_Node_Str" + sortColumn + "String_Node_Str");
    }
    currentSortingCd.sortingAboutToStart();
    long start=0;
    long stop=0;
    boolean logDebug=Tracing.isDebugEnabled(Table.class);
    if (logDebug) {
      start=System.currentTimeMillis();
    }
    Collections.sort(sorter,this);
    if (logDebug) {
      stop=System.currentTimeMillis();
      TableDataModel model=getTableDataModel();
      Tracing.logDebug("String_Node_Str" + (model == null ? "String_Node_Str" : model.getRowCount()) + "String_Node_Str"+ (stop - start)+ "String_Node_Str",Table.class);
    }
  }
}

Fixed version (ground truth):
protected void resort(){
  if (isSortingEnabled()) {
    currentSortingCd=getColumnDescriptor(sortColumn);
    int cdcnt=getColumnCount();
    for (int i=0; i < cdcnt; i++) {
      ColumnDescriptor cd=getColumnDescriptor(i);
      if (cd != currentSortingCd) {
        cd.otherColumnDescriptorSorted();
      }
    }
    if (currentSortingCd == null) {
      throw new RuntimeException("String_Node_Str" + sortColumn + "String_Node_Str");
    }
    currentSortingCd.sortingAboutToStart();
    long start=0;
    boolean logDebug=Tracing.isDebugEnabled(Table.class);
    if (logDebug) {
      start=System.currentTimeMillis();
    }
    Collections.sort(sorter,this);
    if (logDebug) {
      long stop=System.currentTimeMillis();
      TableDataModel model=getTableDataModel();
      Tracing.logDebug("String_Node_Str" + (model == null ? "String_Node_Str" : model.getRowCount()) + "String_Node_Str"+ (stop - start)+ "String_Node_Str",Table.class);
    }
  }
}
Program: 69883
Project: 69883
Buggy source:
public static CourseEnvironment getPreviewCourseEnvironment(boolean isCoach,boolean isCourseAdmin,ICourse course){
  final OLATResource courseResource=course.getCourseEnvironment().getCourseGroupManager().getCourseResource();
  final CourseGroupManager cgm=new PreviewCourseGroupManager(courseResource,new ArrayList<BusinessGroup>(),new ArrayList<BGArea>(),isCoach,isCourseAdmin);
  final UserNodeAuditManager auditman=new PreviewAuditManager();
  final AssessmentManager am=new PreviewAssessmentManager();
  final CoursePropertyManager cpm=new PreviewCoursePropertyManager();
  final Structure runStructure=course.getEditorTreeModel().createStructureForPreview();
  final String title=course.getCourseTitle();
  CourseEnvironment previewCourseEnvironment=new PreviewCourseEnvironment(title,runStructure,new Date(),course.getCourseFolderContainer(),course.getCourseBaseContainer(),course.getResourceableId(),cpm,cgm,auditman,am);
  return previewCourseEnvironment;
}

Fixed version (ground truth):
public static CourseEnvironment getPreviewCourseEnvironment(boolean isCoach,boolean isCourseAdmin,ICourse course){
  final OLATResource courseResource=course.getCourseEnvironment().getCourseGroupManager().getCourseResource();
  final CourseGroupManager cgm=new PreviewCourseGroupManager(courseResource,new ArrayList<BusinessGroup>(),new ArrayList<BGArea>(),isCoach,isCourseAdmin);
  final UserNodeAuditManager auditman=new PreviewAuditManager();
  final AssessmentManager am=new PreviewAssessmentManager();
  final CoursePropertyManager cpm=new PreviewCoursePropertyManager();
  final Structure runStructure=course.getEditorTreeModel().createStructureForPreview();
  final String title=course.getCourseTitle();
  final CourseConfig courseConfig=course.getCourseEnvironment().getCourseConfig();
  CourseEnvironment previewCourseEnvironment=new PreviewCourseEnvironment(title,runStructure,new Date(),course.getCourseFolderContainer(),course.getCourseBaseContainer(),course.getResourceableId(),cpm,cgm,auditman,am,courseConfig);
  return previewCourseEnvironment;
}
Program: 69884
Project: 69884
Buggy source:
public CourseConfig getCourseConfig(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public CourseConfig getCourseConfig(){
  return courseConfig;
}
Program: 69885
Project: 69885
Buggy source:
PreviewCourseEnvironment(String title,Structure runStructure,Date simulatedDateTime,VFSContainer courseFolderContainer,OlatRootFolderImpl courseBaseContainer,Long courseResourceableID,CoursePropertyManager cpm,CourseGroupManager cgm,UserNodeAuditManager auditman,AssessmentManager am){
  super();
  this.title=title;
  this.simulatedDateTime=simulatedDateTime.getTime();
  this.courseFolderContainer=courseFolderContainer;
  this.courseBaseContainer=courseBaseContainer;
  this.runStructure=runStructure;
  this.cpm=cpm;
  this.cgm=cgm;
  this.auditman=auditman;
  this.am=am;
  this.resourceablId=courseResourceableID;
}

Fixed version (ground truth):
PreviewCourseEnvironment(String title,Structure runStructure,Date simulatedDateTime,VFSContainer courseFolderContainer,OlatRootFolderImpl courseBaseContainer,Long courseResourceableID,CoursePropertyManager cpm,CourseGroupManager cgm,UserNodeAuditManager auditman,AssessmentManager am,CourseConfig courseConfig){
  super();
  this.title=title;
  this.simulatedDateTime=simulatedDateTime.getTime();
  this.courseFolderContainer=courseFolderContainer;
  this.courseBaseContainer=courseBaseContainer;
  this.runStructure=runStructure;
  this.cpm=cpm;
  this.cgm=cgm;
  this.auditman=auditman;
  this.am=am;
  this.resourceablId=courseResourceableID;
  this.courseConfig=courseConfig.clone();
}
Program: 69886
Project: 69886
Buggy source:
/** 
 * @see org.olat.course.run.environment.CourseEnvironment#setCourseConfig()
 */
public void setCourseConfig(CourseConfig cc){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @see org.olat.course.run.environment.CourseEnvironment#setCourseConfig()
 */
public void setCourseConfig(CourseConfig cc){
  courseConfig=(cc == null ? null : cc.clone());
}
Program: 69888
Project: 69888
Buggy source:
protected void doChangePermission(UserRequest ureq,MemberPermissionChangeEvent changes,List<Identity> members,boolean sendMail){
  if (repoEntry != null) {
    List<RepositoryEntryPermissionChangeEvent> repoChanges=changes.generateRepositoryChanges(members);
    repositoryManager.updateRepositoryEntryMembership(getIdentity(),ureq.getUserSession().getRoles(),repoEntry,repoChanges,null);
  }
  List<BusinessGroupMembershipChange> allModifications=changes.generateBusinessGroupMembershipChange(members);
  businessGroupService.updateMemberships(getIdentity(),allModifications,null);
  DBFactory.getInstance().commitAndCloseSession();
  if (allModifications != null && !allModifications.isEmpty()) {
    for (    BusinessGroupMembershipChange mod : allModifications) {
      sendMailAfterChangePermission(mod);
    }
  }
  DBFactory.getInstance().commitAndCloseSession();
  reloadModel();
}

Fixed version (ground truth):
protected void doChangePermission(UserRequest ureq,MemberPermissionChangeEvent changes,List<Identity> members,boolean sendMail){
  MailPackage mailing=new MailPackage(sendMail);
  if (repoEntry != null) {
    List<RepositoryEntryPermissionChangeEvent> repoChanges=changes.generateRepositoryChanges(members);
    repositoryManager.updateRepositoryEntryMembership(getIdentity(),ureq.getUserSession().getRoles(),repoEntry,repoChanges,mailing);
  }
  List<BusinessGroupMembershipChange> allModifications=changes.generateBusinessGroupMembershipChange(members);
  businessGroupService.updateMemberships(getIdentity(),allModifications,mailing);
  DBFactory.getInstance().commitAndCloseSession();
  reloadModel();
}
Program: 69889
Project: 69889
Buggy source:
/** 
 * @see org.olat.login.auth.AuthenticationController#init(org.olat.core.gui.UserRequest,org.olat.core.gui.control.WindowControl)
 */
public OLATAuthenticationController(UserRequest ureq,WindowControl winControl){
  super(ureq,winControl,Util.createPackageTranslator(RegistrationManager.class,ureq.getLocale()));
  loginComp=createVelocityContainer("String_Node_Str","String_Node_Str");
  if (UserModule.isPwdchangeallowed(null)) {
    pwLink=LinkFactory.createLink("String_Node_Str","String_Node_Str",loginComp,this);
    pwLink.setCustomEnabledLinkCSS("String_Node_Str");
  }
  if (CoreSpringFactory.getImpl(RegistrationModule.class).isSelfRegistrationEnabled() && CoreSpringFactory.getImpl(RegistrationModule.class).isSelfRegistrationLoginEnabled()) {
    registerLink=LinkFactory.createLink("String_Node_Str","String_Node_Str",loginComp,this);
    registerLink.setCustomEnabledLinkCSS("String_Node_Str");
  }
  if (LoginModule.isGuestLoginLinksEnabled()) {
    anoLink=LinkFactory.createLink("String_Node_Str","String_Node_Str",loginComp,this);
    anoLink.setCustomEnabledLinkCSS("String_Node_Str");
  }
  loginForm=new OLATAuthentcationForm(ureq,winControl,"String_Node_Str",getTranslator());
  listenTo(loginForm);
  loginComp.put("String_Node_Str",loginForm.getInitialComponent());
  if (ureq.getParameterSet().contains(PARAM_LOGINERROR)) {
    showError(translate("String_Node_Str",WebappHelper.getMailConfig("String_Node_Str")));
  }
  putInitialPanel(loginComp);
}

Fixed version (ground truth):
/** 
 * @see org.olat.login.auth.AuthenticationController#init(org.olat.core.gui.UserRequest,org.olat.core.gui.control.WindowControl)
 */
public OLATAuthenticationController(UserRequest ureq,WindowControl winControl){
  super(ureq,winControl,Util.createPackageTranslator(RegistrationManager.class,ureq.getLocale()));
  loginComp=createVelocityContainer("String_Node_Str","String_Node_Str");
  if (UserModule.isPwdchangeallowed(null)) {
    pwLink=LinkFactory.createLink("String_Node_Str","String_Node_Str",loginComp,this);
    pwLink.setCustomEnabledLinkCSS("String_Node_Str");
  }
  if (CoreSpringFactory.getImpl(RegistrationModule.class).isSelfRegistrationEnabled() && CoreSpringFactory.getImpl(RegistrationModule.class).isSelfRegistrationLoginEnabled()) {
    registerLink=LinkFactory.createLink("String_Node_Str","String_Node_Str",loginComp,this);
    registerLink.setCustomEnabledLinkCSS("String_Node_Str");
  }
  if (LoginModule.isGuestLoginLinksEnabled()) {
    anoLink=LinkFactory.createLink("String_Node_Str","String_Node_Str",loginComp,this);
    anoLink.setCustomEnabledLinkCSS("String_Node_Str");
    anoLink.setEnabled(!AuthHelper.isLoginBlocked());
  }
  loginForm=new OLATAuthentcationForm(ureq,winControl,"String_Node_Str",getTranslator());
  listenTo(loginForm);
  loginComp.put("String_Node_Str",loginForm.getInitialComponent());
  if (ureq.getParameterSet().contains(PARAM_LOGINERROR)) {
    showError(translate("String_Node_Str",WebappHelper.getMailConfig("String_Node_Str")));
  }
  putInitialPanel(loginComp);
}
Program: 69893
Project: 69893
Buggy source:
/** 
 * adds the tab. (upon Event.DONE of the contained controller && if controller is DTabAware -> controller.dispose called by dtabs)
 * @param dt
 */
public void addDTab(UserRequest ureq,DTab dt);

Fixed version (ground truth):
/** 
 * adds the tab. (upon Event.DONE of the contained controller && if controller is DTabAware -> controller.dispose called by dtabs)
 * @param dt
 */
public boolean addDTab(UserRequest ureq,DTab dt);
Program: 69899
Project: 69899
Buggy source:
@Override public void getAutoCompleteContent(String searchValue,Map<String,String> resMap){
  if (StringHelper.containsNonWhitespace(searchValue)) {
    String searchValueLower=searchValue.toLowerCase();
    for (    BusinessGroup group : groupList) {
      if (group.getName().toLowerCase().indexOf(searchValueLower) >= 0) {
        resMap.put(group.getName(),group.getKey().toString());
      }
    }
  }
}

Fixed version (ground truth):
@Override public void getAutoCompleteContent(String searchValue,Map<String,String> resMap){
  if (StringHelper.containsNonWhitespace(searchValue)) {
    String searchValueLower=searchValue.toLowerCase();
    for (    BusinessGroup group : groupList) {
      if (group.getName() != null && group.getName().toLowerCase().indexOf(searchValueLower) >= 0) {
        resMap.put(group.getName(),group.getKey().toString());
      }
    }
  }
}
Program: 69901
Project: 69901
Buggy source:
@Override protected void formOK(UserRequest ureq){
  secureListBox();
  List<EPMapPolicy> mapPolicies=new ArrayList<EPMapPolicy>();
  for (  PolicyWrapper wrapper : policyWrappers) {
    mapPolicies.add(wrapper.getMapPolicy());
    if (wrapper.getType().equals(EPMapPolicy.Type.invitation)) {
      sendInvitation(ureq,wrapper);
    }
  }
  ePFMgr.updateMapPolicies(map,mapPolicies);
  fireEvent(ureq,Event.DONE_EVENT);
}

Fixed version (ground truth):
@Override protected void formOK(UserRequest ureq){
  secureListBox();
  List<EPMapPolicy> mapPolicies=new ArrayList<EPMapPolicy>();
  for (  PolicyWrapper wrapper : policyWrappers) {
    if (wrapper.getType() == null)     continue;
    mapPolicies.add(wrapper.getMapPolicy());
    if (wrapper.getType().equals(EPMapPolicy.Type.invitation)) {
      sendInvitation(ureq,wrapper);
    }
  }
  ePFMgr.updateMapPolicies(map,mapPolicies);
  fireEvent(ureq,Event.DONE_EVENT);
}
Program: 69902
Project: 69902
Buggy source:
public static void redirectToServiceNotAvailable(HttpServletResponse response){
  String pathStaticDir=StaticMediaDispatcher.getStaticMapperPath();
  redirectTo(response,WebappHelper.getServletContextPath() + pathStaticDir + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Sent to standard 503 if not available
 * @param response
 */
public static void redirectToServiceNotAvailable(HttpServletResponse response){
  try {
    response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
}
Program: 69903
Project: 69903
Buggy source:
/** 
 * @param identity the identity for which to properties are to be loaded. if null, the properties of all identities (=all properties of this course) are loaded.
 * @return
 */
private List<Property> loadPropertiesFor(List<Identity> identities){
  ICourse course=CourseFactory.loadCourse(ores);
  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(ATTEMPTS).append("String_Node_Str").append(SCORE).append("String_Node_Str").append(PASSED).append("String_Node_Str").append(ASSESSMENT_ID).append("String_Node_Str").append(COMMENT).append("String_Node_Str").append(COACH_COMMENT).append("String_Node_Str");
  if (identities != null) {
    sb.append("String_Node_Str");
  }
  TypedQuery<Property> query=DBFactory.getInstance().getCurrentEntityManager().createQuery(sb.toString(),Property.class).setParameter("String_Node_Str",course.getResourceableTypeName()).setParameter("String_Node_Str",course.getResourceableId());
  if (identities != null) {
    query.setParameter("String_Node_Str",PersistenceHelper.toKeys(identities));
  }
  return query.getResultList();
}

Fixed version (ground truth):
/** 
 * @param identity the identity for which to properties are to be loaded. if null, the properties of all identities (=all properties of this course) are loaded.
 * @return
 */
private List<Property> loadPropertiesFor(List<Identity> identities){
  if (identities == null || identities.isEmpty())   return Collections.emptyList();
  ICourse course=CourseFactory.loadCourse(ores);
  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(ATTEMPTS).append("String_Node_Str").append(SCORE).append("String_Node_Str").append(PASSED).append("String_Node_Str").append(ASSESSMENT_ID).append("String_Node_Str").append(COMMENT).append("String_Node_Str").append(COACH_COMMENT).append("String_Node_Str");
  if (identities != null) {
    sb.append("String_Node_Str");
  }
  TypedQuery<Property> query=DBFactory.getInstance().getCurrentEntityManager().createQuery(sb.toString(),Property.class).setParameter("String_Node_Str",course.getResourceableTypeName()).setParameter("String_Node_Str",course.getResourceableId());
  if (identities != null) {
    query.setParameter("String_Node_Str",PersistenceHelper.toKeys(identities));
  }
  return query.getResultList();
}
Program: 69904
Project: 69904
Buggy source:
/** 
 * @param login
 * @param pass
 * @return Identity if authentication was successfull, null otherwise.
 * @deprecated should not be part of the controller
 */
public static Identity authenticate(String login,String pass){
  if (pass == null)   return null;
  Identity ident=BaseSecurityManager.getInstance().findIdentityByName(login);
  if (ident == null && LoginModule.allowLoginUsingEmail()) {
    if (MailHelper.isValidEmailAddress(login)) {
      ident=UserManager.getInstance().findIdentityByEmail(login);
    }
    if (ident == null) {
      ident=findIdentInChangingEmailWorkflow(login);
    }
  }
  ident.getUser().getPreferences().getLanguage();
  if (ident == null)   return null;
  Authentication auth=BaseSecurityManager.getInstance().findAuthentication(ident,BaseSecurityModule.getDefaultAuthProviderIdentifier());
  if (auth != null && auth.getCredential().equals(Encoder.encrypt(pass)))   return ident;
  Tracing.createLoggerFor(OLATAuthenticationController.class).audit("String_Node_Str" + login + "String_Node_Str",OLATAuthenticationController.class.getName());
  return null;
}

Fixed version (ground truth):
/** 
 * @param login
 * @param pass
 * @return Identity if authentication was successfull, null otherwise.
 * @deprecated should not be part of the controller
 */
public static Identity authenticate(String login,String pass){
  if (pass == null)   return null;
  Identity ident=BaseSecurityManager.getInstance().findIdentityByName(login);
  if (ident == null && LoginModule.allowLoginUsingEmail()) {
    if (MailHelper.isValidEmailAddress(login)) {
      ident=UserManager.getInstance().findIdentityByEmail(login);
    }
    if (ident == null) {
      ident=findIdentInChangingEmailWorkflow(login);
    }
  }
  if (ident == null) {
    return null;
  }
  Authentication auth=BaseSecurityManager.getInstance().findAuthentication(ident,BaseSecurityModule.getDefaultAuthProviderIdentifier());
  if (auth != null && auth.getCredential().equals(Encoder.encrypt(pass)))   return ident;
  Tracing.createLoggerFor(OLATAuthenticationController.class).audit("String_Node_Str" + login + "String_Node_Str",OLATAuthenticationController.class.getName());
  return null;
}
Program: 69905
Project: 69905
Buggy source:
/** 
 * @see org.olat.qti.process.Navigator#submitAssessment()
 */
public final void submitAssessment(){
  Output pendingOutput=null;
  boolean pendingFeedback=getInfo().isFeedback();
  boolean alreadyClosed=getAssessmentInstance().isClosed();
  if (pendingFeedback && getAssessmentInstance().getAssessmentContext().getCurrentSectionContext() != null) {
    ItemContext itc=getAssessmentInstance().getAssessmentContext().getCurrentSectionContext().getCurrentItemContext();
    pendingOutput=itc.getOutput();
  }
  getAssessmentInstance().close();
  if (!getAssessmentInstance().isPreview() && !alreadyClosed) {
    IQManager.getInstance().persistResults(getAssessmentInstance());
  }
  AssessmentContext ac=getAssessmentContext();
  info.clear();
  if (ac.isFeedbackavailable()) {
    Output outp=ac.getOutput();
    getInfo().setCurrentOutput(outp);
    getInfo().setFeedback(true);
  }
 else   if (pendingFeedback) {
    getInfo().setCurrentOutput(pendingOutput);
    getInfo().setFeedback(true);
  }
  info.setMessage(QTIConstants.MESSAGE_ASSESSMENT_SUBMITTED);
  info.setStatus(QTIConstants.ASSESSMENT_FINISHED);
  info.setRenderItems(false);
  if (delegate != null) {
    delegate.submitAssessment(assessmentInstance);
  }
}

Fixed version (ground truth):
/** 
 * @see org.olat.qti.process.Navigator#submitAssessment()
 */
public final void submitAssessment(){
  Output pendingOutput=null;
  boolean pendingFeedback=getInfo().isFeedback();
  boolean alreadyClosed=getAssessmentInstance().isClosed();
  if (pendingFeedback && getAssessmentInstance().getAssessmentContext().getCurrentSectionContext() != null) {
    ItemContext itc=getAssessmentInstance().getAssessmentContext().getCurrentSectionContext().getCurrentItemContext();
    pendingOutput=itc.getOutput();
  }
  getAssessmentInstance().close();
  if (!getAssessmentInstance().isPreview() && !alreadyClosed) {
    IQManager.getInstance().persistResults(getAssessmentInstance());
  }
  AssessmentContext ac=getAssessmentContext();
  info.clear();
  if (ac.isFeedbackavailable()) {
    Output outp=ac.getOutput();
    getInfo().setCurrentOutput(outp);
    getInfo().setFeedback(true);
  }
 else   if (pendingFeedback) {
    getInfo().setCurrentOutput(pendingOutput);
    getInfo().setFeedback(true);
  }
  info.setMessage(QTIConstants.MESSAGE_ASSESSMENT_SUBMITTED);
  info.setStatus(QTIConstants.ASSESSMENT_FINISHED);
  info.setRenderItems(false);
  if (delegate != null && !getAssessmentInstance().isPreview() && !alreadyClosed) {
    delegate.submitAssessment(assessmentInstance);
  }
}
Program: 69906
Project: 69906
Buggy source:
@Override public boolean deletePolicies(Collection<SecurityGroup> secGroups,Collection<OLATResource> resources){
  if (secGroups == null || secGroups.isEmpty() || resources == null || resources.isEmpty())   return false;
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(PolicyImpl.class.getName()).append("String_Node_Str").append("String_Node_Str");
  List<Long> secGroupKeys=PersistenceHelper.toKeys(secGroups);
  List<Long> resourceKeys=PersistenceHelper.toKeys(resources);
  int rows=DBFactory.getInstance().getCurrentEntityManager().createQuery(sb.toString()).setParameter("String_Node_Str",resourceKeys).setParameter("String_Node_Str",secGroupKeys).executeUpdate();
  return rows > 0;
}

Fixed version (ground truth):
@Override public void deletePolicies(OLATResource resource){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(PolicyImpl.class.getName()).append("String_Node_Str").append("String_Node_Str");
  int rowDeleted=DBFactory.getInstance().getCurrentEntityManager().createQuery(sb.toString()).setParameter("String_Node_Str",resource.getKey()).executeUpdate();
  if (isLogDebugEnabled()) {
    logDebug(rowDeleted + "String_Node_Str");
  }
}
Program: 69907
Project: 69907
Buggy source:
/** 
 * @see org.olat.course.groupsandrights.CourseGroupManager#deleteCourseGroupmanagement()
 */
public void deleteCourseGroupmanagement(){
  businessGroupService.removeResource(courseResource);
  logAudit("String_Node_Str" + courseResource.toString());
}

Fixed version (ground truth):
/** 
 * @see org.olat.course.groupsandrights.CourseGroupManager#deleteCourseGroupmanagement()
 */
public void deleteCourseGroupmanagement(){
  businessGroupService.removeResource(courseResource);
  List<BGArea> areas=getAllAreas();
  for (  BGArea area : areas) {
    areaManager.deleteBGArea(area);
  }
  logAudit("String_Node_Str" + courseResource.toString());
}
Program: 69908
Project: 69908
Buggy source:
/** 
 * clean up a repo entry with all children and associated data like bookmarks and user references to it
 * @param ureq
 * @param wControl
 * @param entry
 * @return FIXME: we need a delete method without ureq, wControl for manager use. In general, very bad idea to pass ureq and wControl down to the manger layer.
 */
public boolean deleteRepositoryEntryWithAllData(UserRequest ureq,WindowControl wControl,RepositoryEntry entry){
  logDebug("String_Node_Str" + entry);
  entry=(RepositoryEntry)DBFactory.getInstance().loadObject(entry,true);
  logDebug("String_Node_Str" + entry);
  logDebug("String_Node_Str" + entry.getOwnerGroup());
  RepositoryHandler handler=RepositoryHandlerFactory.getInstance().getRepositoryHandler(entry);
  OLATResource ores=entry.getOlatResource();
  if (!handler.readyToDelete(ores,ureq,wControl)) {
    return false;
  }
  deleteImage(entry);
  userCourseInformationsManager.deleteUserCourseInformations(entry);
  BookmarkManager.getInstance().deleteAllBookmarksFor(entry);
  CatalogManager.getInstance().resourceableDeleted(entry);
  entry=(RepositoryEntry)DBFactory.getInstance().loadObject(entry,true);
  logDebug("String_Node_Str" + entry);
  deleteRepositoryEntryAndBasesecurity(entry);
  handler.cleanupOnDelete(entry.getOlatResource());
  logDebug("String_Node_Str");
  return true;
}

Fixed version (ground truth):
/** 
 * clean up a repo entry with all children and associated data like bookmarks and user references to it
 * @param ureq
 * @param wControl
 * @param entry
 * @return FIXME: we need a delete method without ureq, wControl for manager use. In general, very bad idea to pass ureq and wControl down to the manger layer.
 */
public boolean deleteRepositoryEntryWithAllData(UserRequest ureq,WindowControl wControl,RepositoryEntry entry){
  logDebug("String_Node_Str" + entry);
  entry=(RepositoryEntry)DBFactory.getInstance().loadObject(entry,true);
  logDebug("String_Node_Str" + entry);
  logDebug("String_Node_Str" + entry.getOwnerGroup());
  RepositoryHandler handler=RepositoryHandlerFactory.getInstance().getRepositoryHandler(entry);
  OLATResource ores=entry.getOlatResource();
  deleteBGcontext(ores);
  if (!handler.readyToDelete(ores,ureq,wControl)) {
    return false;
  }
  deleteImage(entry);
  userCourseInformationsManager.deleteUserCourseInformations(entry);
  BookmarkManager.getInstance().deleteAllBookmarksFor(entry);
  CatalogManager.getInstance().resourceableDeleted(entry);
  entry=(RepositoryEntry)DBFactory.getInstance().loadObject(entry,true);
  handler.cleanupOnDelete(entry.getOlatResource());
  logDebug("String_Node_Str" + entry);
  deleteRepositoryEntryAndBasesecurity(entry);
  logDebug("String_Node_Str");
  return true;
}
Program: 69909
Project: 69909
Buggy source:
/** 
 * @param addedEntry
 */
public void deleteRepositoryEntryAndBasesecurity(RepositoryEntry entry){
  entry=(RepositoryEntry)DBFactory.getInstance().loadObject(entry,true);
  DBFactory.getInstance().deleteObject(entry);
  OLATResourceManager.getInstance().deleteOLATResourceable(entry);
  SecurityGroup ownerGroup=entry.getOwnerGroup();
  if (ownerGroup != null) {
    Tracing.logDebug("String_Node_Str" + ownerGroup,this.getClass());
    BaseSecurityManager.getInstance().deleteSecurityGroup(ownerGroup);
    OLATResourceManager.getInstance().deleteOLATResourceable(ownerGroup);
  }
  SecurityGroup participantGroup=entry.getParticipantGroup();
  if (participantGroup != null) {
    logDebug("String_Node_Str" + participantGroup);
    BaseSecurityManager.getInstance().deleteSecurityGroup(participantGroup);
    OLATResourceManager.getInstance().deleteOLATResourceable(participantGroup);
  }
  SecurityGroup tutorGroup=entry.getTutorGroup();
  if (tutorGroup != null) {
    logDebug("String_Node_Str" + tutorGroup);
    BaseSecurityManager.getInstance().deleteSecurityGroup(tutorGroup);
    OLATResourceManager.getInstance().deleteOLATResourceable(tutorGroup);
  }
  deleteImage(entry);
}

Fixed version (ground truth):
/** 
 * @param addedEntry
 */
public void deleteRepositoryEntryAndBasesecurity(RepositoryEntry entry){
  entry=(RepositoryEntry)DBFactory.getInstance().loadObject(entry,true);
  BaseSecurityManager.getInstance().deletePolicies(entry.getOlatResource());
  DBFactory.getInstance().deleteObject(entry);
  OLATResourceManager.getInstance().deleteOLATResourceable(entry);
  SecurityGroup ownerGroup=entry.getOwnerGroup();
  if (ownerGroup != null) {
    Tracing.logDebug("String_Node_Str" + ownerGroup,this.getClass());
    BaseSecurityManager.getInstance().deleteSecurityGroup(ownerGroup);
    OLATResourceManager.getInstance().deleteOLATResourceable(ownerGroup);
  }
  SecurityGroup participantGroup=entry.getParticipantGroup();
  if (participantGroup != null) {
    logDebug("String_Node_Str" + participantGroup);
    BaseSecurityManager.getInstance().deleteSecurityGroup(participantGroup);
    OLATResourceManager.getInstance().deleteOLATResourceable(participantGroup);
  }
  SecurityGroup tutorGroup=entry.getTutorGroup();
  if (tutorGroup != null) {
    logDebug("String_Node_Str" + tutorGroup);
    BaseSecurityManager.getInstance().deleteSecurityGroup(tutorGroup);
    OLATResourceManager.getInstance().deleteOLATResourceable(tutorGroup);
  }
  deleteImage(entry);
}
Program: 69910
Project: 69910
Buggy source:
@Test public void testBasicSecurityPutCall() throws IOException, URISyntaxException {
  assertTrue(conn.login("String_Node_Str","String_Node_Str"));
  GroupVO vo=new GroupVO();
  vo.setName("String_Node_Str");
  vo.setDescription("String_Node_Str");
  vo.setMinParticipants(new Integer(-1));
  vo.setMaxParticipants(new Integer(-1));
  URI request=UriBuilder.fromUri(getContextURI()).path("String_Node_Str" + courseRepoEntry.getResourceableId() + "String_Node_Str").build();
  HttpPut method=conn.createPut(request,MediaType.APPLICATION_JSON,true);
  conn.addJsonEntity(method,vo);
  HttpResponse response=conn.execute(method);
  EntityUtils.consume(response.getEntity());
  assertEquals(401,response.getStatusLine().getStatusCode());
}

Fixed version (ground truth):
@Test public void testBasicSecurityPutCall() throws IOException, URISyntaxException {
  assertTrue(conn.login("String_Node_Str","String_Node_Str"));
  GroupVO vo=new GroupVO();
  vo.setName("String_Node_Str");
  vo.setDescription("String_Node_Str");
  vo.setMinParticipants(new Integer(-1));
  vo.setMaxParticipants(new Integer(-1));
  URI request=UriBuilder.fromUri(getContextURI()).path("String_Node_Str" + courseRepoEntry.getOlatResource().getResourceableId() + "String_Node_Str").build();
  HttpPut method=conn.createPut(request,MediaType.APPLICATION_JSON,true);
  conn.addJsonEntity(method,vo);
  HttpResponse response=conn.execute(method);
  EntityUtils.consume(response.getEntity());
  assertEquals(401,response.getStatusLine().getStatusCode());
}