Program: 179519
Project: 179519
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void run(){
  while (!stopOperation) {
    try {
      NetworkMessage msg=messageQueue.take();
      connectionInUse=true;
      Schema schema;
      byte classType;
      if (msg instanceof KeepAliveMessage) {
        classType=-1;
        byte[] message={classType,0,0,0,0};
        os.write(message);
        keepAliveBreak=true;
      }
      if (msg instanceof PlayerRegistrationMessage) {
        schema=playerRegSchema;
        classType=1;
      }
 else       if (msg instanceof NetworkMessageMedium) {
        schema=mediumMsgSchema;
        classType=2;
      }
 else       if (msg instanceof NetworkMessageLarge) {
        schema=largeMsgSchema;
        classType=3;
      }
 else {
        schema=networkMsgSchema;
        classType=0;
      }
      if (!keepAliveBreak) {
        byte[] serializedObject=ProtostuffIOUtil.toByteArray(msg,schema,buffer);
        b.clear();
        b.putInt(serializedObject.length);
        byte[] lengthField=b.array();
        byte[] message=new byte[serializedObject.length + lengthField.length + 1];
        message[0]=classType;
        System.arraycopy(lengthField,0,message,1,lengthField.length);
        System.arraycopy(serializedObject,0,message,lengthField.length + 1,serializedObject.length);
        Log.d(NetworkVariables.TAG,"String_Node_Str" + serializedObject.length);
        os.write(message);
      }
    }
 catch (    IOException e) {
      System.err.println("String_Node_Str" + e);
    }
catch (    InterruptedException e) {
    }
catch (    Exception e) {
      Log.e(NetworkVariables.TAG,"String_Node_Str",e);
    }
 finally {
      connectionInUse=false;
      keepAliveBreak=false;
      buffer.clear();
      b.clear();
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void run(){
  while (!stopOperation) {
    try {
      NetworkMessage msg=messageQueue.take();
      connectionInUse=true;
      Schema schema;
      byte classType;
      if (msg instanceof KeepAliveMessage) {
        classType=-1;
        byte[] message={classType,0,0,0,0};
        os.write(message);
        keepAliveBreak=true;
      }
      if (msg instanceof PlayerRegistrationMessage) {
        schema=playerRegSchema;
        classType=1;
      }
 else       if (msg instanceof NetworkMessageMedium) {
        schema=mediumMsgSchema;
        classType=2;
      }
 else       if (msg instanceof NetworkMessageLarge) {
        schema=largeMsgSchema;
        classType=3;
      }
 else {
        schema=networkMsgSchema;
        classType=0;
      }
      if (!keepAliveBreak) {
        byte[] serializedObject=ProtostuffIOUtil.toByteArray(msg,schema,buffer);
        b.clear();
        b.putInt(serializedObject.length);
        byte[] lengthField=b.array();
        byte[] message=new byte[serializedObject.length + lengthField.length + 1];
        message[0]=classType;
        System.arraycopy(lengthField,0,message,1,lengthField.length);
        System.arraycopy(serializedObject,0,message,lengthField.length + 1,serializedObject.length);
        os.write(message);
      }
    }
 catch (    IOException e) {
      System.err.println("String_Node_Str" + e);
    }
catch (    InterruptedException e) {
    }
catch (    Exception e) {
      Log.e(NetworkVariables.TAG,"String_Node_Str",e);
    }
 finally {
      connectionInUse=false;
      keepAliveBreak=false;
      buffer.clear();
      b.clear();
    }
  }
}