Program: 154643
Project: 154643
Buggy source:
private <T>Response<T> sendRequest(RequestType type,SlaveContext slaveContext,Serializer serializer,Deserializer<T> deserializer){
  Triplet<Channel,ChannelBuffer,ByteBuffer> channelContext=null;
  try {
    channelContext=getChannel();
    Channel channel=channelContext.first();
    ChannelBuffer buffer=channelContext.second();
    buffer.clear();
    buffer=new ChunkingChannelBuffer(buffer,channel,MAX_FRAME_LENGTH);
    buffer.writeByte(type.ordinal());
    if (type.includesSlaveContext()) {
      writeSlaveContext(buffer,slaveContext);
    }
    serializer.write(buffer,channelContext.third());
    if (buffer.writerIndex() > 0) {
      channel.write(buffer);
    }
    @SuppressWarnings("String_Node_Str") BlockingReadHandler<ChannelBuffer> reader=(BlockingReadHandler<ChannelBuffer>)channel.getPipeline().get("String_Node_Str");
    final Triplet<Channel,ChannelBuffer,ByteBuffer> finalChannelContext=channelContext;
    DechunkingChannelBuffer dechunkingBuffer=new DechunkingChannelBuffer(ChannelBuffers.dynamicBuffer(),reader){
      @Override protected ChannelBuffer readNext(){
        ChannelBuffer result=super.readNext();
        if (result == null) {
          channelPool.dispose(finalChannelContext);
          throw new HaCommunicationException("String_Node_Str");
        }
        return result;
      }
    }
;
    T response=deserializer.read(dechunkingBuffer);
    String[] datasources=type.includesSlaveContext() ? readTransactionStreamHeader(dechunkingBuffer) : null;
    while (dechunkingBuffer.expectsMoreChunks()) {
      applyFullyAvailableTransactions(datasources,dechunkingBuffer);
      if (dechunkingBuffer.expectsMoreChunks()) {
        dechunkingBuffer.forceReadNextChunk();
      }
    }
    TransactionStream txStreams=type.includesSlaveContext() ? readTransactionStreams(datasources,dechunkingBuffer) : TransactionStream.EMPTY;
    return new Response<T>(response,txStreams);
  }
 catch (  ClosedChannelException e) {
    channelPool.dispose(channelContext);
    throw new HaCommunicationException(e);
  }
catch (  IOException e) {
    throw new HaCommunicationException(e);
  }
catch (  InterruptedException e) {
    throw new HaCommunicationException(e);
  }
catch (  Exception e) {
    throw new HaCommunicationException(e);
  }
}

Fixed version (ground truth):
private <T>Response<T> sendRequest(RequestType type,SlaveContext slaveContext,Serializer serializer,Deserializer<T> deserializer){
  Triplet<Channel,ChannelBuffer,ByteBuffer> channelContext=null;
  try {
    channelContext=getChannel();
    Channel channel=channelContext.first();
    ChannelBuffer buffer=channelContext.second();
    buffer.clear();
    buffer=new ChunkingChannelBuffer(buffer,channel,MAX_FRAME_LENGTH);
    buffer.writeByte(type.ordinal());
    if (type.includesSlaveContext()) {
      writeSlaveContext(buffer,slaveContext);
    }
    serializer.write(buffer,channelContext.third());
    if (buffer.writerIndex() > 0) {
      channel.write(buffer);
    }
    @SuppressWarnings("String_Node_Str") BlockingReadHandler<ChannelBuffer> reader=(BlockingReadHandler<ChannelBuffer>)channel.getPipeline().get("String_Node_Str");
    final Triplet<Channel,ChannelBuffer,ByteBuffer> finalChannelContext=channelContext;
    DechunkingChannelBuffer dechunkingBuffer=new DechunkingChannelBuffer(reader){
      @Override protected ChannelBuffer readNext(){
        ChannelBuffer result=super.readNext();
        if (result == null) {
          channelPool.dispose(finalChannelContext);
          throw new HaCommunicationException("String_Node_Str");
        }
        return result;
      }
    }
;
    T response=deserializer.read(dechunkingBuffer);
    TransactionStream txStreams=type.includesSlaveContext() ? readTransactionStreams(dechunkingBuffer) : TransactionStream.EMPTY;
    return new Response<T>(response,txStreams);
  }
 catch (  ClosedChannelException e) {
    channelPool.dispose(channelContext);
    throw new HaCommunicationException(e);
  }
catch (  IOException e) {
    throw new HaCommunicationException(e);
  }
catch (  InterruptedException e) {
    throw new HaCommunicationException(e);
  }
catch (  Exception e) {
    throw new HaCommunicationException(e);
  }
}