Program: 69461
Project: 69461
Buggy source:
/** 
 * called from signOffAndClear() called from event -> MUEvent the real work to do during sign off but without sending the multiuserevent this is used in case the user logs in to node1 and was logged in on node2 =>  node2 catches the sign on event and invalidates the user on node2 "silently", e.g. without firing an event.
 */
private void signOffAndClearWithout(final UserSession usess){
  boolean isDebug=log.isDebug();
  if (isDebug)   log.debug("String_Node_Str");
  final IdentityEnvironment identityEnvironment=usess.getIdentityEnvironment();
  final SessionInfo sessionInfo=usess.getSessionInfo();
  final Identity ident=identityEnvironment.getIdentity();
  if (isDebug)   log.debug("String_Node_Str" + sessionInfo);
  if (usess.isAuthenticated() && usess.getLastHistoryPoint() != null && !usess.getRoles().isGuestOnly()) {
    historyManager.persistHistoryPoint(ident,usess.getLastHistoryPoint());
  }
  Runnable run=new Runnable(){
    @Override public void run(){
      Object obj=null;
      try {
        if (ident != null) {
          ThreadLocalUserActivityLogger.log(OlatLoggingAction.OLAT_LOGOUT,UserSession.class,CoreLoggingResourceable.wrap(ident));
        }
 else {
        }
        List<Object> storeList=usess.getStoreValues();
        for (Iterator<Object> it_storevals=storeList.iterator(); it_storevals.hasNext(); ) {
          obj=it_storevals.next();
          if (obj instanceof Disposable) {
            ((Disposable)obj).dispose();
          }
        }
      }
 catch (      Exception e) {
        String objtostr="String_Node_Str";
        try {
          objtostr=obj.toString();
        }
 catch (        Exception ee) {
        }
        log.error("String_Node_Str" + objtostr,e);
      }
    }
  }
;
  ThreadLocalUserActivityLoggerInstaller.runWithUserActivityLogger(run,UserActivityLoggerImpl.newLoggerForValueUnbound(usess));
  if (authUserSessions.remove(usess)) {
    Identity previousSignedOn=identityEnvironment.getIdentity();
    if (previousSignedOn != null) {
      if (isDebug)       log.debug("String_Node_Str" + previousSignedOn.getName().toLowerCase());
      userNameToIdentity.remove(previousSignedOn.getKey());
      userSessionCache.remove(previousSignedOn.getKey());
    }
  }
 else   if (isDebug) {
    log.info("String_Node_Str" + ident + "String_Node_Str");
  }
  if (sessionInfo != null) {
    if (sessionInfo.isREST()) {
      sessionCountRest.decrementAndGet();
    }
 else     if (sessionInfo.isWebDAV()) {
      sessionCountDav.decrementAndGet();
    }
 else {
      sessionCountWeb.decrementAndGet();
    }
  }
  if (isDebug)   log.debug("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * called from signOffAndClear() called from event -> MUEvent the real work to do during sign off but without sending the multiuserevent this is used in case the user logs in to node1 and was logged in on node2 =>  node2 catches the sign on event and invalidates the user on node2 "silently", e.g. without firing an event.
 */
private void signOffAndClearWithout(final UserSession usess){
  boolean isDebug=log.isDebug();
  if (isDebug)   log.debug("String_Node_Str");
  final IdentityEnvironment identityEnvironment=usess.getIdentityEnvironment();
  final SessionInfo sessionInfo=usess.getSessionInfo();
  final Identity ident=identityEnvironment.getIdentity();
  if (isDebug)   log.debug("String_Node_Str" + sessionInfo);
  if (usess.isAuthenticated() && usess.getLastHistoryPoint() != null && !usess.getRoles().isGuestOnly()) {
    historyManager.persistHistoryPoint(ident,usess.getLastHistoryPoint());
  }
  Runnable run=new Runnable(){
    @Override public void run(){
      Object obj=null;
      try {
        if (ident != null) {
          ThreadLocalUserActivityLogger.log(OlatLoggingAction.OLAT_LOGOUT,UserSession.class,CoreLoggingResourceable.wrap(ident));
        }
 else {
        }
        List<Object> storeList=usess.getStoreValues();
        for (Iterator<Object> it_storevals=storeList.iterator(); it_storevals.hasNext(); ) {
          obj=it_storevals.next();
          if (obj instanceof Disposable) {
            ((Disposable)obj).dispose();
          }
        }
      }
 catch (      Exception e) {
        String objtostr="String_Node_Str";
        try {
          objtostr=obj.toString();
        }
 catch (        Exception ee) {
        }
        log.error("String_Node_Str" + objtostr,e);
      }
    }
  }
;
  ThreadLocalUserActivityLoggerInstaller.runWithUserActivityLogger(run,UserActivityLoggerImpl.newLoggerForValueUnbound(usess));
  if (authUserSessions.remove(usess)) {
    Identity previousSignedOn=identityEnvironment.getIdentity();
    if (previousSignedOn != null && previousSignedOn.getKey() != null) {
      if (isDebug)       log.debug("String_Node_Str" + previousSignedOn.getName().toLowerCase());
      userNameToIdentity.remove(previousSignedOn.getKey());
      userSessionCache.remove(previousSignedOn.getKey());
    }
  }
 else   if (isDebug) {
    log.info("String_Node_Str" + ident + "String_Node_Str");
  }
  if (sessionInfo != null) {
    if (sessionInfo.isREST()) {
      sessionCountRest.decrementAndGet();
    }
 else     if (sessionInfo.isWebDAV()) {
      sessionCountDav.decrementAndGet();
    }
 else {
      sessionCountWeb.decrementAndGet();
    }
  }
  if (isDebug)   log.debug("String_Node_Str");
}