nus-yam/ex-repair huggingface dataset:
Program: 153484
Project: 153484
Buggy source:
@Override public void exceptionCaught(ChannelHandlerContext ctx,final ExceptionEvent e) throws Exception {
  this.support.decrementProgress(this.name);
  LOG.error(Markers.BOUNDARY,e.getCause().getMessage(),e.getCause());
  this.users.onError(new AbstractRiakResponse(){
    @Override public String getMessage(){
      return e.getCause().getMessage();
    }
  }
);
  this.future.setFailure(e.getCause());
  this.support.invokeNext();
}

Fixed version (ground truth):
@Override public void exceptionCaught(ChannelHandlerContext ctx,final ExceptionEvent e) throws Exception {
  LOG.error(Markers.BOUNDARY,e.getCause().getMessage(),e.getCause());
  this.users.onError(new AbstractRiakResponse(){
    @Override public String getMessage(){
      return e.getCause().getMessage();
    }
  }
);
  this.future.setFailure(e.getCause());
  this.support.invokeNext();
}
Program: 153485
Project: 153485
Buggy source:
public void decrementProgress(String name){
  this.inProgress.remove(name);
}

Fixed version (ground truth):
public void decrementProgress(String name){
  this.channel.getPipeline().remove(name);
  this.inProgress.remove(name);
}
Program: 153486
Project: 153486
Buggy source:
public CountDownRiakFuture newRiakFuture(String name){
  ChannelPipeline pipeline=this.channel.getPipeline();
  return new CountDownRiakFuture(name,pipeline);
}

Fixed version (ground truth):
public CountDownRiakFuture newRiakFuture(String name){
  return new CountDownRiakFuture(name,this);
}
Program: 153487
Project: 153487
Buggy source:
protected void completeOnError(String name,ChannelPipeline pipeline){
  pipeline.remove(name);
  operationComplete();
}

Fixed version (ground truth):
protected void completeOnError(String name,ChannelPipeline pipeline){
  decrementProgress(name);
  operationComplete();
}
Program: 153488
Project: 153488
Buggy source:
public CountDownRiakFuture(String name,ChannelPipeline pipeline){
  this.latch=new CountDownLatch(1);
  this.name=name;
  this.pipeline=pipeline;
}

Fixed version (ground truth):
public CountDownRiakFuture(String name,CompletionSupport support){
  this.latch=new CountDownLatch(1);
  this.name=name;
  this.support=support;
}
Program: 153489
Project: 153489
Buggy source:
public void finished(){
  LOG.debug(Markers.LIFECYCLE,Messages.Finished,this.name);
  this.pipeline.remove(this.name);
  this.latch.countDown();
}

Fixed version (ground truth):
public void finished(){
  LOG.debug(Markers.LIFECYCLE,Messages.Finished,this.name);
  this.support.decrementProgress(this.name);
  this.latch.countDown();
}
Program: 153490
Project: 153490
Buggy source:
@Override public boolean isSuccess(){
  this.latch.countDown();
  return this.success;
}

Fixed version (ground truth):
@Override public boolean isSuccess(){
  return this.success;
}
Program: 153491
Project: 153491
Buggy source:
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  try {
    Object receive=e.getMessage();
    if (LOG.isDebugEnabled()) {
      LOG.debug(Markers.DETAIL,Messages.Receive,this.name,receive);
    }
    if (this.handler.handle(receive,this.future)) {
      this.support.decrementProgress(this.name);
      this.support.invokeNext();
    }
  }
 catch (  Exception ex) {
    throw ex;
  }
catch (  Error ex) {
    setFailure(ex);
    throw ex;
  }
 finally {
    this.support.responseComplete();
  }
}

Fixed version (ground truth):
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  try {
    Object receive=e.getMessage();
    if (LOG.isDebugEnabled()) {
      LOG.debug(Markers.DETAIL,Messages.Receive,this.name,receive);
    }
    if (this.handler.handle(receive,this.future)) {
      this.support.invokeNext();
    }
  }
 catch (  Exception ex) {
    throw ex;
  }
catch (  Error ex) {
    setFailure(ex);
    throw ex;
  }
 finally {
    this.support.responseComplete();
  }
}
Program: 153493
Project: 153493
Buggy source:
@Before public void setUp() throws Exception {
  this.bootstrap=new ClientBootstrap(new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),Executors.newCachedThreadPool()));
  this.bootstrap.setPipelineFactory(new ProtoBufPipelineFactory());
  ChannelFuture future=this.bootstrap.connect(config.getRiakAddress());
  this.channel=future.awaitUninterruptibly().getChannel();
  this.target=new ProtoBufRiakOperations(this.channel);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  this.bootstrap=new ClientBootstrap(new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),Executors.newCachedThreadPool()));
  this.bootstrap.setPipelineFactory(new ProtoBufPipelineFactory());
  ChannelFuture future=this.bootstrap.connect(config.getRiakAddress());
  this.channel=future.awaitUninterruptibly().getChannel();
  this.target=new ProtoBufRiakOperations(this.channel);
  deleteFromBucket();
}
Program: 153494
Project: 153494
Buggy source:
@Override public void exceptionCaught(ChannelHandlerContext ctx,final ExceptionEvent e) throws Exception {
  this.support.remove(this.name);
  this.future.setFailure(e.getCause());
  LOG.error(Markers.BOUNDARY,e.getCause().getMessage(),e.getCause());
  this.users.onError(new AbstractRiakResponse(){
    @Override public String getMessage(){
      return e.getCause().getMessage();
    }
    @Override public void operationComplete(){
      AbstractCompletionChannelHandler.this.support.complete();
    }
  }
);
  this.support.invokeNext();
}

Fixed version (ground truth):
@Override public void exceptionCaught(ChannelHandlerContext ctx,final ExceptionEvent e) throws Exception {
  this.support.decrementProgress(this.name);
  LOG.error(Markers.BOUNDARY,e.getCause().getMessage(),e.getCause());
  this.users.onError(new AbstractRiakResponse(){
    @Override public String getMessage(){
      return e.getCause().getMessage();
    }
    @Override public void operationComplete(){
      AbstractCompletionChannelHandler.this.support.complete();
    }
  }
);
  this.future.setFailure(e.getCause());
  this.support.invokeNext();
}
Program: 153495
Project: 153495
Buggy source:
public ChunkedMessageAggregator(String procedure,ChunkedMessageHandler handler){
  this.procedure=procedure;
  this.handler=handler;
}

