Program: 179518
Project: 179518
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void run(){
  if (!connected) {
    connectToServer();
  }
  if (connected) {
    isRunning=true;
    registerWithServer(getPlayerRegistrationInformation());
    while (!stopOperation) {
      try {
        NetworkMessage msg=null;
        Schema schema=null;
        byte[] messageHeader=new byte[5];
        int success=in.read(messageHeader);
        if (success == 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);
}
ProtostuffIOUtil.mergeFrom(object,msg,schema);
processNetworkMessage(msg);
}
}
 else {
if (success == -1) {
System.err.println("String_Node_Str");
shutdownThread();
}
}
}
 catch (InterruptedIOException e) {
}
catch (IOException e) {
System.err.println("String_Node_Str" + e);
fireEvent(new NetworkEvent(this,"String_Node_Str" + e),ConnectionLostListener.class);
this.shutdownThread();
break;
}
catch (NullPointerException e) {
Log.e(NetworkVariables.TAG,"String_Node_Str",e);
}
catch (RuntimeException e) {
System.err.println("String_Node_Str");
}
 finally {
buffer.clear();
}
}
}
 else {
shutdownThread();
}
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void run(){
  if (!connected) {
    connectToServer();
  }
  if (connected) {
    isRunning=true;
    registerWithServer(getPlayerRegistrationInformation());
    while (!stopOperation) {
      try {
        NetworkMessage msg=null;
        Schema schema=null;
        byte[] messageHeader=new byte[5];
        int success=in.read(messageHeader);
        if (success == 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);
}
ProtostuffIOUtil.mergeFrom(object,msg,schema);
processNetworkMessage(msg);
}
}
 else {
if (success == -1) {
System.err.println("String_Node_Str");
shutdownThread();
}
}
}
 catch (InterruptedIOException e) {
}
catch (IOException e) {
Log.e(NetworkVariables.TAG,"String_Node_Str" + e);
fireEvent(new NetworkEvent(this,"String_Node_Str" + e),ConnectionLostListener.class);
this.shutdownThread();
break;
}
catch (NullPointerException e) {
Log.e(NetworkVariables.TAG,"String_Node_Str",e);
}
catch (RuntimeException e) {
Log.e(NetworkVariables.TAG,"String_Node_Str");
}
 finally {
buffer.clear();
}
}
}
 else {
shutdownThread();
}
}