Program: 8547
Project: 8547
Buggy source:
@Override public Action inspect(AtmosphereResource r){
  final AtmosphereRequest request=r.getRequest();
  if (request.getHeader("String_Node_Str") != null && request.getAttribute(SWAGGER_SOCKET_DISPATCHED) == null) {
    AtmosphereResponse response=r.getResponse();
    response.setContentType("String_Node_Str");
    logger.debug("String_Node_Str",request.getMethod(),r.transport());
    if (request.getMethod() == "String_Node_Str" && r.transport().equals(AtmosphereResource.TRANSPORT.LONG_POLLING)) {
      BlockingQueue<AtmosphereResource> queue=(BlockingQueue<AtmosphereResource>)getContextValue(request,SUSPENDED_RESPONSE);
      if (queue == null) {
        queue=new LinkedBlockingQueue<AtmosphereResource>();
        request.getSession().setAttribute(SUSPENDED_RESPONSE,queue);
      }
      queue.offer(r);
      r.suspend();
      return Action.SUSPEND;
    }
    AtmosphereFramework framework=r.getAtmosphereConfig().framework();
    StringBuilder d=new StringBuilder();
    try {
      InputStreamReader isr=new InputStreamReader(request.getInputStream());
      BufferedReader bufReader=new BufferedReader(isr);
      char[] charBuffer=new char[8192];
      for (int readCount=bufReader.read(charBuffer); readCount > -1; readCount=bufReader.read(charBuffer)) {
        d.append(charBuffer,0,readCount);
      }
      String data=d.toString();
      if (data.length() == 0) {
        return Action.CANCELLED;
      }
      String message=data.substring(0,20).replaceAll("String_Node_Str","String_Node_Str");
      logger.debug(data);
      if (message.startsWith("String_Node_Str")) {
        HandshakeMessage handshakeMessage=mapper.readValue(data,HandshakeMessage.class);
        String identity=(String)getContextValue(request,IDENTITY);
        if (identity == null) {
          identity=UUID.randomUUID().toString();
        }
 else {
          logger.debug("String_Node_Str",identity);
          try {
            Enumeration<String> e=request.getSession().getAttributeNames();
            while (e.hasMoreElements()) {
              request.getSession().removeAttribute(e.nextElement());
            }
          }
 catch (          Exception ex) {
            logger.warn("String_Node_Str",ex);
          }
        }
        addContextValue(request,IDENTITY,identity);
        StatusMessage statusMessage=new StatusMessage.Builder().status(new StatusMessage.Status(200,"String_Node_Str")).identity(identity).build();
        response.getOutputStream().write(mapper.writeValueAsBytes(statusMessage));
        if (!delegateHandshake) {
          return Action.CANCELLED;
        }
      }
 else       if (message.startsWith("String_Node_Str")) {
        Close c=mapper.readValue(data,Close.class);
        logger.debug("String_Node_Str",c.getCloseMessage().getIdentity(),c.getCloseMessage().getReason());
        try {
          request.getSession().invalidate();
        }
 catch (        Exception ex) {
          logger.warn("String_Node_Str",ex);
        }
      }
 else {
        Message swaggerSocketMessage=mapper.readValue(data,Message.class);
        swaggerSocketMessage.transactionID(UUID.randomUUID().toString());
        String identity=(String)getContextValue(request,IDENTITY);
        if (!swaggerSocketMessage.getIdentity().equals(identity)) {
          StatusMessage statusMessage=new StatusMessage.Builder().status(new StatusMessage.Status(503,"String_Node_Str")).identity(identity).build();
          response.getOutputStream().write(mapper.writeValueAsBytes(statusMessage));
          return Action.CANCELLED;
        }
        transactionIdentity.set(swaggerSocketMessage.transactionID());
        List<Request> requests=swaggerSocketMessage.getRequests();
        addContextValue(request,swaggerSocketMessage.transactionID() + RESPONSE_COUNTER,new AtomicInteger(requests.size()));
        AtmosphereRequest ar;
        for (        Request req : requests) {
          ar=toAtmosphereRequest(request,req);
          try {
            ar.setAttribute(SWAGGER_SOCKET_DISPATCHED,"String_Node_Str");
            request.removeAttribute(INJECTED_ATMOSPHERE_RESOURCE);
            response.request(ar);
            attachWriter(r);
            request.setAttribute("String_Node_Str",req);
            framework.doCometSupport(ar,response);
          }
 catch (          ServletException e) {
            logger.warn("String_Node_Str",e);
            return Action.CANCELLED;
          }
        }
      }
      return Action.CANCELLED;
    }
 catch (    IOException e) {
      logger.warn("String_Node_Str",e);
      return Action.CONTINUE;
    }
  }
 else {
    request.setAttribute(SWAGGER_SOCKET_DISPATCHED,null);
  }
  return Action.CONTINUE;
}

