Program: 5133
Project: 5133
Buggy source:
/** 
 * @modifies : the network underlying this, manager
 * @effects : receives request and sends appropriate replies. Returns if either the connection is closed or an error happens. If this happens, removes itself from the manager's connection list.
 */
public void run(){
  try {
    while (true) {
      Message m=null;
      try {
        m=receive();
        if (m == null)         continue;
      }
 catch (      BadPacketException e) {
        continue;
      }
      byte[] guid=m.getGUID();
      Connection originator=routeTable.get(guid);
      manager.catcher.spy(m);
      if (m instanceof PingRequest && originator == null) {
        byte[] ip=sock.getLocalAddress().getAddress();
        send(new PingReply(guid,m.getHops(),(short)sock.getLocalPort(),ip,(int)0,(int)0));
      }
 else       if (m instanceof QueryRequest) {
      }
      if (m.hop() != 0) {
        if (m.isRequest()) {
          if (originator == null) {
            routeTable.put(guid,this);
            manager.sendToAllExcept(m,this);
          }
        }
 else {
          if (originator == this)           ;
 else           if (originator != null)           originator.send(m);
 else           ConnectionManager.error("String_Node_Str" + m.toString() + "String_Node_Str");
        }
      }
    }
  }
 catch (  IOException e) {
    manager.remove(this);
    ConnectionManager.error("String_Node_Str" + sock.toString());
  }
catch (  Exception e) {
    ConnectionManager.error("String_Node_Str");
    manager.remove(this);
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * @requires the manager to this is non-null
 * @modifies the network underlying this, manager
 * @effects receives request and sends appropriate replies.Returns if either the connection is closed or an error happens. If this happens, removes itself from the manager's connection list.
 */
public void run(){
  Assert.that(manager != null && routeTable != null);
  try {
    while (true) {
      Message m=null;
      try {
        m=receive();
        if (m == null)         continue;
      }
 catch (      BadPacketException e) {
        continue;
      }
      byte[] guid=m.getGUID();
      Connection originator=routeTable.get(guid);
      manager.catcher.spy(m);
      if (m instanceof PingRequest && originator == null) {
        byte[] ip=sock.getLocalAddress().getAddress();
        send(new PingReply(guid,m.getHops(),(short)sock.getLocalPort(),ip,(int)0,(int)0));
      }
 else       if (m instanceof QueryRequest) {
      }
      if (m.hop() != 0) {
        if (m.isRequest()) {
          if (originator == null) {
            routeTable.put(guid,this);
            manager.sendToAllExcept(m,this);
          }
        }
 else {
          if (originator == this)           ;
 else           if (originator != null)           originator.send(m);
 else           ConnectionManager.error("String_Node_Str" + m.toString() + "String_Node_Str");
        }
      }
    }
  }
 catch (  IOException e) {
    manager.remove(this);
    ConnectionManager.error("String_Node_Str" + sock.toString());
  }
catch (  Exception e) {
    ConnectionManager.error("String_Node_Str");
    manager.remove(this);
    e.printStackTrace();
  }
}