Program: 83968
Project: 83968
Buggy source:
public void run(){
  try {
    ObjectInputStream incoming=null;
    ObjectOutputStream outgoing=null;
    ServerSocket server=new ServerSocket(9999,100,InetAddress.getByName("String_Node_Str"));
    boolean keepRunning=true;
    while (keepRunning) {
      logger.info("String_Node_Str");
      Socket s=server.accept();
      incoming=new ObjectInputStream(s.getInputStream());
      outgoing=new ObjectOutputStream(s.getOutputStream());
      RouterCommand cmd=(RouterCommand)incoming.readObject();
      RouterCommand cmdrep=null;
switch (cmd.type) {
case PUSH:
        if (cmd.sourcepath != null && cmd.destpath != null && cmd.data != null && cmd.units != null)         sendData(cmd.sourcepath,cmd.destpath,cmd.data,cmd.units);
      cmdrep=new RouterCommand(RouterCommand.CommandType.PUSH_ACK);
    outgoing.writeObject(cmdrep);
  outgoing.flush();
break;
case PULL:
String reply=null;
if (cmd.lowts > 0 && cmd.hights > 0 && cmd.sourcepath != null && cmd.units != null) reply=pullFromNode(cmd.sourcepath,cmd.units,cmd.lowts,cmd.hights);
cmdrep=new RouterCommand(RouterCommand.CommandType.PULL_ACK);
cmdrep.data=reply;
outgoing.writeObject(cmdrep);
outgoing.flush();
break;
case ADD_NODE:
logger.info("String_Node_Str");
if (cmd.sourcepath != null) addNodeEvent(cmd.sourcepath);
cmdrep=new RouterCommand(RouterCommand.CommandType.ADD_NODE_ACK);
outgoing.writeObject(cmdrep);
outgoing.flush();
break;
case REMOVE_NODE:
if (cmd.sourcepath != null) removeNodeEvent(cmd.sourcepath);
cmdrep=new RouterCommand(RouterCommand.CommandType.REMOVE_NODE_ACK);
outgoing.writeObject(cmdrep);
outgoing.flush();
break;
case ADD_LINK:
if (cmd.sourcepath != null && cmd.destpath != null) createLink(cmd.sourcepath,cmd.destpath);
cmdrep=new RouterCommand(RouterCommand.CommandType.ADD_LINK_ACK);
outgoing.writeObject(cmdrep);
outgoing.flush();
break;
case REMOVE_LINK:
if (cmd.sourcepath != null && cmd.destpath != null) removeLink(cmd.sourcepath,cmd.destpath);
cmdrep=new RouterCommand(RouterCommand.CommandType.REMOVE_LINK_ACK);
outgoing.writeObject(cmdrep);
outgoing.flush();
break;
case CREATE_AGG_PNT:
if (cmd.sourcepath != null && cmd.units != null) {
setUnitAndTypeAtPath(cmd.sourcepath,cmd.units,ProcType.AGGREGATE,cmd.state);
cmdrep=new RouterCommand(RouterCommand.CommandType.CREATE_AGG_PNT_ACK);
outgoing.writeObject(cmdrep);
outgoing.flush();
}
break;
case STOP_ROUTER:
keepRunning=false;
break;
}
incoming.close();
outgoing.close();
}
}
 catch (Exception e) {
logger.log(Level.SEVERE,"String_Node_Str",e);
System.exit(1);
}
return;
}

Fixed version (ground truth):
public void run(){
  try {
    ObjectInputStream incoming=null;
    ObjectOutputStream outgoing=null;
    ServerSocket server=new ServerSocket(9999,100,InetAddress.getByName("String_Node_Str"));
    boolean keepRunning=true;
    while (keepRunning) {
      logger.info("String_Node_Str");
      Socket s=server.accept();
      incoming=new ObjectInputStream(s.getInputStream());
      outgoing=new ObjectOutputStream(s.getOutputStream());
      RouterCommand cmd=(RouterCommand)incoming.readObject();
      RouterCommand cmdrep=null;
switch (cmd.type) {
case PUSH:
        if (cmd.sourcepath != null && cmd.destpath != null && cmd.data != null && cmd.units != null)         sendData(cmd.sourcepath,cmd.destpath,cmd.data,cmd.units);
      cmdrep=new RouterCommand(RouterCommand.CommandType.PUSH_ACK);
    outgoing.writeObject(cmdrep);
  outgoing.flush();
break;
case PULL:
logger.info("String_Node_Str");
String reply=null;
if (cmd.lowts > 0 && cmd.hights > 0 && cmd.sourcepath != null && cmd.units != null) reply=pullFromNode(cmd.sourcepath,cmd.units,cmd.lowts,cmd.hights);
cmdrep=new RouterCommand(RouterCommand.CommandType.PULL_ACK);
cmdrep.data=reply;
outgoing.writeObject(cmdrep);
outgoing.flush();
break;
case ADD_NODE:
logger.info("String_Node_Str");
if (cmd.sourcepath != null) addNodeEvent(cmd.sourcepath);
cmdrep=new RouterCommand(RouterCommand.CommandType.ADD_NODE_ACK);
outgoing.writeObject(cmdrep);
outgoing.flush();
break;
case REMOVE_NODE:
if (cmd.sourcepath != null) removeNodeEvent(cmd.sourcepath);
cmdrep=new RouterCommand(RouterCommand.CommandType.REMOVE_NODE_ACK);
outgoing.writeObject(cmdrep);
outgoing.flush();
break;
case ADD_LINK:
logger.info("String_Node_Str");
if (cmd.sourcepath != null && cmd.destpath != null) createLink(cmd.sourcepath,cmd.destpath);
cmdrep=new RouterCommand(RouterCommand.CommandType.ADD_LINK_ACK);
outgoing.writeObject(cmdrep);
outgoing.flush();
break;
case REMOVE_LINK:
if (cmd.sourcepath != null && cmd.destpath != null) removeLink(cmd.sourcepath,cmd.destpath);
cmdrep=new RouterCommand(RouterCommand.CommandType.REMOVE_LINK_ACK);
outgoing.writeObject(cmdrep);
outgoing.flush();
break;
case CREATE_AGG_PNT:
if (cmd.sourcepath != null && cmd.units != null) {
setUnitAndTypeAtPath(cmd.sourcepath,cmd.units,ProcType.AGGREGATE,cmd.state);
cmdrep=new RouterCommand(RouterCommand.CommandType.CREATE_AGG_PNT_ACK);
outgoing.writeObject(cmdrep);
outgoing.flush();
}
break;
case STOP_ROUTER:
keepRunning=false;
break;
}
incoming.close();
outgoing.close();
}
}
 catch (Exception e) {
logger.log(Level.SEVERE,"String_Node_Str",e);
System.exit(1);
}
return;
}