Fixed version (ground truth):
public ChunkedMessageAggregator(String procedure,MessageHandler handler){
  this.procedure=procedure;
  this.handler=handler;
}
Program: 153496
Project: 153496
Buggy source:
@Override public boolean handle(Object receive) throws Exception {
  if (receive instanceof HttpResponse) {
    HttpResponse response=(HttpResponse)receive;
    if (NettyUtil.isSuccessful(response.getStatus())) {
      if (response.isChunked()) {
        this.chunkBuffer=ChannelBuffers.dynamicBuffer(2048);
        this.chunkedResponse=response;
      }
 else {
        this.handler.handle(response,response.getContent());
        return true;
      }
    }
  }
 else   if (receive instanceof HttpChunk) {
    HttpChunk chunk=(HttpChunk)receive;
    boolean done=chunk.isLast();
    if (done) {
      this.handler.handle(this.chunkedResponse,this.chunkBuffer);
    }
 else {
      this.chunkBuffer.writeBytes(chunk.getContent());
    }
    return done;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean handle(Object receive,CountDownRiakFuture future) throws Exception {
  if (receive instanceof HttpResponse) {
    HttpResponse response=(HttpResponse)receive;
    if (NettyUtil.isSuccessful(response.getStatus())) {
      if (response.isChunked()) {
        this.chunkedBuffer=response.getContent();
        this.chunkedResponse=response;
      }
 else {
        this.handler.handle(response,future);
        return true;
      }
    }
  }
 else   if (receive instanceof HttpChunk) {
    HttpChunk chunk=(HttpChunk)receive;
    boolean done=chunk.isLast();
    if (done) {
      this.chunkedResponse.setChunked(false);
      this.chunkedResponse.setContent(this.chunkedBuffer);
      this.handler.handle(this.chunkedResponse,future);
    }
 else {
      this.chunkedBuffer=ChannelBuffers.wrappedBuffer(this.chunkedBuffer,chunk.getContent());
    }
    return done;
  }
  return false;
}
Program: 153497
Project: 153497
Buggy source:
public void setFailure(Throwable cause){
  this.cause=cause;
  finished();
}

Fixed version (ground truth):
public void setFailure(){
  this.failure=true;
  finished();
}
Program: 153498
Project: 153498
Buggy source:
@Override public boolean isDone(){
  return this.success || this.canceled || this.cause != null;
}

Fixed version (ground truth):
@Override public boolean isDone(){
  return this.latch.getCount() < 1;
}
Program: 153499
Project: 153499
Buggy source:
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  try {
    Object receive=e.getMessage();
    if (LOG.isDebugEnabled()) {
      LOG.debug(Markers.DETAIL,Messages.Receive,this.name,receive);
    }
    if (this.handler.handle(receive)) {
      this.future.setSuccess();
      this.support.remove(this.name);
      this.support.invokeNext();
    }
    e.getFuture().addListener(this.support);
  }
 catch (  Exception ex) {
    throw ex;
  }
catch (  Error ex) {
    setFailure(ex);
    throw ex;
  }
}

Fixed version (ground truth):
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  try {
    Object receive=e.getMessage();
    if (LOG.isDebugEnabled()) {
      LOG.debug(Markers.DETAIL,Messages.Receive,this.name,receive);
    }
    if (this.handler.handle(receive,this.future)) {
      this.support.decrementProgress(this.name);
      this.support.invokeNext();
    }
    e.getFuture().addListener(this.support);
  }
 catch (  Exception ex) {
    throw ex;
  }
catch (  Error ex) {
    setFailure(ex);
    throw ex;
  }
}
Program: 153500
Project: 153500
Buggy source:
/** 
 * @param receive
 * @return true : handle finished / false : do more handle.
 */
boolean handle(Object receive) throws Exception ;

Fixed version (ground truth):
/** 
 * @param receive
 * @return true : handle finished / false : do more handle.
 */
boolean handle(Object receive,CountDownRiakFuture future) throws Exception ;
Program: 153501
Project: 153501
Buggy source:
@Override public void exceptionCaught(ChannelHandlerContext ctx,final ExceptionEvent e) throws Exception {
  this.support.decrementProgress(this.name);
  LOG.error(Markers.BOUNDARY,e.getCause().getMessage(),e.getCause());
  this.users.onError(new AbstractRiakResponse(){
    @Override public String getMessage(){
      return e.getCause().getMessage();
    }
    @Override public void operationComplete(){
      AbstractCompletionChannelHandler.this.support.complete();
    }
  }
);
  this.future.setFailure(e.getCause());
  this.support.invokeNext();
}

Fixed version (ground truth):
@Override public void exceptionCaught(ChannelHandlerContext ctx,final ExceptionEvent e) throws Exception {
  this.support.decrementProgress(this.name);
  LOG.error(Markers.BOUNDARY,e.getCause().getMessage(),e.getCause());
  this.users.onError(new AbstractRiakResponse(){
    @Override public String getMessage(){
      return e.getCause().getMessage();
    }
  }
);
  this.future.setFailure(e.getCause());
  this.support.invokeNext();
}
Program: 153502
Project: 153502
Buggy source:
@Override public void execute(RiakAction<OP> action){
  notNull(action,"String_Node_Str");
  ClientBootstrap bootstrap=new ClientBootstrap(this.channelFactory);
  Integer i=this.config.getTimeout();
  if (i != null) {
    bootstrap.setOption("String_Node_Str",i);
  }
  bootstrap.setPipelineFactory(this.pipelineFactory);
  ChannelFuture future=bootstrap.connect(this.config.getRiakAddress());
  future=future.awaitUninterruptibly();
  Channel channel=future.getChannel();
  OP op=newOperations(channel);
  action.execute(op);
}

