Program: 96501
Project: 96501
Buggy source:
@Override protected Object doFilterWriteWsClose(final NextFilter nextFilter,final IoSession session,WriteRequest writeRequest,WsCloseMessage message) throws Exception {
  if (!session.isConnected()) {
    if (logger != null && logger.isTraceEnabled()) {
      logger.trace(format("String_Node_Str"));
    }
    nextFilter.filterClose(session);
    return null;
  }
  if (sentCloseFrame.compareAndSet(false,true)) {
    if (receivedCloseFrame.get() == false) {
      if (logger != null && logger.isTraceEnabled()) {
        logger.trace(format("String_Node_Str",closeTimeout));
      }
      closeNextFilter=nextFilter;
      closeSession=session;
      closeFuture=scheduler.schedule(WsCloseFilter.this,closeTimeout,TimeUnit.MILLISECONDS);
      WriteFuture writeFuture=writeRequest.getFuture();
      writeFuture.addListener(new IoFutureListener<WriteFuture>(){
        @Override public void operationComplete(        WriteFuture future){
          if (future.isWritten()) {
            session.suspendWrite();
          }
 else {
            if (logger != null && logger.isTraceEnabled()) {
              logger.trace(format("String_Node_Str",future.getException()));
            }
            nextFilter.filterClose(session);
          }
        }
      }
);
    }
 else {
      if (logger != null && logger.isTraceEnabled()) {
        logger.trace(format("String_Node_Str",message));
      }
    }
    return message;
  }
 else {
    if (logger != null && logger.isDebugEnabled()) {
      logger.debug(format("String_Node_Str",message));
    }
  }
  return null;
}

Fixed version (ground truth):
@Override protected Object doFilterWriteWsClose(final NextFilter nextFilter,final IoSession session,WriteRequest writeRequest,WsCloseMessage message) throws Exception {
  if (!session.isConnected()) {
    if (logger != null && logger.isTraceEnabled()) {
      logger.trace(format("String_Node_Str"));
    }
    nextFilter.filterClose(session);
    return null;
  }
  if (sentCloseFrame.compareAndSet(false,true)) {
    if (receivedCloseFrame.get() == false) {
      if (logger != null && logger.isTraceEnabled()) {
        logger.trace(format("String_Node_Str",message,closeTimeout));
      }
      closeNextFilter=nextFilter;
      closeSession=session;
      closeFuture=scheduler.schedule(WsCloseFilter.this,closeTimeout,TimeUnit.MILLISECONDS);
      WriteFuture writeFuture=writeRequest.getFuture();
      writeFuture.addListener(new IoFutureListener<WriteFuture>(){
        @Override public void operationComplete(        WriteFuture future){
          if (future.isWritten()) {
            session.suspendWrite();
          }
 else {
            if (logger != null && logger.isTraceEnabled()) {
              logger.trace(format("String_Node_Str",future.getException()));
            }
            nextFilter.filterClose(session);
          }
        }
      }
);
    }
 else {
      if (logger != null && logger.isTraceEnabled()) {
        logger.trace(format("String_Node_Str",message));
      }
    }
    return message;
  }
 else {
    if (logger != null && logger.isDebugEnabled()) {
      logger.debug(format("String_Node_Str",message));
    }
  }
  return null;
}