Program: 69644
Project: 69644
Buggy source:
/** 
 * implementation of listener which listens to publish events
 * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
 */
@Override public void event(Event event){
  if (event instanceof MultiUserEvent) {
    if (event.getCommand().equals(JOINED) || event.getCommand().equals(LEFT)) {
      updateCurrentUserCount();
    }
  }
 else   if (event instanceof PublishEvent) {
    PublishEvent pe=(PublishEvent)event;
    if (pe.getState() == PublishEvent.PRE_PUBLISH) {
      return;
    }
    if (!course.getResourceableId().equals(pe.getPublishedCourseResId()))     throw new AssertException("String_Node_Str");
    if (isInEditor) {
      needsRebuildAfterPublish=true;
    }
 else {
      doDisposeAfterEvent();
    }
  }
 else   if (event instanceof OLATResourceableJustBeforeDeletedEvent) {
    OLATResourceableJustBeforeDeletedEvent ojde=(OLATResourceableJustBeforeDeletedEvent)event;
    if (ojde.targetEquals(course,true)) {
      doDisposeAfterEvent();
    }
  }
 else   if (event instanceof AssessmentChangedEvent) {
    AssessmentChangedEvent ace=(AssessmentChangedEvent)event;
    Identity identity=uce.getIdentityEnvironment().getIdentity();
    if (ace.getIdentityKey().equals(identity.getKey())) {
      String assessmentChangeType=ace.getCommand();
      if (assessmentChangeType.equals(AssessmentChangedEvent.TYPE_SCORE_EVAL_CHANGED) || assessmentChangeType.equals(AssessmentChangedEvent.TYPE_ATTEMPTS_CHANGED)) {
        assessmentChangedEventReceived=true;
      }
 else       if (assessmentChangeType.equals(AssessmentChangedEvent.TYPE_EFFICIENCY_STATEMENT_CHANGED)) {
        UserEfficiencyStatement es=efficiencyStatementManager.getUserEfficiencyStatementLight(courseRepositoryEntry.getKey(),identity);
        efficiencyStatementsLink.setEnabled(es != null);
      }
      needsRebuildAfterRunDone=true;
    }
  }
 else   if (event instanceof BusinessGroupModifiedEvent) {
    processBusinessGroupModifiedEvent((BusinessGroupModifiedEvent)event);
  }
 else   if (event instanceof CourseConfigEvent) {
    processCourseConfigEvent((CourseConfigEvent)event);
  }
 else   if (event instanceof EntryChangedEvent && ((EntryChangedEvent)event).getChange() != EntryChangedEvent.MODIFIED_AT_PUBLISH) {
    EntryChangedEvent repoEvent=(EntryChangedEvent)event;
    if (courseRepositoryEntry.getKey().equals(repoEvent.getChangedEntryKey()) && repoEvent.getChange() == EntryChangedEvent.MODIFIED) {
      doDisposeAfterEvent();
    }
  }
}

Fixed version (ground truth):
/** 
 * implementation of listener which listens to publish events
 * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
 */
@Override public void event(Event event){
  if (event instanceof MultiUserEvent) {
    if (event.getCommand().equals(JOINED) || event.getCommand().equals(LEFT)) {
      updateCurrentUserCount();
    }
  }
 else   if (event instanceof PublishEvent) {
    PublishEvent pe=(PublishEvent)event;
    if (pe.getState() == PublishEvent.PRE_PUBLISH) {
      return;
    }
    if (!course.getResourceableId().equals(pe.getPublishedCourseResId()))     throw new AssertException("String_Node_Str");
    if (isInEditor) {
      needsRebuildAfterPublish=true;
    }
 else {
      doDisposeAfterEvent();
    }
  }
 else   if (event instanceof OLATResourceableJustBeforeDeletedEvent) {
    OLATResourceableJustBeforeDeletedEvent ojde=(OLATResourceableJustBeforeDeletedEvent)event;
    if (ojde.targetEquals(course,true)) {
      doDisposeAfterEvent();
    }
  }
 else   if (event instanceof AssessmentChangedEvent) {
    AssessmentChangedEvent ace=(AssessmentChangedEvent)event;
    Identity identity=uce.getIdentityEnvironment().getIdentity();
    if (ace.getIdentityKey().equals(identity.getKey())) {
      String assessmentChangeType=ace.getCommand();
      if (assessmentChangeType.equals(AssessmentChangedEvent.TYPE_SCORE_EVAL_CHANGED) || assessmentChangeType.equals(AssessmentChangedEvent.TYPE_ATTEMPTS_CHANGED)) {
        assessmentChangedEventReceived=true;
      }
 else       if (assessmentChangeType.equals(AssessmentChangedEvent.TYPE_EFFICIENCY_STATEMENT_CHANGED)) {
        UserEfficiencyStatement es=efficiencyStatementManager.getUserEfficiencyStatementLight(courseRepositoryEntry.getKey(),identity);
        efficiencyStatementsLink.setEnabled(es != null);
        efficiencyStatementsLink.setPopup(true);
      }
      needsRebuildAfterRunDone=true;
    }
  }
 else   if (event instanceof BusinessGroupModifiedEvent) {
    processBusinessGroupModifiedEvent((BusinessGroupModifiedEvent)event);
  }
 else   if (event instanceof CourseConfigEvent) {
    processCourseConfigEvent((CourseConfigEvent)event);
  }
 else   if (event instanceof EntryChangedEvent && ((EntryChangedEvent)event).getChange() != EntryChangedEvent.MODIFIED_AT_PUBLISH) {
    EntryChangedEvent repoEvent=(EntryChangedEvent)event;
    if (courseRepositoryEntry.getKey().equals(repoEvent.getChangedEntryKey()) && repoEvent.getChange() == EntryChangedEvent.MODIFIED) {
      doDisposeAfterEvent();
    }
  }
}