Fixed version (ground truth):
@Override public Action inspect(AtmosphereResource r){
  final AtmosphereRequest request=r.getRequest();
  if (request.getHeader("String_Node_Str") != null && request.getAttribute(SWAGGER_SOCKET_DISPATCHED) == null) {
    AtmosphereResponse response=r.getResponse();
    response.setContentType("String_Node_Str");
    logger.debug("String_Node_Str",request.getMethod(),r.transport());
    if (request.getMethod() == "String_Node_Str" && r.transport().equals(AtmosphereResource.TRANSPORT.LONG_POLLING)) {
      BlockingQueue<AtmosphereResource> queue=(BlockingQueue<AtmosphereResource>)getContextValue(request,SUSPENDED_RESPONSE);
      if (queue == null) {
        queue=new LinkedBlockingQueue<AtmosphereResource>();
        request.getSession().setAttribute(SUSPENDED_RESPONSE,queue);
      }
      queue.offer(r);
      r.suspend();
      return Action.SUSPEND;
    }
    AtmosphereFramework framework=r.getAtmosphereConfig().framework();
    StringBuilder d=new StringBuilder();
    try {
      InputStreamReader isr=new InputStreamReader(request.getInputStream());
      BufferedReader bufReader=new BufferedReader(isr);
      char[] charBuffer=new char[8192];
      for (int readCount=bufReader.read(charBuffer); readCount > -1; readCount=bufReader.read(charBuffer)) {
        d.append(charBuffer,0,readCount);
      }
      String data=d.toString();
      if (data.length() == 0) {
        return Action.CANCELLED;
      }
      String message=data.substring(0,20).replaceAll("String_Node_Str","String_Node_Str");
      logger.debug(data);
      if (message.startsWith("String_Node_Str")) {
        HandshakeMessage handshakeMessage=mapper.readValue(data,HandshakeMessage.class);
        String identity=(String)getContextValue(request,IDENTITY);
        if (identity == null) {
          identity=UUID.randomUUID().toString();
        }
 else {
          logger.debug("String_Node_Str",identity);
          try {
            Enumeration<String> e=request.getSession().getAttributeNames();
            while (e.hasMoreElements()) {
              request.getSession().removeAttribute(e.nextElement());
            }
          }
 catch (          Exception ex) {
            logger.warn("String_Node_Str",ex);
          }
        }
        addContextValue(request,IDENTITY,identity);
        StatusMessage statusMessage=new StatusMessage.Builder().status(new StatusMessage.Status(200,"String_Node_Str")).identity(identity).build();
        response.getOutputStream().write(mapper.writeValueAsBytes(statusMessage));
        if (!delegateHandshake) {
          return Action.CANCELLED;
        }
      }
 else       if (message.startsWith("String_Node_Str")) {
        Close c=mapper.readValue(data,Close.class);
        logger.debug("String_Node_Str",c.getCloseMessage().getIdentity(),c.getCloseMessage().getReason());
        try {
          request.getSession().invalidate();
        }
 catch (        Exception ex) {
          logger.warn("String_Node_Str",ex);
        }
      }
 else {
        Message swaggerSocketMessage=mapper.readValue(data,Message.class);
        swaggerSocketMessage.transactionID(UUID.randomUUID().toString());
        String identity=(String)getContextValue(request,IDENTITY);
        if (!swaggerSocketMessage.getIdentity().equals(identity)) {
          StatusMessage statusMessage=new StatusMessage.Builder().status(new StatusMessage.Status(503,"String_Node_Str")).identity(identity).build();
          response.getOutputStream().write(mapper.writeValueAsBytes(statusMessage));
          return Action.CANCELLED;
        }
        transactionIdentity.set(swaggerSocketMessage.transactionID());
        List<Request> requests=swaggerSocketMessage.getRequests();
        addContextValue(request,swaggerSocketMessage.transactionID() + RESPONSE_COUNTER,new AtomicInteger(requests.size()));
        AtmosphereRequest ar;
        for (        Request req : requests) {
          ar=toAtmosphereRequest(request,req);
          try {
            ar.setAttribute(SWAGGER_SOCKET_DISPATCHED,"String_Node_Str");
            request.removeAttribute(INJECTED_ATMOSPHERE_RESOURCE);
            response.request(ar);
            attachWriter(r);
            ssRequest.set(req);
            request.setAttribute("String_Node_Str",req);
            framework.doCometSupport(ar,response);
          }
 catch (          ServletException e) {
            logger.warn("String_Node_Str",e);
            return Action.CANCELLED;
          }
        }
      }
      return Action.CANCELLED;
    }
 catch (    IOException e) {
      logger.warn("String_Node_Str",e);
      return Action.CONTINUE;
    }
  }
 else {
    request.setAttribute(SWAGGER_SOCKET_DISPATCHED,null);
  }
  return Action.CONTINUE;
}