Program: 96464
Project: 96464
Buggy source:
private void doUpgrade(final HttpConnectSession httpSession){
  String upgradeHeader=httpSession.getReadHeader(HttpHeaders.HEADER_UPGRADE);
  if (upgradeHeader == null) {
    logger.info("String_Node_Str");
    wsnConnectFuture.setException(new Exception("String_Node_Str"));
    return;
  }
 else   if (!upgradeHeader.equalsIgnoreCase("String_Node_Str")) {
    logger.info(format("String_Node_Str",upgradeHeader));
    wsnConnectFuture.setException(new Exception("String_Node_Str"));
    return;
  }
  String wsAcceptHeader=httpSession.getReadHeader("String_Node_Str");
  if (wsAcceptHeader == null) {
    logger.info("String_Node_Str");
    wsnConnectFuture.setException(new Exception("String_Node_Str"));
    return;
  }
  String key=httpSession.getWriteHeader("String_Node_Str");
  if (!WsUtils.acceptHash(key).equals(wsAcceptHeader)) {
    logger.warn(String.format("String_Node_Str" + "String_Node_Str",key,wsAcceptHeader));
    wsnConnectFuture.setException(new Exception("String_Node_Str"));
    return;
  }
  String connectionHeader=httpSession.getReadHeader(HttpHeaders.HEADER_CONNECTION);
  if (connectionHeader == null || !connectionHeader.equalsIgnoreCase("String_Node_Str")) {
    logger.info("String_Node_Str");
    wsnConnectFuture.setException(new Exception("String_Node_Str"));
    return;
  }
  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 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);
      }
      WSN_SESSION_FACTORY_KEY.set(parent,createSession);
      parent.setAttribute(WSN_CONNECT_ADDRESS_KEY,wsnConnectAddress);
    }
  }
);
}

Fixed version (ground truth):
private void doUpgrade(final HttpConnectSession httpSession){
  String upgradeHeader=httpSession.getReadHeader(HttpHeaders.HEADER_UPGRADE);
  if (upgradeHeader == null) {
    logger.info("String_Node_Str");
    wsnConnectFuture.setException(new Exception("String_Node_Str"));
    return;
  }
 else   if (!upgradeHeader.equalsIgnoreCase("String_Node_Str")) {
    logger.info(format("String_Node_Str",upgradeHeader));
    wsnConnectFuture.setException(new Exception("String_Node_Str"));
    return;
  }
  String httpConnectionHeader=httpSession.getReadHeader("String_Node_Str");
  if (httpConnectionHeader == null) {
    logger.info("String_Node_Str");
    wsnConnectFuture.setException(new Exception("String_Node_Str"));
    return;
  }
 else   if (!httpConnectionHeader.equalsIgnoreCase("String_Node_Str")) {
    logger.info(format("String_Node_Str",httpConnectionHeader));
    wsnConnectFuture.setException(new Exception("String_Node_Str"));
    return;
  }
  String wsAcceptHeader=httpSession.getReadHeader("String_Node_Str");
  if (wsAcceptHeader == null) {
    logger.info("String_Node_Str");
    wsnConnectFuture.setException(new Exception("String_Node_Str"));
    return;
  }
  String key=httpSession.getWriteHeader("String_Node_Str");
  if (!WsUtils.acceptHash(key).equals(wsAcceptHeader)) {
    logger.warn(String.format("String_Node_Str" + "String_Node_Str",key,wsAcceptHeader));
    wsnConnectFuture.setException(new Exception("String_Node_Str"));
    return;
  }
  String connectionHeader=httpSession.getReadHeader(HttpHeaders.HEADER_CONNECTION);
  if (connectionHeader == null || !connectionHeader.equalsIgnoreCase("String_Node_Str")) {
    logger.info("String_Node_Str");
    wsnConnectFuture.setException(new Exception("String_Node_Str"));
    return;
  }
  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 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);
      }
      WSN_SESSION_FACTORY_KEY.set(parent,createSession);
      parent.setAttribute(WSN_CONNECT_ADDRESS_KEY,wsnConnectAddress);
    }
  }
);
}