Program: 179536
Project: 179536
Buggy source:
private void processNetworkMessage(NetworkMessage message){
  if (message.getTimeStamp() == 0) {
    System.err.println("String_Node_Str");
  }
  if (message instanceof PlayerRegistrationMessage) {
    PlayerRegistrationMessage regMessage=(PlayerRegistrationMessage)message;
    playerID=ServerVariables.playerNetworkAddressList.size();
    regMessage.playerID=playerID;
    ServerVariables.playerNetworkAddressList.add(socket.getInetAddress());
    ServerVariables.playerThreads.add(this);
    ServerVariables.playerThreadMap.put(playerID,this);
    playerName=regMessage.playerName;
    PlayerRegistrationMessage reply=new PlayerRegistrationMessage(playerID);
    reply.playerName=playerName;
    writeOut(reply);
    registerPlayer(regMessage);
    sendInitialState();
    sendPeerList();
    fireEvent(new NetworkEvent(this,"String_Node_Str"),ConnectionEstablishedListener.class);
  }
 else {
    NetworkMessage msg=(NetworkMessage)message;
switch (msg.getMessageType()) {
case UPDATE_MESSAGE:
      fireEvent(new NetworkEvent(this,msg),UpdateReceivedListener.class);
    break;
case REQUEST_MESSAGE:
  fireEvent(new NetworkEvent(this,msg),RequestReceivedListener.class);
break;
case INITIAL_GAME_STATE_MESSAGE:
break;
case PARTIAL_GAMESTATE_UPDATE_MESSAGE:
break;
case GAMESTATE_UPDATE_MESSAGE:
break;
case GAMESTATE_REQUEST_MESSAGE:
fireEvent(new NetworkEvent(this,msg),GameStateRequestReceivedListener.class);
break;
case TERMINATION_REQUEST_MESSAGE:
fireEvent(new NetworkEvent(this,msg),TerminationRequestReceivedListener.class);
break;
case PEER_LIST_MESSAGE:
break;
case PEER_LIST_REQUEST_MESSAGE:
sendPeerList();
break;
case LATENCY_REQUEST_MESSAGE:
NetworkMessage latMsg=new NetworkMessage("String_Node_Str");
latMsg.setMessageType(NetworkMessage.MessageType.LATENCY_RESPONSE_MESSAGE);
writeOut(latMsg);
break;
case LATENCY_RESPONSE_MESSAGE:
latencyEndTime=System.currentTimeMillis();
if (latencyStartTime < latencyEndTime) {
fireEvent(new NetworkEvent(this,(latencyEndTime - latencyStartTime)),LatencyUpdateListener.class);
}
break;
case DIRECT_COMMUNICATION_MESSAGE:
if (msg instanceof NetworkMessageLarge) {
int targetPlayerId=((NetworkMessageLarge)msg).integers.get(((NetworkMessageLarge)msg).integers.size() - 2);
if (ServerVariables.playerThreadMap.get(targetPlayerId) != null) {
ServerVariables.playerThreadMap.get(targetPlayerId).forwardDirectCommunication(msg);
}
}
 else if (msg instanceof NetworkMessageMedium) {
int targetPlayerId=((NetworkMessageMedium)msg).integers.get(((NetworkMessageMedium)msg).integers.size() - 2);
if (ServerVariables.playerThreadMap.get(targetPlayerId) != null) {
ServerVariables.playerThreadMap.get(targetPlayerId).forwardDirectCommunication(msg);
}
}
 else {
System.err.println("String_Node_Str" + playerID + "String_Node_Str"+ "String_Node_Str");
}
break;
case TIME_REQUEST:
NetworkMessage newMsg=new NetworkMessage("String_Node_Str" + msg.getTimeStamp());
newMsg.setMessageType(NetworkMessage.MessageType.TIME_RESPONSE);
writeOut(newMsg);
break;
default :
fireEvent(new NetworkEvent(this,msg),UnknownMessageTypeReceivedListener.class);
break;
}
}
}

