Program: 97766
Project: 97766
Buggy source:
public Future write(Request request,Object data) throws IOException {
  if (webSocketTransport != null) {
    Object object=invokeEncoder(request.encoders(),data);
    webSocketWrite(request,object,data);
  }
 else {
    Object encodedPayload=invokeEncoder(request.encoders(),data);
    if (!(InputStream.class.isAssignableFrom(encodedPayload.getClass()) || Reader.class.isAssignableFrom(encodedPayload.getClass()) || String.class.isAssignableFrom(encodedPayload.getClass())|| byte[].class.isAssignableFrom(encodedPayload.getClass()))) {
      throw new IllegalStateException("String_Node_Str" + data);
    }
    if (serializedSocket.getSerializedFireStage() != null) {
      final SettableFuture<Response> future=SettableFuture.create();
      serializedSocket.getSerializedFireStage().enqueue(encodedPayload,future);
      return new Future(){
        @Override public Future fire(        Object data) throws IOException {
          return serializedSocket.fire(data);
        }
        @Override public Future done(){
          ListenableFuture.class.cast(future).done(null);
          return this;
        }
        @Override public boolean cancel(        boolean mayInterruptIfRunning){
          return future.cancel(mayInterruptIfRunning);
        }
        @Override public boolean isCancelled(){
          return future.isCancelled();
        }
        @Override public boolean isDone(){
          return future.isDone();
        }
        @Override public Socket get() throws InterruptedException, ExecutionException {
          future.get();
          return serializedSocket;
        }
        @Override public Socket get(        long timeout,        TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
          future.get(timeout,unit);
          return serializedSocket;
        }
      }
;
    }
 else {
      final ListenableFuture<Response> future=serializedSocket.directWrite(encodedPayload);
      return new Future(){
        @Override public Future fire(        Object data) throws IOException {
          return serializedSocket.fire(data);
        }
        @Override public Future done(){
          future.done(null);
          return this;
        }
        @Override public boolean cancel(        boolean mayInterruptIfRunning){
          return future.cancel(mayInterruptIfRunning);
        }
        @Override public boolean isCancelled(){
          return future.isCancelled();
        }
        @Override public boolean isDone(){
          return future.isDone();
        }
        @Override public Socket get() throws InterruptedException, ExecutionException {
          future.get();
          return serializedSocket;
        }
        @Override public Socket get(        long timeout,        TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
          future.get(timeout,unit);
          return serializedSocket;
        }
      }
;
    }
  }
  return rootFuture;
}

Fixed version (ground truth):
@Override public Future write(Request request,Object data) throws IOException {
  if (WebSocketTransport.class.isAssignableFrom(transport.getClass())) {
    Object object=invokeEncoder(request.encoders(),data);
    webSocketWrite(request,object,data);
  }
 else {
    Object encodedPayload=invokeEncoder(request.encoders(),data);
    if (!(InputStream.class.isAssignableFrom(encodedPayload.getClass()) || Reader.class.isAssignableFrom(encodedPayload.getClass()) || String.class.isAssignableFrom(encodedPayload.getClass())|| byte[].class.isAssignableFrom(encodedPayload.getClass()))) {
      throw new IllegalStateException("String_Node_Str" + data);
    }
    if (serializedSocket.getSerializedFireStage() != null) {
      final SettableFuture<Response> future=SettableFuture.create();
      serializedSocket.getSerializedFireStage().enqueue(encodedPayload,future);
      return new Future(){
        @Override public Future fire(        Object data) throws IOException {
          return serializedSocket.fire(data);
        }
        @Override public Future done(){
          ListenableFuture.class.cast(future).done(null);
          return this;
        }
        @Override public boolean cancel(        boolean mayInterruptIfRunning){
          return future.cancel(mayInterruptIfRunning);
        }
        @Override public boolean isCancelled(){
          return future.isCancelled();
        }
        @Override public boolean isDone(){
          return future.isDone();
        }
        @Override public Socket get() throws InterruptedException, ExecutionException {
          future.get();
          return serializedSocket;
        }
        @Override public Socket get(        long timeout,        TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
          future.get(timeout,unit);
          return serializedSocket;
        }
      }
;
    }
 else {
      final ListenableFuture<Response> future=serializedSocket.directWrite(encodedPayload);
      return new Future(){
        @Override public Future fire(        Object data) throws IOException {
          return serializedSocket.fire(data);
        }
        @Override public Future done(){
          future.done(null);
          return this;
        }
        @Override public boolean cancel(        boolean mayInterruptIfRunning){
          return future.cancel(mayInterruptIfRunning);
        }
        @Override public boolean isCancelled(){
          return future.isCancelled();
        }
        @Override public boolean isDone(){
          return future.isDone();
        }
        @Override public Socket get() throws InterruptedException, ExecutionException {
          future.get();
          return serializedSocket;
        }
        @Override public Socket get(        long timeout,        TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
          future.get(timeout,unit);
          return serializedSocket;
        }
      }
;
    }
  }
  return rootFuture;
}