Program: 10345
Project: 10345
Buggy source:
@Override public void channelRead0(ChannelHandlerContext ctx,Request request) throws Exception {
  logger.debug("String_Node_Str",request);
  Response.Builder builder=Response.newBuilder();
  builder.setId(request.getId());
  boolean result=false;
switch (request.getType()) {
case LOOKUP:
    logger.debug("String_Node_Str");
  try {
    byte[] res=handler.lookup(request.getId().toByteArray(),request.getPartition());
    builder.setSucceeded(true);
    logger.debug("String_Node_Str",res);
    if (res != null) {
      logger.debug("String_Node_Str");
      builder.setData(ByteString.copyFrom(res));
    }
  }
 catch (  Exception e) {
    logger.info("String_Node_Str",e);
    builder.setSucceeded(false);
  }
break;
case STORE:
logger.debug("String_Node_Str");
result=handler.store(request.getId().toByteArray(),request.getPartition(),request.getData().toByteArray(),request.getCallback());
builder.setSucceeded(result);
break;
case PROCESS_EVENT:
logger.debug("String_Node_Str");
result=handler.processBatch(request.getId().toByteArray(),request.getPartition(),Lists.transform(request.getEventsList(),new Function<ByteString,byte[]>(){
public byte[] apply(ByteString from){
return from.toByteArray();
}
}
));
builder.setSucceeded(result);
break;
case GETNEXT:
logger.debug("String_Node_Str");
try {
byte[] returnData=handler.getNext(request.getPartition(),request.getVersionid());
logger.debug("String_Node_Str",returnData,request.getPartition());
if (returnData == null) {
builder.setData(null);
builder.setSucceeded(true);
}
 else {
builder.setData(ByteString.copyFrom(returnData));
builder.setSucceeded(true);
}
}
 catch (Exception e) {
logger.info("String_Node_Str",e);
builder.setSucceeded(false);
}
break;
case JUMP:
logger.debug("String_Node_Str");
handler.jump(request.getId().toByteArray(),request.getPartition(),request.getVersionid());
builder.setSucceeded(true);
break;
case MULTI_LOOKUP:
logger.debug("String_Node_Str");
for (Request req : request.getRequestsList()) {
long partitionId=req.getPartition();
for (ByteString id : req.getIdsList()) {
try {
byte[] res=handler.lookup(id.toByteArray(),partitionId);
builder.addResponses(Response.newBuilder().setId(id).setSucceeded(true).setData(ByteString.copyFrom(res)).build());
}
 catch (Exception e) {
builder.addResponses(Response.newBuilder().setId(id).setSucceeded(false).build());
}
}
}
break;
case MULTI_PROCESS_EVENT:
logger.debug("String_Node_Str");
for (Request req : request.getRequestsList()) {
long partitionId=req.getPartition();
int n=req.getIdsCount();
for (int i=0; i < n; i++) {
boolean ret=false;
try {
ret=handler.processBatch(req.getIds(i).toByteArray(),partitionId,Collections.singletonList(req.getEvents(i).toByteArray()));
}
 catch (Exception e) {
ret=false;
}
builder.addResponses(Response.newBuilder().setId(req.getIds(i)).setSucceeded(ret).build());
}
}
case DELETE:
logger.debug("String_Node_Str");
result=handler.delete(request.getId().toByteArray(),request.getPartition());
builder.setSucceeded(result);
break;
default :
logger.debug("String_Node_Str");
break;
}
if (request.hasThreadId()) builder.setThreadId(request.getThreadId());
builder.setRequestId(request.getRequestId());
Response response=builder.build();
logger.debug("String_Node_Str",response);
ctx.write(response);
}

Fixed version (ground truth):
@Override public void channelRead0(ChannelHandlerContext ctx,Request request) throws Exception {
  logger.debug("String_Node_Str",request);
  Response.Builder builder=Response.newBuilder();
  builder.setId(request.getId());
  boolean result=false;
switch (request.getType()) {
case LOOKUP:
    logger.debug("String_Node_Str");
  try {
    byte[] res=handler.lookup(request.getId().toByteArray(),request.getPartition());
    builder.setSucceeded(true);
    logger.debug("String_Node_Str",res);
    if (res != null) {
      logger.debug("String_Node_Str");
      builder.setData(ByteString.copyFrom(res));
    }
  }
 catch (  Exception e) {
    logger.info("String_Node_Str",e);
    builder.setSucceeded(false);
  }
break;
case STORE:
logger.debug("String_Node_Str");
result=handler.store(request.getId().toByteArray(),request.getPartition(),request.getData().toByteArray(),request.getCallback());
builder.setSucceeded(result);
break;
case PROCESS_EVENT:
logger.debug("String_Node_Str");
result=handler.processBatch(request.getId().toByteArray(),request.getPartition(),Lists.transform(request.getEventsList(),new Function<ByteString,byte[]>(){
public byte[] apply(ByteString from){
return from.toByteArray();
}
}
));
builder.setSucceeded(result);
break;
case GETNEXT:
logger.debug("String_Node_Str");
try {
byte[] returnData=handler.getNext(request.getPartition(),request.getVersionid());
logger.debug("String_Node_Str",returnData,request.getPartition());
if (returnData == null) {
builder.setSucceeded(false);
}
 else {
builder.setData(ByteString.copyFrom(returnData));
builder.setSucceeded(true);
}
}
 catch (Exception e) {
logger.info("String_Node_Str",e);
builder.setSucceeded(false);
}
break;
case JUMP:
logger.debug("String_Node_Str");
handler.jump(request.getId().toByteArray(),request.getPartition(),request.getVersionid());
builder.setSucceeded(true);
break;
case MULTI_LOOKUP:
logger.debug("String_Node_Str");
for (Request req : request.getRequestsList()) {
long partitionId=req.getPartition();
for (ByteString id : req.getIdsList()) {
try {
byte[] res=handler.lookup(id.toByteArray(),partitionId);
builder.addResponses(Response.newBuilder().setId(id).setSucceeded(true).setData(ByteString.copyFrom(res)).build());
}
 catch (Exception e) {
builder.addResponses(Response.newBuilder().setId(id).setSucceeded(false).build());
}
}
}
break;
case MULTI_PROCESS_EVENT:
logger.debug("String_Node_Str");
for (Request req : request.getRequestsList()) {
long partitionId=req.getPartition();
int n=req.getIdsCount();
for (int i=0; i < n; i++) {
boolean ret=false;
try {
ret=handler.processBatch(req.getIds(i).toByteArray(),partitionId,Collections.singletonList(req.getEvents(i).toByteArray()));
}
 catch (Exception e) {
ret=false;
}
builder.addResponses(Response.newBuilder().setId(req.getIds(i)).setSucceeded(ret).build());
}
}
case DELETE:
logger.debug("String_Node_Str");
result=handler.delete(request.getId().toByteArray(),request.getPartition());
builder.setSucceeded(result);
break;
default :
logger.debug("String_Node_Str");
break;
}
if (request.hasThreadId()) builder.setThreadId(request.getThreadId());
builder.setRequestId(request.getRequestId());
Response response=builder.build();
logger.debug("String_Node_Str",response);
ctx.write(response);
}