Fixed version (ground truth):
private void processNetworkMessage(NetworkMessage message){
  if (message.getTimeStamp() == 0) {
    System.err.println("String_Node_Str");
  }
  if (message instanceof PlayerRegistrationMessage) {
    PlayerRegistrationMessage regMessage=(PlayerRegistrationMessage)message;
    playerID=ServerVariables.playerNetworkAddressList.size();
    regMessage.playerID=playerID;
    ServerVariables.playerNetworkAddressList.add(socket.getInetAddress());
    ServerVariables.playerThreads.add(this);
    ServerVariables.playerThreadMap.put(playerID,this);
    playerName=regMessage.playerName;
    PlayerRegistrationMessage reply=new PlayerRegistrationMessage(playerID);
    reply.playerName=playerName;
    writeOut(reply);
    registerPlayer(regMessage);
    sendInitialState();
    sendPeerList();
    fireEvent(new NetworkEvent(this,"String_Node_Str"),ConnectionEstablishedListener.class);
  }
 else {
    NetworkMessage msg=(NetworkMessage)message;
switch (msg.getMessageType()) {
case UPDATE_MESSAGE:
      fireEvent(new NetworkEvent(this,msg),UpdateReceivedListener.class);
    break;
case REQUEST_MESSAGE:
  fireEvent(new NetworkEvent(this,msg),RequestReceivedListener.class);
break;
case INITIAL_GAME_STATE_MESSAGE:
break;
case PARTIAL_GAMESTATE_UPDATE_MESSAGE:
break;
case GAMESTATE_UPDATE_MESSAGE:
break;
case GAMESTATE_REQUEST_MESSAGE:
fireEvent(new NetworkEvent(this,msg),GameStateRequestReceivedListener.class);
break;
case TERMINATION_REQUEST_MESSAGE:
fireEvent(new NetworkEvent(this,msg),TerminationRequestReceivedListener.class);
break;
case PEER_LIST_MESSAGE:
break;
case PEER_LIST_REQUEST_MESSAGE:
sendPeerList();
break;
case LATENCY_REQUEST_MESSAGE:
NetworkMessage latMsg=new NetworkMessage("String_Node_Str");
latMsg.setMessageType(NetworkMessage.MessageType.LATENCY_RESPONSE_MESSAGE);
writeOut(latMsg);
break;
case LATENCY_RESPONSE_MESSAGE:
latencyEndTime=System.currentTimeMillis();
if (latencyStartTime < latencyEndTime) {
fireEvent(new NetworkEvent(this,(latencyEndTime - latencyStartTime)),LatencyUpdateListener.class);
}
break;
case DIRECT_COMMUNICATION_MESSAGE:
if (msg instanceof NetworkMessageLarge) {
int targetPlayerId=((NetworkMessageLarge)msg).integers.get(((NetworkMessageLarge)msg).integers.size() - 2);
if (ServerVariables.playerThreadMap.get(targetPlayerId) != null) {
ServerVariables.playerThreadMap.get(targetPlayerId).forwardDirectCommunication(msg);
}
}
 else if (msg instanceof NetworkMessageMedium) {
int targetPlayerId=((NetworkMessageMedium)msg).integers.get(((NetworkMessageMedium)msg).integers.size() - 2);
System.out.println("String_Node_Str" + ((NetworkMessageMedium)msg).integers.get(((NetworkMessageMedium)msg).integers.size() - 1) + "String_Node_Str"+ targetPlayerId);
if (ServerVariables.playerThreadMap.get(targetPlayerId) != null) {
ServerVariables.playerThreadMap.get(targetPlayerId).forwardDirectCommunication(msg);
}
}
 else {
System.err.println("String_Node_Str" + playerID + "String_Node_Str"+ "String_Node_Str");
}
break;
case TIME_REQUEST:
NetworkMessage newMsg=new NetworkMessage("String_Node_Str" + msg.getTimeStamp());
newMsg.setMessageType(NetworkMessage.MessageType.TIME_RESPONSE);
writeOut(newMsg);
break;
default :
fireEvent(new NetworkEvent(this,msg),UnknownMessageTypeReceivedListener.class);
break;
}
}
}