Program: 49940
Project: 49940
Buggy source:
public void join(String host) throws Exception {
  Socket socket=null;
  ObjectOutputStream out=null;
  ObjectInputStream in=null;
  while (socket == null) {
    try {
      socket=new Socket(host,27335);
    }
 catch (    Exception e) {
      if (NewGameMenu.cancelled)       return;
    }
  }
  AnimatedLabel.finished=true;
  out=new ObjectOutputStream(socket.getOutputStream());
  in=new ObjectInputStream(socket.getInputStream());
  Object fromServer=null;
  Object fromUser;
  Game g=(Game)in.readObject();
  PlayNetGame png=new PlayNetGame(g,false,true);
  PlayGame.resetTimers();
  Driver.getInstance().setPanel(png);
  try {
    while (PlayNetGame.running) {
      while (g.isBlackMove() == false && PlayNetGame.running) {
        fromServer=in.readObject();
        FakeMove toMove=(FakeMove)fromServer;
        if (toMove.originCol == -1) {
          int surrender=JOptionPane.showConfirmDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION);
          if (surrender == 0) {
            out.writeObject(new FakeMove(-2,-2,-2,-2,-2,null));
            Result r=new Result(Result.DRAW);
            r.setText("String_Node_Str");
            g.getLastMove().setResult(r);
            PlayGame.endOfGame(r);
            throw new Exception();
          }
 else {
            out.writeObject(new FakeMove(-3,-3,-3,-3,-3,null));
            continue;
          }
        }
 else {
          g.playMove(g.fakeToRealMove((FakeMove)fromServer));
          if (g.getLastMove().getResult() != null)           continue;
        }
      }
      while (g.isBlackMove() == true && PlayNetGame.running) {
        while (PlayNetGame.netMove == null && !png.drawRequested && PlayNetGame.running)         Thread.sleep(0);
        if (png.drawRequested) {
          fromServer=in.readObject();
          FakeMove toMove=(FakeMove)fromServer;
          if (toMove.originCol == -2) {
            Result r=new Result(Result.DRAW);
            r.setText("String_Node_Str");
            g.getLastMove().setResult(r);
            PlayGame.endOfGame(r);
            png.drawRequested=false;
            throw new Exception();
          }
 else           if (toMove.originCol == -3) {
            JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE);
            png.drawRequested=false;
            continue;
          }
        }
        fromUser=PlayNetGame.netMove;
        PlayNetGame.netMove=null;
        if (fromUser != null && ((FakeMove)fromUser).originCol == -1)         png.drawRequested=true;
        out.writeObject(fromUser);
        out.flush();
        if (g.getLastMove().getResult() != null)         break;
      }
    }
  }
 catch (  SocketException e) {
    e.printStackTrace();
    JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
    Driver.getInstance().fileMenu.setVisible(true);
    Driver.getInstance().gameOptions.setVisible(false);
    Driver.getInstance().revertPanel();
    return;
  }
catch (  EOFException e) {
    e.printStackTrace();
    if (g.getHistory().size() != 0 && g.getHistory().get(g.getHistory().size() - 1).getResult() != null)     return;
    if (!PlayNetGame.running)     return;
    JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
    g.getBlackTimer().stop();
    g.getWhiteTimer().stop();
    Driver.getInstance().fileMenu.setVisible(true);
    Driver.getInstance().gameOptions.setVisible(false);
    Driver.getInstance().revertPanel();
    return;
  }
catch (  Exception e) {
    e.printStackTrace();
  }
  out.close();
  in.close();
  socket.close();
}

Fixed version (ground truth):
/** 
 * Method to allow the client to join the host
 * @param host the computer being joined to
 * @throws Exception throws an end of file or socket exception
 */
public void join(String host) throws Exception {
  Socket socket=null;
  ObjectOutputStream out=null;
  ObjectInputStream in=null;
  while (socket == null) {
    try {
      socket=new Socket(host,27335);
    }
 catch (    Exception e) {
      if (NewGameMenu.cancelled)       return;
    }
  }
  AnimatedLabel.finished=true;
  out=new ObjectOutputStream(socket.getOutputStream());
  in=new ObjectInputStream(socket.getInputStream());
  Object fromServer=null;
  Object fromUser;
  Game g=(Game)in.readObject();
  PlayNetGame png=new PlayNetGame(g,false,true);
  PlayGame.resetTimers();
  Driver.getInstance().setPanel(png);
  try {
    while (PlayNetGame.running) {
      while (g.isBlackMove() == false && PlayNetGame.running) {
        fromServer=in.readObject();
        FakeMove toMove=(FakeMove)fromServer;
        if (toMove.originCol == -1) {
          int surrender=JOptionPane.showConfirmDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION);
          if (surrender == 0) {
            out.writeObject(new FakeMove(-2,-2,-2,-2,-2,null));
            Result r=new Result(Result.DRAW);
            r.setText("String_Node_Str");
            g.getLastMove().setResult(r);
            PlayGame.endOfGame(r);
            throw new Exception();
          }
 else {
            out.writeObject(new FakeMove(-3,-3,-3,-3,-3,null));
            continue;
          }
        }
 else {
          g.playMove(g.fakeToRealMove((FakeMove)fromServer));
          if (g.getLastMove().getResult() != null)           continue;
        }
      }
      while (g.isBlackMove() == true && PlayNetGame.running) {
        while (PlayNetGame.netMove == null && !png.drawRequested && PlayNetGame.running)         Thread.sleep(0);
        if (png.drawRequested) {
          fromServer=in.readObject();
          FakeMove toMove=(FakeMove)fromServer;
          if (toMove.originCol == -2) {
            Result r=new Result(Result.DRAW);
            r.setText("String_Node_Str");
            g.getLastMove().setResult(r);
            PlayGame.endOfGame(r);
            png.drawRequested=false;
            throw new Exception();
          }
 else           if (toMove.originCol == -3) {
            JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE);
            png.drawRequested=false;
            continue;
          }
        }
        fromUser=PlayNetGame.netMove;
        PlayNetGame.netMove=null;
        if (fromUser != null && ((FakeMove)fromUser).originCol == -1)         png.drawRequested=true;
        out.writeObject(fromUser);
        out.flush();
        if (g.getLastMove().getResult() != null)         break;
      }
    }
  }
 catch (  SocketException e) {
    e.printStackTrace();
    JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
    Driver.getInstance().fileMenu.setVisible(true);
    Driver.getInstance().gameOptions.setVisible(false);
    Driver.getInstance().revertPanel();
    return;
  }
catch (  EOFException e) {
    e.printStackTrace();
    if (g.getHistory().size() != 0 && g.getHistory().get(g.getHistory().size() - 1).getResult() != null)     return;
    if (!PlayNetGame.running)     return;
    JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
    g.getBlackTimer().stop();
    g.getWhiteTimer().stop();
    Driver.getInstance().fileMenu.setVisible(true);
    Driver.getInstance().gameOptions.setVisible(false);
    Driver.getInstance().revertPanel();
    return;
  }
catch (  Exception e) {
    e.printStackTrace();
  }
  out.close();
  in.close();
  socket.close();
}