Program: 96602
Project: 96602
Buggy source:
private void doUpgrade(final HttpConnectSession httpSession){
  final IoSessionInitializer<? extends IoFuture> wsnSessionInitializer=WSN_SESSION_INITIALIZER_KEY.remove(httpSession);
  final ConnectFuture wsnConnectFuture=WSN_CONNECT_FUTURE_KEY.get(httpSession);
  final ResourceAddress wsnConnectAddress=WSN_CONNECT_ADDRESS_KEY.remove(httpSession);
  UpgradeFuture upgrade=httpSession.upgrade(ioBridgeHandler);
  upgrade.addListener(new IoFutureListener<UpgradeFuture>(){
    @Override public void operationComplete(    UpgradeFuture future){
      final IoSessionEx parent=(IoSessionEx)future.getSession();
      final Callable<WsnSession> createSession=new Callable<WsnSession>(){
        @Override public WsnSession call() throws Exception {
          Callable<WsnSession> wsnSessionFactory=new Callable<WsnSession>(){
            @Override public WsnSession call() throws Exception {
              final ResourceAddress localAddress=resourceAddressFactory.newResourceAddress(wsnConnectAddress,BridgeSession.LOCAL_ADDRESS.get(httpSession));
              IoBufferAllocatorEx<?> parentAllocator=parent.getBufferAllocator();
              WsBufferAllocator wsAllocator=new WsBufferAllocator(parentAllocator);
              return new WsnSession(WsnConnector.this,getProcessor(),localAddress,wsnConnectAddress,parent,wsAllocator,httpSession.getRequestURI(),null,WebSocketWireProtocol.RFC_6455);
            }
          }
;
          return newSession(wsnSessionInitializer,wsnConnectFuture,wsnSessionFactory);
        }
      }
;
      String wsAcceptHeader=httpSession.getReadHeader("String_Node_Str");
      if (wsAcceptHeader == null) {
        logger.info("String_Node_Str");
        wsnConnectFuture.setException(new Exception("String_Node_Str"));
        return;
      }
      String frameType=httpSession.getReadHeader("String_Node_Str");
      if ("String_Node_Str".equals(frameType)) {
        parent.setAttribute(ENCODING_KEY,Encoding.BINARY);
      }
 else       if ("String_Node_Str".equals(frameType)) {
        parent.setAttribute(ENCODING_KEY,Encoding.BASE64);
      }
 else {
        parent.setAttribute(ENCODING_KEY,Encoding.TEXT);
      }
      WSN_SESSION_FACTORY_KEY.set(parent,createSession);
      parent.setAttribute(WSN_CONNECT_ADDRESS_KEY,wsnConnectAddress);
    }
  }
);
}

Fixed version (ground truth):
private void doUpgrade(final HttpConnectSession httpSession){
  final IoSessionInitializer<? extends IoFuture> wsnSessionInitializer=WSN_SESSION_INITIALIZER_KEY.remove(httpSession);
  final ConnectFuture wsnConnectFuture=WSN_CONNECT_FUTURE_KEY.get(httpSession);
  final ResourceAddress wsnConnectAddress=WSN_CONNECT_ADDRESS_KEY.remove(httpSession);
  UpgradeFuture upgrade=httpSession.upgrade(ioBridgeHandler);
  upgrade.addListener(new IoFutureListener<UpgradeFuture>(){
    @Override public void operationComplete(    UpgradeFuture future){
      final IoSessionEx parent=(IoSessionEx)future.getSession();
      final Callable<WsnSession> createSession=new Callable<WsnSession>(){
        @Override public WsnSession call() throws Exception {
          Callable<WsnSession> wsnSessionFactory=new Callable<WsnSession>(){
            @Override public WsnSession call() throws Exception {
              final ResourceAddress localAddress=resourceAddressFactory.newResourceAddress(wsnConnectAddress,BridgeSession.LOCAL_ADDRESS.get(httpSession));
              IoBufferAllocatorEx<?> parentAllocator=parent.getBufferAllocator();
              WsBufferAllocator wsAllocator=new WsBufferAllocator(parentAllocator);
              return new WsnSession(WsnConnector.this,getProcessor(),localAddress,wsnConnectAddress,parent,wsAllocator,httpSession.getRequestURI(),null,WebSocketWireProtocol.RFC_6455,null);
            }
          }
;
          return newSession(wsnSessionInitializer,wsnConnectFuture,wsnSessionFactory);
        }
      }
;
      String wsAcceptHeader=httpSession.getReadHeader("String_Node_Str");
      if (wsAcceptHeader == null) {
        logger.info("String_Node_Str");
        wsnConnectFuture.setException(new Exception("String_Node_Str"));
        return;
      }
      String frameType=httpSession.getReadHeader("String_Node_Str");
      if ("String_Node_Str".equals(frameType)) {
        parent.setAttribute(ENCODING_KEY,Encoding.BINARY);
      }
 else       if ("String_Node_Str".equals(frameType)) {
        parent.setAttribute(ENCODING_KEY,Encoding.BASE64);
      }
 else {
        parent.setAttribute(ENCODING_KEY,Encoding.TEXT);
      }
      WSN_SESSION_FACTORY_KEY.set(parent,createSession);
      parent.setAttribute(WSN_CONNECT_ADDRESS_KEY,wsnConnectAddress);
    }
  }
);
}