Program: 34696
Project: 34696
Buggy source:
/** 
 * Copied from DatabaseHashMap.pollForInvalidSessionsWithListeners and DatabaseHashMap.processInvalidListeners. This method determines the set of sessions with session listeners which need to be invalidated and processes them.
 */
private void processInvalidListeners(){
  final boolean trace=com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled();
  String appName=getIStore().getId();
  long start=System.currentTimeMillis();
  for (@SuppressWarnings("String_Node_Str") Iterator<Cache.Entry<String,ArrayList>> it=sessionInfoCache.iterator(); it.hasNext(); ) {
    @SuppressWarnings("String_Node_Str") Cache.Entry<String,ArrayList> entry=it.next();
    String id=entry == null ? null : entry.getKey();
    if (id != null && !INVAL_KEY.equals(id)) {
      SessionInfo sessionInfo=new SessionInfo(entry.getValue());
      long lastAccess=sessionInfo.getLastAccess();
      short listenerCnt=sessionInfo.getListenerCount();
      int maxInactive=sessionInfo.getMaxInactiveTime();
      if ((listenerCnt == 0 || listenerCnt == 2) && maxInactive >= 0 && maxInactive < (start - lastAccess) / 1000) {
        if (trace && tc.isDebugEnabled())         Tr.debug(this,tc,"String_Node_Str" + id);
        CacheSession s=new CacheSession(this,id,_iStore.getStoreCallback());
        s.initSession(_iStore);
        s.setIsValid(true);
        s.setIsNew(false);
        s.updateLastAccessTime(lastAccess);
        s.setCreationTime(sessionInfo.getCreationTime());
        s.internalSetMaxInactive(maxInactive);
        s.internalSetUser(sessionInfo.getUser());
        s.setListenerFlag(listenerCnt);
        long now=System.currentTimeMillis();
        lastAccess=s.getCurrentAccessTime();
        try {
          s.setIsNew(false);
          s.getSwappableListeners(BackedSession.HTTP_SESSION_BINDING_LISTENER);
          sessionInfo=sessionInfo.clone();
          sessionInfo.setLastAccess(lastAccess);
          if (sessionInfoCache.remove(id,sessionInfo.getArrayList())) {
            s.internalInvalidate(true);
            Set<String> propIds=sessionInfo.getSessionPropertyIds();
            if (propIds != null && !propIds.isEmpty()) {
              HashSet<String> propKeys=new HashSet<String>();
              for (              String propId : propIds)               propKeys.add(createSessionPropertyKey(id,propId));
              if (trace && tc.isDebugEnabled())               Tr.debug(this,tc,"String_Node_Str",propKeys);
              sessionPropertyCache.removeAll(propKeys);
            }
          }
          if ((now + _smc.getInvalidationCheckInterval() * (1000 / 2)) < System.currentTimeMillis()) {
            updateNukerTimeStamp(appName);
            now=System.currentTimeMillis();
          }
        }
 catch (        Exception e) {
          FFDCFilter.processException(e,getClass().getName(),"String_Node_Str",s);
          throw e;
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Copied from DatabaseHashMap.pollForInvalidSessionsWithListeners and DatabaseHashMap.processInvalidListeners. This method determines the set of sessions with session listeners which need to be invalidated and processes them.
 */
private void processInvalidListeners(){
  final boolean trace=com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled();
  String appName=getIStore().getId();
  long start=System.currentTimeMillis();
  for (@SuppressWarnings("String_Node_Str") Iterator<Cache.Entry<String,ArrayList>> it=sessionInfoCache.iterator(); it.hasNext(); ) {
    @SuppressWarnings("String_Node_Str") Cache.Entry<String,ArrayList> entry=it.next();
    String id=entry == null ? null : entry.getKey();
    if (id != null && !INVAL_KEY.equals(id)) {
      SessionInfo sessionInfo=new SessionInfo(entry.getValue());
      long lastAccess=sessionInfo.getLastAccess();
      short listenerCnt=sessionInfo.getListenerCount();
      int maxInactive=sessionInfo.getMaxInactiveTime();
      if ((listenerCnt == 1 || listenerCnt == 3) && maxInactive >= 0 && maxInactive < (start - lastAccess) / 1000) {
        if (trace && tc.isDebugEnabled())         Tr.debug(this,tc,"String_Node_Str" + id);
        CacheSession s=new CacheSession(this,id,_iStore.getStoreCallback());
        s.initSession(_iStore);
        s.setIsValid(true);
        s.setIsNew(false);
        s.updateLastAccessTime(lastAccess);
        s.setCreationTime(sessionInfo.getCreationTime());
        s.internalSetMaxInactive(maxInactive);
        s.internalSetUser(sessionInfo.getUser());
        s.setListenerFlag(listenerCnt);
        long now=System.currentTimeMillis();
        lastAccess=s.getCurrentAccessTime();
        try {
          s.setIsNew(false);
          s.getSwappableListeners(BackedSession.HTTP_SESSION_BINDING_LISTENER);
          sessionInfo=sessionInfo.clone();
          sessionInfo.setLastAccess(lastAccess);
          if (sessionInfoCache.remove(id,sessionInfo.getArrayList())) {
            s.internalInvalidate(true);
            Set<String> propIds=sessionInfo.getSessionPropertyIds();
            if (propIds != null && !propIds.isEmpty()) {
              HashSet<String> propKeys=new HashSet<String>();
              for (              String propId : propIds)               propKeys.add(createSessionPropertyKey(id,propId));
              if (trace && tc.isDebugEnabled())               Tr.debug(this,tc,"String_Node_Str",propKeys);
              sessionPropertyCache.removeAll(propKeys);
            }
          }
          if ((now + _smc.getInvalidationCheckInterval() * (1000 / 2)) < System.currentTimeMillis()) {
            updateNukerTimeStamp(appName);
            now=System.currentTimeMillis();
          }
        }
 catch (        Exception e) {
          FFDCFilter.processException(e,getClass().getName(),"String_Node_Str",s);
          throw e;
        }
      }
    }
  }
}