Fixed version (ground truth):
@Override public void execute(RiakAction<OP> action){
  notNull(action,"String_Node_Str");
  ClientBootstrap bootstrap=new ClientBootstrap(this.channelFactory);
  Integer i=this.config.getTimeout();
  if (i != null) {
    bootstrap.setOption("String_Node_Str",i);
  }
  bootstrap.setPipelineFactory(this.pipelineFactory);
  ChannelFuture future=bootstrap.connect(this.config.getRiakAddress());
  future=future.awaitUninterruptibly();
  Channel channel=future.getChannel();
  OP op=newOperations(channel);
  try {
    action.execute(op);
  }
  finally {
    op.complete();
  }
}
Program: 153503
Project: 153503
Buggy source:
public <T>RiakFuture handle(String name,Object send,RiakResponseHandler<T> users,ChannelHandler handler,RiakFuture future){
  ChannelPipeline pipeline=this.channel.getPipeline();
  Command cmd=new Command(this.channel,send,name,handler);
  try {
    if (this.inProgress.add(cmd.name)) {
      cmd.execute();
    }
 else {
      if (LOG.isDebugEnabled()) {
        LOG.debug(Markers.DETAIL,Messages.Queue,name);
      }
      this.waitQueue.add(cmd);
    }
    return future;
  }
 catch (  Exception e) {
    complete(name,pipeline);
    throw new RiakException(e);
  }
catch (  Error e) {
    complete(name,pipeline);
    throw e;
  }
}

Fixed version (ground truth):
public <T>RiakFuture handle(String name,Object send,RiakResponseHandler<T> users,ChannelHandler handler,RiakFuture future){
  ChannelPipeline pipeline=this.channel.getPipeline();
  Command cmd=new Command(this.channel,send,name,handler);
  try {
    if (this.inProgress.add(cmd.name)) {
      cmd.execute();
    }
 else {
      if (LOG.isDebugEnabled()) {
        LOG.debug(Markers.DETAIL,Messages.Queue,name);
      }
      this.waitQueue.add(cmd);
    }
    return future;
  }
 catch (  Exception e) {
    completeOnError(name,pipeline);
    throw new RiakException(e);
  }
catch (  Error e) {
    completeOnError(name,pipeline);
    throw e;
  }
}
Program: 153504
Project: 153504
Buggy source:
protected void complete(String name,ChannelPipeline pipeline){
  pipeline.remove(name);
  complete();
  close(this.channel);
}

Fixed version (ground truth):
protected void complete(){
  if (LOG.isDebugEnabled()) {
    LOG.debug(Markers.DETAIL,"String_Node_Str",new Object[]{this.waitQueue.size(),this.inProgress.size(),this.operationComplete.get()});
  }
  if (this.operationComplete.get() && this.waitQueue.size() < 1 && this.inProgress.size() < 1) {
    close(this.channel);
  }
}
Program: 153505
Project: 153505
Buggy source:
protected void close(Channel channel){
  if (channel.isOpen()) {
    LOG.debug(Markers.BOUNDARY,Messages.CloseChannel);
    channel.close();
  }
}

Fixed version (ground truth):
protected void close(Channel channel){
  if (this.lock.tryLock()) {
    try {
      if (channel.isOpen()) {
        LOG.debug(Markers.BOUNDARY,Messages.CloseChannel);
        channel.close();
      }
    }
  finally {
      this.lock.unlock();
    }
  }
 else {
    LOG.debug(Markers.DETAIL,"String_Node_Str");
  }
}
Program: 153506
Project: 153506
Buggy source:
@Override public void operationComplete(){
  complete();
}

Fixed version (ground truth):
public void operationComplete(){
  this.operationComplete.compareAndSet(false,true);
  complete();
}
Program: 153507
Project: 153507
Buggy source:
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  try {
    Object receive=e.getMessage();
    if (LOG.isDebugEnabled()) {
      LOG.debug(Markers.DETAIL,Messages.Receive,this.name,receive);
    }
    if (this.handler.handle(receive,this.future)) {
      this.support.decrementProgress(this.name);
      this.support.invokeNext();
    }
    e.getFuture().addListener(this.support);
  }
 catch (  Exception ex) {
    throw ex;
  }
catch (  Error ex) {
    setFailure(ex);
    throw ex;
  }
}

Fixed version (ground truth):
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  try {
    Object receive=e.getMessage();
    if (LOG.isDebugEnabled()) {
      LOG.debug(Markers.DETAIL,Messages.Receive,this.name,receive);
    }
    if (this.handler.handle(receive,this.future)) {
      this.support.decrementProgress(this.name);
      this.support.invokeNext();
    }
  }
 catch (  Exception ex) {
    throw ex;
  }
catch (  Error ex) {
    setFailure(ex);
    throw ex;
  }
 finally {
    this.support.responseComplete();
  }
}
Program: 153509
Project: 153509
Buggy source:
public AbstractRiakClient(CONF config,ChannelPipelineFactory pipelineFactory){
  this.channelFactory=new NioClientSocketChannelFactory(config.getBossExecutor(),config.getWorkerExecutor());
  this.pipelineFactory=pipelineFactory;
  this.config=config;
}

Fixed version (ground truth):
public AbstractRiakClient(CONF config,ChannelPipelineFactory pipelineFactory){
  this.externalResources[0]=config.getActionExecutor();
  this.externalResources[1]=config.getBossExecutor();
  this.externalResources[2]=config.getWorkerExecutor();
  this.actionExecutor=this.externalResources[0];
  this.channelFactory=new NioClientSocketChannelFactory(this.externalResources[1],this.externalResources[2]);
  this.pipelineFactory=pipelineFactory;
  this.config=config;
}
Program: 153510
Project: 153510
Buggy source:
@Override public void dispose(){
  this.channelFactory.releaseExternalResources();
}

Fixed version (ground truth):
@Override public void dispose(){
  ExecutorUtil.terminate(this.externalResources);
}
Program: 153511
Project: 153511
Buggy source:
@Override public void execute(RiakAction<OP> action){
  notNull(action,"String_Node_Str");
  ClientBootstrap bootstrap=new ClientBootstrap(this.channelFactory);
  Integer i=this.config.getTimeout();
  if (i != null) {
    bootstrap.setOption("String_Node_Str",i);
  }
  bootstrap.setPipelineFactory(this.pipelineFactory);
  ChannelFuture future=bootstrap.connect(this.config.getRiakAddress());
  future=future.awaitUninterruptibly();
  Channel channel=future.getChannel();
  OP op=newOperations(channel);
  try {
    action.execute(op);
  }
  finally {
    op.complete();
  }
}

