Program: 179515
Project: 179515
Buggy source:
@Override public void run(){
  while (!stopOperation) {
    try {
      NetworkMessage msg=null;
      Schema schema=null;
      byte[] messageHeader=new byte[5];
      int headerBytesRead=in.read(messageHeader);
      if (headerBytesRead == 5) {
        byte classType=messageHeader[0];
switch (classType) {
case -1:
          keepAliveBreak=true;
        break;
case 1:
      msg=new PlayerRegistrationMessage();
    schema=playerRegSchema;
  break;
case 2:
msg=new NetworkMessageMedium();
schema=mediumMsgSchema;
break;
case 3:
msg=new NetworkMessageLarge();
schema=largeMsgSchema;
break;
default :
msg=new NetworkMessage();
schema=networkMsgSchema;
}
if (!keepAliveBreak) {
b.clear();
b.put(messageHeader,1,4);
b.rewind();
int mSize=b.getInt();
byte[] object=new byte[mSize];
int bytesRead=0;
while (bytesRead != mSize) {
bytesRead+=in.read(object,bytesRead,object.length - bytesRead);
}
byte[] decompressed=QuickLZ.decompress(object);
ProtostuffIOUtil.mergeFrom(decompressed,msg,schema);
processNetworkMessage(msg);
}
}
 else {
if (headerBytesRead == -1) {
LogMaker.errorPrintln("String_Node_Str",playerID);
shutdownThread();
}
}
}
 catch (InterruptedIOException e) {
}
catch (IOException e) {
LogMaker.errorPrintln("String_Node_Str" + e,playerID);
this.shutdownThread();
}
catch (NullPointerException e) {
LogMaker.errorPrintln("String_Node_Str" + e.getMessage(),playerID);
this.shutdownThread();
}
catch (BufferOverflowException e) {
LogMaker.errorPrintln("String_Node_Str",playerID);
}
catch (RuntimeException e) {
LogMaker.errorPrintln("String_Node_Str" + e,playerID);
}
 finally {
keepAliveBreak=false;
buffer.clear();
b.clear();
}
}
}

Fixed version (ground truth):
@Override public void run(){
  while (!stopOperation) {
    try {
      NetworkMessage msg=null;
      Schema schema=null;
      byte[] messageHeader=new byte[5];
      int headerBytesRead=in.read(messageHeader);
      if (headerBytesRead == 5) {
        byte classType=messageHeader[0];
switch (classType) {
case -1:
          keepAliveBreak=true;
        break;
case 1:
      msg=new PlayerRegistrationMessage();
    schema=playerRegSchema;
  break;
case 2:
msg=new NetworkMessageMedium();
schema=mediumMsgSchema;
break;
case 3:
msg=new NetworkMessageLarge();
schema=largeMsgSchema;
break;
default :
msg=new NetworkMessage();
schema=networkMsgSchema;
}
if (!keepAliveBreak) {
b.clear();
b.put(messageHeader,1,4);
b.rewind();
int mSize=b.getInt();
byte[] object=new byte[mSize];
int bytesRead=0;
while (bytesRead != mSize) {
bytesRead+=in.read(object,bytesRead,object.length - bytesRead);
}
byte[] decompressed=QuickLZ.decompress(object);
ProtostuffIOUtil.mergeFrom(decompressed,msg,schema);
processNetworkMessage(msg);
}
}
 else {
if (headerBytesRead == -1) {
LogMaker.errorPrintln("String_Node_Str",playerID);
shutdownThread();
}
}
}
 catch (InterruptedIOException e) {
}
catch (IOException e) {
LogMaker.errorPrintln("String_Node_Str" + e,playerID);
this.shutdownThread();
}
catch (NullPointerException e) {
LogMaker.errorPrintln("String_Node_Str" + e.getMessage(),playerID);
this.shutdownThread();
}
catch (BufferOverflowException e) {
LogMaker.errorPrintln("String_Node_Str",playerID);
}
catch (java.lang.OutOfMemoryError e) {
LogMaker.errorPrintln("String_Node_Str",playerID);
}
catch (RuntimeException e) {
LogMaker.errorPrintln("String_Node_Str" + e,playerID);
}
 finally {
keepAliveBreak=false;
buffer.clear();
b.clear();
}
}
}