Program: 8549
Project: 8549
Buggy source:
@Override public byte[] filter(AtmosphereResponse r,byte[] message,int offset,int length){
  if (r.request() == null || r.request().getAttribute("String_Node_Str") != null) {
    return message;
  }
  if (invalidState((Request)r.request().getAttribute(SWAGGERSOCKET_REQUEST))) {
    logger.error("String_Node_Str",message);
    return null;
  }
  try {
    AtmosphereResource ar=(AtmosphereResource)r.request().getAttribute(FrameworkConfig.ATMOSPHERE_RESOURCE);
    if (ar.transport().equals(AtmosphereResource.TRANSPORT.LONG_POLLING)) {
      String m="String_Node_Str";
      try {
        m=new String(message,offset,length,r.getCharacterEncoding());
      }
 catch (      UnsupportedEncodingException e) {
        logger.trace("String_Node_Str",e);
      }
      if (!m.endsWith(END_MESSAGE)) {
        StringBuffer cummulatedMessage=(StringBuffer)ar.getRequest().getAttribute("String_Node_Str");
        if (cummulatedMessage == null) {
          ar.getRequest().setAttribute("String_Node_Str",new StringBuffer(m));
        }
 else {
          cummulatedMessage.append(m);
        }
        return null;
      }
 else {
        m=m.substring(0,m.indexOf(END_MESSAGE));
        StringBuffer cummulatedMessage=(StringBuffer)ar.getRequest().getAttribute("String_Node_Str");
        ResponseMessage rm;
        if (cummulatedMessage == null) {
          rm=wrapMessage(r,m);
        }
 else {
          cummulatedMessage.append(m);
          rm=wrapMessage(r,cummulatedMessage.toString());
        }
        ar.getRequest().removeAttribute("String_Node_Str");
        return mapper.writeValueAsBytes(rm);
      }
    }
    ResponseMessage m=wrapMessage(r,new String(message,offset,length,r.request().getCharacterEncoding()));
    if (m != null) {
      return mapper.writeValueAsBytes(m);
    }
 else {
      return null;
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public byte[] filter(AtmosphereResponse r,byte[] message,int offset,int length){
  if (r.request() == null || r.request().getAttribute("String_Node_Str") != null) {
    return message;
  }
  if (invalidState((Request)r.request().getAttribute(SWAGGERSOCKET_REQUEST))) {
    logger.error("String_Node_Str",message);
    return null;
  }
  try {
    AtmosphereResource ar=(AtmosphereResource)r.request().getAttribute(FrameworkConfig.ATMOSPHERE_RESOURCE);
    if (ar.transport().equals(AtmosphereResource.TRANSPORT.LONG_POLLING)) {
      String m="String_Node_Str";
      try {
        m=new String(message,offset,length,r.getCharacterEncoding());
      }
 catch (      UnsupportedEncodingException e) {
        logger.trace("String_Node_Str",e);
      }
      if (ar.isSuspended()) {
        if (!m.endsWith(END_MESSAGE)) {
          StringBuffer cumulatedMessage=(StringBuffer)ar.getRequest().getAttribute("String_Node_Str");
          if (cumulatedMessage == null) {
            ar.getRequest().setAttribute("String_Node_Str",new StringBuffer(m));
          }
 else {
            cumulatedMessage.append(m);
          }
          return null;
        }
 else {
          m=m.substring(0,m.indexOf(END_MESSAGE));
          StringBuffer cumulatedMessage=(StringBuffer)ar.getRequest().getAttribute("String_Node_Str");
          ResponseMessage rm;
          if (cumulatedMessage == null) {
            rm=wrapMessage(r,m);
          }
 else {
            cumulatedMessage.append(m);
            rm=wrapMessage(r,cumulatedMessage.toString());
          }
          ar.getRequest().removeAttribute("String_Node_Str");
          return mapper.writeValueAsBytes(rm);
        }
      }
 else {
        ResponseMessage rm=wrapMessage(r,m);
        if (rm != null) {
          return mapper.writeValueAsBytes(rm);
        }
 else {
          return null;
        }
      }
    }
    ResponseMessage m=wrapMessage(r,new String(message,offset,length,r.request().getCharacterEncoding()));
    if (m != null) {
      return mapper.writeValueAsBytes(m);
    }
 else {
      return null;
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}