Fixed version (ground truth):
@Override public void execute(final RiakAction<OP> action){
  notNull(action,"String_Node_Str");
  ClientBootstrap bootstrap=new ClientBootstrap(this.channelFactory);
  Integer i=this.config.getTimeout();
  if (i != null) {
    bootstrap.setOption("String_Node_Str",i);
  }
  bootstrap.setPipelineFactory(this.pipelineFactory);
  ChannelFuture future=bootstrap.connect(this.config.getRiakAddress());
  future.addListener(new ChannelFutureListener(){
    @Override public void operationComplete(    ChannelFuture future) throws Exception {
      if (future.isSuccess()) {
        final Channel channel=future.getChannel();
        AbstractRiakClient.this.actionExecutor.execute(new Runnable(){
          @Override public void run(){
            OP op=newOperations(channel);
            try {
              action.execute(op);
            }
  finally {
              op.complete();
            }
          }
        }
);
      }
    }
  }
);
}
Program: 153512
Project: 153512
Buggy source:
@Test public void testExecute() throws Exception {
  this.target.execute(new RiakAction<OP>(){
    @Override public void execute(    OP operations){
      final String[] actual=new String[1];
      RiakFuture waiter=operations.ping(new TestingHandler<String>(){
        @Override public void handle(        RiakContentsResponse<String> response) throws Exception {
          actual[0]=response.getContents();
        }
      }
);
      try {
        assertTrue("String_Node_Str",waiter.await(3,TimeUnit.SECONDS));
        assertEquals("String_Node_Str",actual[0]);
      }
 catch (      InterruptedException e) {
        fail(e.getMessage());
      }
    }
  }
);
}

Fixed version (ground truth):
@Test public void testExecute() throws Exception {
  this.target.execute(new RiakAction<OP>(){
    @Override public void execute(    OP operations){
      final String[] actual=new String[1];
      RiakFuture waiter=operations.ping(new TestingHandler<String>(){
        @Override public void handle(        RiakContentsResponse<String> response) throws Exception {
          actual[0]=response.getContents();
        }
      }
);
      try {
        assertTrue("String_Node_Str",waiter.await(3,TimeUnit.SECONDS));
        assertEquals("String_Node_Str",actual[0]);
        fail();
      }
 catch (      InterruptedException e) {
        fail(e.getMessage());
      }
    }
  }
);
}
Program: 153513
Project: 153513
Buggy source:
@Test public void testExecute3() throws Exception {
  final String[] actual=new String[1];
  final CountDownLatch latch=new CountDownLatch(1);
  this.target.execute(new RiakAction<OP>(){
    @Override public void execute(    OP operations){
      RiakFuture waiter=operations.ping(new TestingHandler<String>(){
        @Override public void handle(        RiakContentsResponse<String> response) throws Exception {
          actual[0]=response.getContents();
        }
      }
);
      latch.countDown();
      try {
        assertTrue("String_Node_Str",waiter.await(3,TimeUnit.SECONDS));
      }
 catch (      InterruptedException e) {
        fail(e.getMessage());
      }
    }
  }
);
  assertTrue("String_Node_Str",latch.await(3,TimeUnit.SECONDS));
  assertEquals("String_Node_Str",actual[0]);
}

Fixed version (ground truth):
@Test public void testExecute3() throws Exception {
  final String[] actual=new String[1];
  final CountDownLatch latch=new CountDownLatch(1);
  System.out.println("String_Node_Str" + Thread.currentThread().getName());
  this.target.execute(new RiakAction<OP>(){
    @Override public void execute(    OP operations){
      System.out.println("String_Node_Str" + Thread.currentThread().getName());
      RiakFuture waiter=operations.ping(new TestingHandler<String>(){
        @Override public void handle(        RiakContentsResponse<String> response) throws Exception {
          System.out.println("String_Node_Str" + Thread.currentThread().getName());
          actual[0]=response.getContents();
        }
      }
);
      try {
        assertTrue("String_Node_Str",waiter.await(3,TimeUnit.SECONDS));
        latch.countDown();
      }
 catch (      InterruptedException e) {
        fail(e.getMessage());
      }
    }
  }
);
  assertTrue("String_Node_Str",latch.await(3,TimeUnit.SECONDS));
  assertEquals("String_Node_Str",actual[0]);
}
Program: 153514
Project: 153514
Buggy source:
@Override public void handle(RiakContentsResponse<String> response) throws Exception {
  actual[0]=response.getContents();
}

Fixed version (ground truth):
@Override public void handle(RiakContentsResponse<String> response) throws Exception {
  System.out.println("String_Node_Str" + Thread.currentThread().getName());
  actual[0]=response.getContents();
}
Program: 153515
Project: 153515
Buggy source:
@Override public void execute(OP operations){
  RiakFuture waiter=operations.ping(new TestingHandler<String>(){
    @Override public void handle(    RiakContentsResponse<String> response) throws Exception {
      actual[0]=response.getContents();
    }
  }
);
  latch.countDown();
  try {
    assertTrue("String_Node_Str",waiter.await(3,TimeUnit.SECONDS));
  }
 catch (  InterruptedException e) {
    fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void execute(OP operations){
  System.out.println("String_Node_Str" + Thread.currentThread().getName());
  RiakFuture waiter=operations.ping(new TestingHandler<String>(){
    @Override public void handle(    RiakContentsResponse<String> response) throws Exception {
      System.out.println("String_Node_Str" + Thread.currentThread().getName());
      actual[0]=response.getContents();
    }
  }
);
  try {
    assertTrue("String_Node_Str",waiter.await(3,TimeUnit.SECONDS));
    latch.countDown();
  }
 catch (  InterruptedException e) {
    fail(e.getMessage());
  }
}
Program: 153516
Project: 153516
Buggy source:
public <T>RiakFuture handle(String name,Object send,RiakResponseHandler<T> users,ChannelHandler handler,RiakFuture future){
  ChannelPipeline pipeline=this.channel.getPipeline();
  Command cmd=new Command(this.channel,send,name,handler);
  try {
    if (this.inProgress.add(cmd.name)) {
      cmd.execute();
    }
 else {
      if (LOG.isDebugEnabled()) {
        LOG.debug(Markers.LIFECYCLE,Messages.Queue,name);
      }
      this.waitQueue.add(cmd);
    }
    return future;
  }
 catch (  Exception e) {
    complete(name,pipeline);
    throw new RiakException(e);
  }
catch (  Error e) {
    complete(name,pipeline);
    throw e;
  }
}

Fixed version (ground truth):
public <T>RiakFuture handle(String name,Object send,RiakResponseHandler<T> users,ChannelHandler handler,RiakFuture future){
  ChannelPipeline pipeline=this.channel.getPipeline();
  Command cmd=new Command(this.channel,send,name,handler);
  try {
    if (this.inProgress.add(cmd.name)) {
      cmd.execute();
    }
 else {
      if (LOG.isDebugEnabled()) {
        LOG.debug(Markers.DETAIL,Messages.Queue,name);
      }
      this.waitQueue.add(cmd);
    }
    return future;
  }
 catch (  Exception e) {
    complete(name,pipeline);
    throw new RiakException(e);
  }
catch (  Error e) {
    complete(name,pipeline);
    throw e;
  }
}
Program: 153517
Project: 153517
Buggy source:
protected void invokeNext(){
  for (Iterator<Command> i=this.waitQueue.iterator(); i.hasNext(); ) {
    Command cmd=i.next();
    if (this.inProgress.add(cmd.name)) {
      i.remove();
      cmd.execute();
    }
  }
}

Fixed version (ground truth):
protected void invokeNext(){
  for (Iterator<Command> i=this.waitQueue.iterator(); i.hasNext(); ) {
    Command cmd=i.next();
    if (this.inProgress.add(cmd.name)) {
      i.remove();
      cmd.execute();
      break;
    }
  }
}
Program: 153518
Project: 153518
Buggy source:
protected void complete(String name,ChannelPipeline pipeline){
  pipeline.remove(name);
  complete();
  this.channel.close();
}

Fixed version (ground truth):
protected void complete(String name,ChannelPipeline pipeline){
  pipeline.remove(name);
  complete();
  close(this.channel);
}
Program: 153519
Project: 153519
Buggy source:
public PartMessage parse(ChannelBuffer buffer){
  DefaultPartMessage multipart=new DefaultPartMessage();
  for (; ; ) {
switch (state) {
case SKIP_CONTROL_CHARS:
{
        skipControlCharacters(buffer);
        state=State.READ_BOUNDARY;
        break;
      }
case READ_BOUNDARY:
{
      state=readBoundary(buffer);
      break;
    }
case READ_HEADERS:
{
    readHeaders(buffer,multipart);
    break;
  }
case READ_CHUNKD_CONTENT:
{
  return multipart;
}
case READ_CONTENT:
{
int length=seekNextBoundary(buffer);
multipart.setContent(buffer.readBytes(length));
return multipart;
}
case EPILOGUE:
{
multipart.setLast(true);
state=State.SKIP_CONTROL_CHARS;
return multipart;
}
default :
{
throw new IllegalStateException("String_Node_Str" + state);
}
}
}
}

Fixed version (ground truth):
public PartMessage parse(ChannelBuffer buffer){
  DefaultPartMessage multipart=new DefaultPartMessage();
  for (; ; ) {
switch (state) {
case SKIP_CONTROL_CHARS:
{
        skipControlCharacters(buffer);
        state=State.READ_BOUNDARY;
        break;
      }
case READ_BOUNDARY:
{
      state=readBoundary(buffer);
      break;
    }
case READ_HEADERS:
{
    readHeaders(buffer,multipart);
    break;
  }
case READ_CHUNKD_CONTENT:
{
  return multipart;
}
case READ_CONTENT:
{
int length=seekNextBoundary(buffer);
ChannelBuffer newone=buffer.readBytes(length);
if (this.readContinue != null) {
  ChannelBuffer cb=readContinue.getContent();
  newone=ChannelBuffers.copiedBuffer(cb.array(),newone.array());
}
multipart.setContent(newone);
if (State.READ_CONTENT.equals(this.state)) {
  this.readContinue=multipart;
}
 else {
  this.readContinue=null;
}
return multipart;
}
case EPILOGUE:
{
multipart.setLast(true);
state=State.SKIP_CONTROL_CHARS;
return multipart;
}
default :
{
throw new IllegalStateException("String_Node_Str" + state);
}
}
}
}
Program: 153520
Project: 153520
Buggy source:
protected void splitMultipart(ChannelHandlerContext ctx,MessageEvent e,ChannelBuffer buffer){
  while (buffer.readable()) {
    PartMessage msg=parse(buffer);
    Channels.fireMessageReceived(ctx,msg,e.getRemoteAddress());
    if (State.READ_CHUNKD_CONTENT.equals(state)) {
      break;
    }
  }
}

Fixed version (ground truth):
protected void splitMultipart(ChannelHandlerContext ctx,MessageEvent e,ChannelBuffer buffer){
  while (buffer.readable()) {
    PartMessage msg=parse(buffer);
    if (State.READ_CONTENT.equals(this.state)) {
      break;
    }
    Channels.fireMessageReceived(ctx,msg,e.getRemoteAddress());
    if (State.READ_CHUNKD_CONTENT.equals(this.state)) {
      break;
    }
  }
}
Program: 153521
Project: 153521
Buggy source:
private int seekNextBoundary(ChannelBuffer buffer){
  int readerIndex=buffer.readerIndex();
  int length=0;
  String line="String_Node_Str";
  while (buffer.readable()) {
    line=readLine(buffer);
    if (line.isEmpty() && buffer.readable() == false) {
      state=State.EPILOGUE;
      break;
    }
 else     if (this.dashBoundary.equals(line)) {
      length-=this.dashBoundary.length();
      length-=4;
      state=State.SKIP_CONTROL_CHARS;
      break;
    }
 else     if (this.closeBoundary.equals(line)) {
      length-=this.closeBoundary.length();
      length-=4;
      state=State.SKIP_CONTROL_CHARS;
      break;
    }
  }
  length+=(buffer.readerIndex() - readerIndex);
  if (LOG.isDebugEnabled()) {
    LOG.debug(Markers.DETAIL,"String_Node_Str" + length + "String_Node_Str"+ state);
  }
  buffer.readerIndex(readerIndex);
  return length;
}

Fixed version (ground truth):
private int seekNextBoundary(ChannelBuffer buffer){
  int readerIndex=buffer.readerIndex();
  int length=0;
  String line="String_Node_Str";
  while (buffer.readable()) {
    line=readLine(buffer);
    if (line.isEmpty() && buffer.readable() == false) {
      state=State.READ_CONTENT;
      break;
    }
 else     if (this.dashBoundary.equals(line)) {
      length-=this.dashBoundary.length();
      length-=4;
      state=State.SKIP_CONTROL_CHARS;
      break;
    }
 else     if (this.closeBoundary.equals(line)) {
      length-=this.closeBoundary.length();
      length-=4;
      state=State.SKIP_CONTROL_CHARS;
      break;
    }
  }
  length+=(buffer.readerIndex() - readerIndex);
  if (LOG.isDebugEnabled()) {
    LOG.debug(Markers.DETAIL,"String_Node_Str" + length + "String_Node_Str"+ state);
  }
  buffer.readerIndex(readerIndex);
  return length;
}
Program: 153522
Project: 153522
Buggy source:
@Test public void testSibling() throws Exception {
  final Location location=new Location("String_Node_Str","String_Node_Str");
  testPut(location,"String_Node_Str");
  try {
    Bucket bucket=testBucketGet(location.getBucket());
    bucket.setAllowMulti(true);
    testBucketSet(bucket);
    testDelete(location);
    List<String> testdatas=new ArrayList<String>();
    Random r=new Random();
    byte[] bytes=new byte[20];
    r.nextBytes(bytes);
    testdatas.add(Arrays.toString(bytes));
    r.nextBytes(bytes);
    testdatas.add(Arrays.toString(bytes));
    r.nextBytes(bytes);
    testdatas.add(Arrays.toString(bytes));
    testSetClientId("String_Node_Str");
    testPut(location,testdatas.get(0));
    testSetClientId("String_Node_Str");
    testPut(location,testdatas.get(1));
    testSetClientId("String_Node_Str");
    testPutWithSibling(location,testdatas.get(2),testdatas);
    testGetWithSibling(location,testdatas);
  }
  finally {
  }
}

Fixed version (ground truth):
@Test public void testSibling() throws Exception {
  final Location location=new Location("String_Node_Str","String_Node_Str");
  testPut(location,"String_Node_Str");
  try {
    Bucket bucket=testBucketGet(location.getBucket());
    bucket.setAllowMulti(true);
    testBucketSet(bucket);
    testDelete(location);
    List<String> testdatas=new ArrayList<String>();
    Random r=new Random();
    byte[] bytes=new byte[1024 * 128];
    r.nextBytes(bytes);
    testdatas.add(Arrays.toString(bytes));
    r.nextBytes(bytes);
    testdatas.add(Arrays.toString(bytes));
    r.nextBytes(bytes);
    testdatas.add(Arrays.toString(bytes));
    testSetClientId("String_Node_Str");
    testPut(location,testdatas.get(0));
    testSetClientId("String_Node_Str");
    testPut(location,testdatas.get(1));
    testSetClientId("String_Node_Str");
    Thread.sleep(1000 * 10);
    testPutWithSibling(location,testdatas.get(2),testdatas);
    testGetWithSibling(location,testdatas);
  }
  finally {
  }
}
Program: 153523
Project: 153523
Buggy source:
protected void testGetWithSibling(final Location location,final List<String> testdatas) throws InterruptedException {
  final boolean[] is={false};
  final boolean[] beginEnd=new boolean[2];
  final List<String> actuals=new ArrayList<String>();
  RiakFuture waiter=this.target.get(location,new DefaultGetOptions(),new SiblingHandler(){
    @Override public void begin(){
      beginEnd[0]=true;
    }
    @Override public void onError(    RiakResponse response) throws RiakException {
      fail(response.getMessage());
    }
    @Override public void handle(    RiakContentsResponse<RiakObject<byte[]>> response) throws RiakException {
      RiakObject<byte[]> ro=response.getContents();
      assertEquals(location,ro.getLocation());
      actuals.add(new String(ro.getContent()));
      is[0]=true;
    }
    @Override public void end(    RiakResponse response){
      beginEnd[1]=true;
    }
  }
);
  wait(waiter,is);
  assertEquals(3,actuals.size());
  for (  String s : testdatas) {
    assertTrue(s,actuals.contains(s));
  }
  assertTrue("String_Node_Str",beginEnd[0]);
  assertTrue("String_Node_Str",beginEnd[1]);
}

Fixed version (ground truth):
protected void testGetWithSibling(final Location location,final List<String> testdatas) throws InterruptedException {
  final boolean[] is={false};
  final boolean[] beginEnd=new boolean[2];
  final List<String> actuals=new ArrayList<String>();
  RiakFuture waiter=this.target.get(location,new DefaultGetOptions(),new SiblingHandler(){
    @Override public void begin(){
      beginEnd[0]=true;
    }
    @Override public void onError(    RiakResponse response) throws RiakException {
      fail(response.getMessage());
    }
    @Override public void handle(    RiakContentsResponse<RiakObject<byte[]>> response) throws RiakException {
      RiakObject<byte[]> ro=response.getContents();
      assertEquals(location,ro.getLocation());
      actuals.add(new String(ro.getContent()));
      is[0]=true;
    }
    @Override public void end(    RiakResponse response){
      beginEnd[1]=true;
    }
  }
);
  assertTrue("String_Node_Str",waiter.await(10,TimeUnit.SECONDS));
  assertTrue(is[0]);
  assertEquals(3,actuals.size());
  for (  String s : testdatas) {
    assertTrue(s,actuals.contains(s));
  }
  assertTrue("String_Node_Str",beginEnd[0]);
  assertTrue("String_Node_Str",beginEnd[1]);
}
Program: 153524
Project: 153524
Buggy source:
protected void testPutWithSibling(final Location location,final String testdata,final List<String> testdatas) throws Exception {
  final boolean[] is={false};
  final boolean[] beginEnd=new boolean[2];
  RiakObject<byte[]> ro=new DefaultRiakObject(location){
    @Override public byte[] getContent(){
      return testdata.getBytes();
    }
  }
;
  final List<String> actuals=new ArrayList<String>();
  RiakFuture waiter=this.target.put(ro,new DefaultPutOptions(){
    @Override public boolean getReturnBody(){
      return true;
    }
  }
,new SiblingHandler(){
    @Override public void onError(    RiakResponse response) throws Exception {
      fail(response.getMessage());
    }
    @Override public void begin(){
      beginEnd[0]=true;
    }
    @Override public void handle(    RiakContentsResponse<RiakObject<byte[]>> response) throws Exception {
      RiakObject<byte[]> ro=response.getContents();
      assertEquals(location,ro.getLocation());
      actuals.add(new String(ro.getContent()));
      is[0]=true;
    }
    @Override public void end(    RiakResponse response){
      beginEnd[1]=true;
    }
  }
);
  wait(waiter,is);
  assertEquals(3,actuals.size());
  for (  String s : testdatas) {
    assertTrue(s,actuals.contains(s));
  }
  assertTrue("String_Node_Str",beginEnd[0]);
  assertTrue("String_Node_Str",beginEnd[1]);
}

Fixed version (ground truth):
protected void testPutWithSibling(final Location location,final String testdata,final List<String> testdatas) throws Exception {
  final boolean[] is={false};
  final boolean[] beginEnd=new boolean[2];
  RiakObject<byte[]> ro=new DefaultRiakObject(location){
    @Override public byte[] getContent(){
      return testdata.getBytes();
    }
  }
;
  final List<String> actuals=new ArrayList<String>();
  RiakFuture waiter=this.target.put(ro,new DefaultPutOptions(){
    @Override public boolean getReturnBody(){
      return true;
    }
  }
,new SiblingHandler(){
    @Override public void onError(    RiakResponse response) throws Exception {
      fail(response.getMessage());
    }
    @Override public void begin(){
      beginEnd[0]=true;
    }
    @Override public void handle(    RiakContentsResponse<RiakObject<byte[]>> response) throws Exception {
      RiakObject<byte[]> ro=response.getContents();
      assertEquals(location,ro.getLocation());
      actuals.add(new String(ro.getContent()));
      is[0]=true;
    }
    @Override public void end(    RiakResponse response){
      beginEnd[1]=true;
    }
  }
);
  assertTrue("String_Node_Str",waiter.await(10,TimeUnit.SECONDS));
  assertTrue(is[0]);
  assertEquals(3,actuals.size());
  for (  String s : testdatas) {
    assertTrue(s,actuals.contains(s));
  }
  assertTrue("String_Node_Str",beginEnd[0]);
  assertTrue("String_Node_Str",beginEnd[1]);
}
Program: 153525
Project: 153525
Buggy source:
@Override public RiakFuture listKeys(String bucket,final RiakResponseHandler<KeyResponse> handler){
  notNull(bucket,"String_Node_Str");
  notNull(handler,"String_Node_Str");
  RpbListKeysReq request=RpbListKeysReq.newBuilder().setBucket(ByteString.copyFromUtf8(bucket)).build();
  final String procedure="String_Node_Str";
  return handle(procedure,request,handler,new NettyUtil.MessageHandler(){
    @Override public boolean handle(    Object receive) throws Exception {
      if (receive instanceof RpbListKeysResp) {
        RpbListKeysResp resp=(RpbListKeysResp)receive;
        boolean done=resp.getDone();
        List<String> list=new ArrayList<String>(resp.getKeysCount());
        for (        ByteString bs : resp.getKeysList()) {
          list.add(to(bs));
        }
        KeyResponse kr=new KeyResponse(list,done);
        handler.handle(support.newResponse(kr));
        return done;
      }
      throw new IncomprehensibleProtocolException(procedure);
    }
  }
);
}

Fixed version (ground truth):
@Override public RiakFuture listKeys(String bucket,final RiakResponseHandler<KeyResponse> handler){
  notNull(bucket,"String_Node_Str");
  notNull(handler,"String_Node_Str");
  RpbListKeysReq request=RpbListKeysReq.newBuilder().setBucket(ByteString.copyFromUtf8(bucket)).build();
  final String procedure="String_Node_Str";
  return handle(procedure,request,handler,new NettyUtil.MessageHandler(){
    @Override public boolean handle(    Object receive) throws Exception {
      if (receive instanceof RpbListKeysResp) {
        RpbListKeysResp resp=(RpbListKeysResp)receive;
        boolean done=resp.getDone();
        List<String> list=new ArrayList<String>(resp.getKeysCount());
        for (        ByteString bs : resp.getKeysList()) {
          list.add(to(bs));
        }
        KeyResponse kr=new KeyResponse(list,done);
        handler.handle(PbcRiakOperations.this.support.newResponse(kr));
        return done;
      }
      throw new IncomprehensibleProtocolException(procedure);
    }
  }
);
}
Program: 153526
Project: 153526
Buggy source:
@Override public RiakFuture listBuckets(final RiakResponseHandler<List<String>> handler){
  notNull(handler,"String_Node_Str");
  final String procedure="String_Node_Str";
  return handle(procedure,MessageCodes.RpbListBucketsReq,handler,new NettyUtil.MessageHandler(){
    @Override public boolean handle(    Object receive) throws Exception {
      if (receive instanceof RpbListBucketsResp) {
        RpbListBucketsResp resp=(RpbListBucketsResp)receive;
        List<String> list=new ArrayList<String>(resp.getBucketsCount());
        for (        ByteString bs : resp.getBucketsList()) {
          list.add(to(bs));
        }
        handler.handle(support.newResponse(list));
        return true;
      }
      throw new IncomprehensibleProtocolException(procedure);
    }
  }
);
}

Fixed version (ground truth):
@Override public RiakFuture listBuckets(final RiakResponseHandler<List<String>> handler){
  notNull(handler,"String_Node_Str");
  final String procedure="String_Node_Str";
  return handle(procedure,MessageCodes.RpbListBucketsReq,handler,new NettyUtil.MessageHandler(){
    @Override public boolean handle(    Object receive) throws Exception {
      if (receive instanceof RpbListBucketsResp) {
        RpbListBucketsResp resp=(RpbListBucketsResp)receive;
        List<String> list=new ArrayList<String>(resp.getBucketsCount());
        for (        ByteString bs : resp.getBucketsList()) {
          list.add(to(bs));
        }
        handler.handle(PbcRiakOperations.this.support.newResponse(list));
        return true;
      }
      throw new IncomprehensibleProtocolException(procedure);
    }
  }
);
}
Program: 153527
Project: 153527
Buggy source:
/** 
 * Get the client id used for this connection. Client ids are used for conflict resolution and each unique actor in the system should be assigned one. A client id is assigned randomly when the socket is connected and can be changed using SetClientId below.
 * @param handler
 * @return
 */
public RiakFuture getClientId(final RiakResponseHandler<String> handler){
  final String procedure="String_Node_Str";
  return handle(procedure,MessageCodes.RpbGetClientIdReq,handler,new NettyUtil.MessageHandler(){
    @Override public boolean handle(    Object receive) throws Exception {
      if (receive instanceof RpbGetClientIdResp) {
        RpbGetClientIdResp resp=(RpbGetClientIdResp)receive;
        String cid=to(resp.getClientId());
        handler.handle(support.newResponse(cid));
      }
      throw new IncomprehensibleProtocolException(procedure);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Get the client id used for this connection. Client ids are used for conflict resolution and each unique actor in the system should be assigned one. A client id is assigned randomly when the socket is connected and can be changed using SetClientId below.
 * @param handler
 * @return
 */
public RiakFuture getClientId(final RiakResponseHandler<String> handler){
  final String procedure="String_Node_Str";
  return handle(procedure,MessageCodes.RpbGetClientIdReq,handler,new NettyUtil.MessageHandler(){
    @Override public boolean handle(    Object receive) throws Exception {
      if (receive instanceof RpbGetClientIdResp) {
        RpbGetClientIdResp resp=(RpbGetClientIdResp)receive;
        String cid=to(resp.getClientId());
        handler.handle(PbcRiakOperations.this.support.newResponse(cid));
        return true;
      }
      throw new IncomprehensibleProtocolException(procedure);
    }
  }
);
}
Program: 153528
Project: 153528
Buggy source:
@Override public RiakFuture ping(final RiakResponseHandler<String> handler){
  final String procedure="String_Node_Str";
  return handle(procedure,MessageCodes.RpbPingReq,handler,new NettyUtil.MessageHandler(){
    @Override public boolean handle(    Object receive) throws Exception {
      if (MessageCodes.RpbPingResp.equals(receive)) {
        handler.handle(support.newResponse("String_Node_Str"));
        return true;
      }
      throw new IncomprehensibleProtocolException(procedure);
    }
  }
);
}

Fixed version (ground truth):
@Override public RiakFuture ping(final RiakResponseHandler<String> handler){
  final String procedure="String_Node_Str";
  return handle(procedure,MessageCodes.RpbPingReq,handler,new NettyUtil.MessageHandler(){
    @Override public boolean handle(    Object receive) throws Exception {
      if (MessageCodes.RpbPingResp.equals(receive)) {
        handler.handle(PbcRiakOperations.this.support.newResponse("String_Node_Str"));
        return true;
      }
      throw new IncomprehensibleProtocolException(procedure);
    }
  }
);
}
Program: 153529
Project: 153529
Buggy source:
@Override public RiakFuture setBucket(Bucket bucket,final RiakResponseHandler<_> handler){
  notNull(bucket,"String_Node_Str");
  notNull(handler,"String_Node_Str");
  RpbBucketProps props=RpbBucketProps.newBuilder().setNVal(bucket.getNumberOfReplicas()).setAllowMult(bucket.getAllowMulti()).build();
  RpbSetBucketReq request=RpbSetBucketReq.newBuilder().setBucket(ByteString.copyFromUtf8(bucket.getName())).setProps(props).build();
  final String procedure="String_Node_Str";
  return handle(procedure,request,handler,new NettyUtil.MessageHandler(){
    @Override public boolean handle(    Object receive) throws Exception {
      if (MessageCodes.RpbSetBucketResp.equals(receive)) {
        handler.handle(support.newResponse());
        return true;
      }
      throw new IncomprehensibleProtocolException(procedure);
    }
  }
);
}

Fixed version (ground truth):
@Override public RiakFuture setBucket(Bucket bucket,final RiakResponseHandler<_> handler){
  notNull(bucket,"String_Node_Str");
  notNull(handler,"String_Node_Str");
  RpbBucketProps props=RpbBucketProps.newBuilder().setNVal(bucket.getNumberOfReplicas()).setAllowMult(bucket.getAllowMulti()).build();
  RpbSetBucketReq request=RpbSetBucketReq.newBuilder().setBucket(ByteString.copyFromUtf8(bucket.getName())).setProps(props).build();
  final String procedure="String_Node_Str";
  return handle(procedure,request,handler,new NettyUtil.MessageHandler(){
    @Override public boolean handle(    Object receive) throws Exception {
      if (MessageCodes.RpbSetBucketResp.equals(receive)) {
        handler.handle(PbcRiakOperations.this.support.newResponse());
        return true;
      }
      throw new IncomprehensibleProtocolException(procedure);
    }
  }
);
}
Program: 153530
Project: 153530
Buggy source:
@Override public RiakFuture put(RiakObject<byte[]> content,PutOptions options,final SiblingHandler handler){
  notNull(content,"String_Node_Str");
  notNull(options,"String_Node_Str");
  notNull(handler,"String_Node_Str");
  final Location location=content.getLocation();
  RpbPutReq.Builder builder=buildPutRequest(content,location,options);
  final String procedure="String_Node_Str";
  return handle(procedure,builder.build(),handler,new NettyUtil.MessageHandler(){
    @Override public boolean handle(    Object receive) throws Exception {
      if (receive instanceof RpbPutResp) {
        RpbPutResp resp=(RpbPutResp)receive;
        try {
          handler.begin();
          if (0 < resp.getContentCount()) {
            String vclock=toVclock(resp.getVclock());
            for (            RpbContent c : resp.getContentList()) {
              RiakObject<byte[]> ro=convert(location,vclock,c);
              handler.handle(support.newResponse(ro));
            }
          }
        }
  finally {
          handler.end();
        }
        return true;
      }
      throw new IncomprehensibleProtocolException(procedure);
    }
  }
);
}

Fixed version (ground truth):
@Override public RiakFuture put(RiakObject<byte[]> content,PutOptions options,final SiblingHandler handler){
  notNull(content,"String_Node_Str");
  notNull(options,"String_Node_Str");
  notNull(handler,"String_Node_Str");
  final Location location=content.getLocation();
  RpbPutReq.Builder builder=buildPutRequest(content,location,options);
  final String procedure="String_Node_Str";
  return handle(procedure,builder.build(),handler,new NettyUtil.MessageHandler(){
    @Override public boolean handle(    Object receive) throws Exception {
      if (receive instanceof RpbPutResp) {
        RpbPutResp resp=(RpbPutResp)receive;
        try {
          handler.begin();
          if (0 < resp.getContentCount()) {
            String vclock=toVclock(resp.getVclock());
            for (            RpbContent c : resp.getContentList()) {
              RiakObject<byte[]> ro=convert(location,vclock,c);
              handler.handle(PbcRiakOperations.this.support.newResponse(ro));
            }
          }
        }
  finally {
          handler.end();
        }
        return true;
      }
      throw new IncomprehensibleProtocolException(procedure);
    }
  }
);
}