Program: 153270
Project: 153270
Buggy source:
public void run(){
  boolean connected=true;
  clientInfo.setForward(false);
  clientInfo.setHostname(null);
  LocalSocket clientSocket=new LocalSocket(socketToClient,this);
  if (!clientSocket.success) {
    printLogMessage("String_Node_Str");
    return;
  }
  String kickMessage=Packet01Login.processLogin(clientSocket.in,clientSocket.out,this,this,Globals.isAuth(),clientInfo);
  if (kickMessage != null) {
    printLogMessage(kickMessage);
    PacketFFKick.kick(clientSocket.out,this,this,kickMessage);
    connected=false;
  }
  if (BanList.banned(clientInfo.getUsername())) {
    printLogMessage(clientInfo.getUsername() + "String_Node_Str");
    PacketFFKick.kick(clientSocket.out,this,this,"String_Node_Str");
    connected=false;
  }
  clientInfo.setHostname(ReconnectCache.get(clientInfo.getUsername()));
  if (clientInfo.getHostname() == null || clientInfo.getHostname().equals("String_Node_Str")) {
    clientInfo.setHostname(defaultHostname);
  }
  boolean firstConnection=true;
  while (connected && !killed()) {
    String redirectLocal=getRedirect();
    setRedirect(null);
    if (redirectLocal != null) {
      clientInfo.setHostname(redirectLocal);
    }
    printLogMessage("String_Node_Str" + clientInfo.getHostname());
    String nextHostname=RedirectManager.getNextHostname(listenHostname,clientInfo.getHostname());
    Integer nextPortnum=RedirectManager.getNextPort(listenHostname,clientInfo.getHostname());
    if (nextHostname == null || nextPortnum == null) {
      printLogMessage("String_Node_Str" + clientInfo.getHostname());
      PacketFFKick.kick(clientSocket.out,this,this,"String_Node_Str" + clientInfo.getHostname());
      LocalSocket.closeSocket(clientSocket.socket,this);
      return;
    }
    Socket serverBasicSocket=LocalSocket.openSocket(nextHostname,nextPortnum,this);
    if (serverBasicSocket == null) {
      printLogMessage("String_Node_Str");
      PacketFFKick.kick(clientSocket.out,this,this,"String_Node_Str");
      LocalSocket.closeSocket(clientSocket.socket,this);
      return;
    }
    LocalSocket serverSocket=new LocalSocket(serverBasicSocket,this);
    if (!serverSocket.success) {
      printLogMessage("String_Node_Str");
      PacketFFKick.kickAndClose(clientSocket,this,this,"String_Node_Str");
      return;
    }
    Boolean proxyLogin=RedirectManager.isNextProxy(listenHostname,clientInfo.getHostname());
    if (proxyLogin == null) {
      printLogMessage("String_Node_Str");
      PacketFFKick.kickAndClose(clientSocket,this,this,"String_Node_Str");
      return;
    }
    kickMessage=Packet01Login.serverLogin(serverSocket.in,serverSocket.out,this,this,proxyLogin,clientInfo);
    if (kickMessage != null) {
      printLogMessage(kickMessage);
      PacketFFKick.kick(clientSocket.out,this,this,kickMessage);
      connected=false;
    }
    if (connected) {
      Packet01Login serverLoginPacket=new Packet01Login(serverSocket.in,this,this);
      if (serverLoginPacket.packetId == null || serverLoginPacket.read(serverSocket.in,this,this,true,null) == null) {
        printLogMessage("String_Node_Str");
        connected=false;
      }
 else {
        if (serverLoginPacket.packetId == 0x01) {
          clientInfo.setPlayerEntityId(serverLoginPacket.getVersion());
        }
 else         if (serverLoginPacket.packetId == (byte)0xFF) {
          PacketFFKick.kickAndClose(clientSocket,this,this,((UnitString)serverLoginPacket.fields[0]).getValue());
          return;
        }
 else {
          PacketFFKick.kickAndClose(clientSocket,this,this,"String_Node_Str");
          return;
        }
        if (firstConnection) {
          firstConnection=false;
          Packet01Login clientLoginPacket=new Packet01Login(clientSocket.out,this,this);
          if (!clientInfo.getForward()) {
            clientLoginPacket.setVersion(Globals.getDefaultPlayerId());
          }
 else {
            clientLoginPacket.setVersion(serverLoginPacket.getVersion());
          }
          if (Globals.getDimension() == null) {
            if (Globals.isVerbose()) {
              printLogMessage("String_Node_Str" + serverLoginPacket.getDimension());
            }
            clientLoginPacket.setDimension(serverLoginPacket.getDimension());
          }
 else {
            if (Globals.isVerbose()) {
              printLogMessage("String_Node_Str" + Globals.getDimension());
            }
            clientLoginPacket.setDimension(Globals.getDimension());
          }
          clientLoginPacket.setMapSeed(serverLoginPacket.getMapSeed());
          clientLoginPacket.setUsername(serverLoginPacket.getUsername());
          if (clientLoginPacket.packetId == null || clientLoginPacket.write(clientSocket.out,this,this,true) == null) {
            printLogMessage("String_Node_Str");
            connected=false;
          }
        }
 else {
          short holdingLocal=getHolding();
          if (holdingLocal != 0) {
            if (!Globals.isQuiet()) {
              printLogMessage("String_Node_Str" + holding);
            }
            Packet10HoldingChange holdingChange=new Packet10HoldingChange(serverSocket.out,this,this);
            holdingChange.setSlot(holding);
            if (holdingChange.packetId == null || holdingChange.write(serverSocket.out,this,this,false) == null) {
              printLogMessage("String_Node_Str");
              connected=false;
            }
          }
        }
        if (connected) {
          if (!Globals.isQuiet()) {
            if (clientInfo.getForward()) {
              printLogMessage("String_Node_Str");
            }
 else {
              printLogMessage("String_Node_Str");
            }
          }
          ReconnectCache.store(clientInfo.getUsername(),clientInfo.getHostname());
          if (clientInfo.getForward()) {
            serverToClient=new DataStreamBridge(serverSocket.in,clientSocket.out,this);
            clientToServer=new DataStreamBridge(clientSocket.in,serverSocket.out,this);
            connected=false;
          }
 else {
            serverToClient=new DataStreamDownLinkBridge(serverSocket.in,clientSocket.out,this);
            clientToServer=new DataStreamUpLinkBridge(clientSocket.in,serverSocket.out,this);
          }
          boolean localEnabled;
synchronized (enabledSync) {
            localEnabled=enabled;
            if (enabled) {
              serverToClient.start();
              clientToServer.start();
            }
          }
          if (localEnabled) {
            while ((clientToServer.isAlive() || serverToClient.isAlive())) {
              try {
                clientToServer.join(500);
                serverToClient.join(500);
              }
 catch (              InterruptedException ie) {
                kill();
              }
              if (killed() || (!(clientToServer.isAlive() && serverToClient.isAlive()))) {
                clientToServer.interrupt();
                serverToClient.interrupt();
              }
            }
            connected=getRedirect() != null;
          }
        }
      }
    }
    printLogMessage("String_Node_Str");
    LocalSocket.closeSocket(serverSocket.socket,this);
    if (connected) {
      if (Globals.isVerbose()) {
        printLogMessage("String_Node_Str");
      }
      revive();
    }
  }
  if (!getKickMessageSent()) {
    PacketFFKick.kick(clientSocket.out,this,this,"String_Node_Str");
  }
  printLogMessage("String_Node_Str");
  LocalSocket.closeSocket(clientSocket.socket,this);
}

Fixed version (ground truth):
public void run(){
  boolean connected=true;
  clientInfo.setForward(false);
  clientInfo.setHostname(null);
  LocalSocket clientSocket=new LocalSocket(socketToClient,this);
  if (!clientSocket.success) {
    printLogMessage("String_Node_Str");
    return;
  }
  String kickMessage=Packet01Login.processLogin(clientSocket.in,clientSocket.out,this,this,Globals.isAuth(),clientInfo);
  if (kickMessage != null) {
    printLogMessage(kickMessage);
    PacketFFKick.kick(clientSocket.out,this,this,kickMessage);
    connected=false;
  }
  if (BanList.banned(clientInfo.getUsername())) {
    printLogMessage(clientInfo.getUsername() + "String_Node_Str");
    PacketFFKick.kick(clientSocket.out,this,this,"String_Node_Str");
    connected=false;
  }
  if (clientInfo.getHostname() == null) {
    clientInfo.setHostname(ReconnectCache.get(clientInfo.getUsername()));
    if (clientInfo.getHostname() == null || clientInfo.getHostname().equals("String_Node_Str")) {
      clientInfo.setHostname(defaultHostname);
    }
  }
  boolean firstConnection=true;
  while (connected && !killed()) {
    String redirectLocal=getRedirect();
    setRedirect(null);
    if (redirectLocal != null) {
      clientInfo.setHostname(redirectLocal);
    }
    printLogMessage("String_Node_Str" + clientInfo.getHostname());
    String nextHostname=RedirectManager.getNextHostname(listenHostname,clientInfo.getHostname());
    Integer nextPortnum=RedirectManager.getNextPort(listenHostname,clientInfo.getHostname());
    if (nextHostname == null || nextPortnum == null) {
      printLogMessage("String_Node_Str" + clientInfo.getHostname());
      PacketFFKick.kick(clientSocket.out,this,this,"String_Node_Str" + clientInfo.getHostname());
      LocalSocket.closeSocket(clientSocket.socket,this);
      return;
    }
    Socket serverBasicSocket=LocalSocket.openSocket(nextHostname,nextPortnum,this);
    if (serverBasicSocket == null) {
      printLogMessage("String_Node_Str");
      PacketFFKick.kick(clientSocket.out,this,this,"String_Node_Str");
      LocalSocket.closeSocket(clientSocket.socket,this);
      return;
    }
    LocalSocket serverSocket=new LocalSocket(serverBasicSocket,this);
    if (!serverSocket.success) {
      printLogMessage("String_Node_Str");
      PacketFFKick.kickAndClose(clientSocket,this,this,"String_Node_Str");
      return;
    }
    Boolean proxyLogin=RedirectManager.isNextProxy(listenHostname,clientInfo.getHostname());
    if (proxyLogin == null) {
      printLogMessage("String_Node_Str");
      PacketFFKick.kickAndClose(clientSocket,this,this,"String_Node_Str");
      return;
    }
    kickMessage=Packet01Login.serverLogin(serverSocket.in,serverSocket.out,this,this,proxyLogin,clientInfo);
    if (kickMessage != null) {
      printLogMessage(kickMessage);
      PacketFFKick.kick(clientSocket.out,this,this,kickMessage);
      connected=false;
    }
    if (connected) {
      Packet01Login serverLoginPacket=new Packet01Login(serverSocket.in,this,this);
      if (serverLoginPacket.packetId == null || serverLoginPacket.read(serverSocket.in,this,this,true,null) == null) {
        printLogMessage("String_Node_Str");
        connected=false;
      }
 else {
        if (serverLoginPacket.packetId == 0x01) {
          clientInfo.setPlayerEntityId(serverLoginPacket.getVersion());
        }
 else         if (serverLoginPacket.packetId == (byte)0xFF) {
          PacketFFKick.kickAndClose(clientSocket,this,this,((UnitString)serverLoginPacket.fields[0]).getValue());
          return;
        }
 else {
          PacketFFKick.kickAndClose(clientSocket,this,this,"String_Node_Str");
          return;
        }
        if (firstConnection) {
          firstConnection=false;
          Packet01Login clientLoginPacket=new Packet01Login(clientSocket.out,this,this);
          if (!clientInfo.getForward()) {
            clientLoginPacket.setVersion(Globals.getDefaultPlayerId());
          }
 else {
            clientLoginPacket.setVersion(serverLoginPacket.getVersion());
          }
          if (Globals.getDimension() == null) {
            if (Globals.isVerbose()) {
              printLogMessage("String_Node_Str" + serverLoginPacket.getDimension());
            }
            clientLoginPacket.setDimension(serverLoginPacket.getDimension());
          }
 else {
            if (Globals.isVerbose()) {
              printLogMessage("String_Node_Str" + Globals.getDimension());
            }
            clientLoginPacket.setDimension(Globals.getDimension());
          }
          clientLoginPacket.setMapSeed(serverLoginPacket.getMapSeed());
          clientLoginPacket.setUsername(serverLoginPacket.getUsername());
          if (clientLoginPacket.packetId == null || clientLoginPacket.write(clientSocket.out,this,this,true) == null) {
            printLogMessage("String_Node_Str");
            connected=false;
          }
        }
 else {
          short holdingLocal=getHolding();
          if (holdingLocal != 0) {
            if (!Globals.isQuiet()) {
              printLogMessage("String_Node_Str" + holding);
            }
            Packet10HoldingChange holdingChange=new Packet10HoldingChange(serverSocket.out,this,this);
            holdingChange.setSlot(holding);
            if (holdingChange.packetId == null || holdingChange.write(serverSocket.out,this,this,false) == null) {
              printLogMessage("String_Node_Str");
              connected=false;
            }
          }
        }
        if (connected) {
          if (!Globals.isQuiet()) {
            if (clientInfo.getForward()) {
              printLogMessage("String_Node_Str");
            }
 else {
              printLogMessage("String_Node_Str");
            }
          }
          ReconnectCache.store(clientInfo.getUsername(),clientInfo.getHostname());
          if (clientInfo.getForward()) {
            serverToClient=new DataStreamBridge(serverSocket.in,clientSocket.out,this);
            clientToServer=new DataStreamBridge(clientSocket.in,serverSocket.out,this);
            connected=false;
          }
 else {
            serverToClient=new DataStreamDownLinkBridge(serverSocket.in,clientSocket.out,this);
            clientToServer=new DataStreamUpLinkBridge(clientSocket.in,serverSocket.out,this);
          }
          boolean localEnabled;
synchronized (enabledSync) {
            localEnabled=enabled;
            if (enabled) {
              serverToClient.start();
              clientToServer.start();
            }
          }
          if (localEnabled) {
            while ((clientToServer.isAlive() || serverToClient.isAlive())) {
              try {
                clientToServer.join(500);
                serverToClient.join(500);
              }
 catch (              InterruptedException ie) {
                kill();
              }
              if (killed() || (!(clientToServer.isAlive() && serverToClient.isAlive()))) {
                clientToServer.interrupt();
                serverToClient.interrupt();
              }
            }
            connected=getRedirect() != null;
          }
        }
      }
    }
    printLogMessage("String_Node_Str");
    LocalSocket.closeSocket(serverSocket.socket,this);
    if (connected) {
      if (Globals.isVerbose()) {
        printLogMessage("String_Node_Str");
      }
      revive();
    }
  }
  if (!getKickMessageSent()) {
    PacketFFKick.kick(clientSocket.out,this,this,"String_Node_Str");
  }
  printLogMessage("String_Node_Str");
  LocalSocket.closeSocket(clientSocket.socket,this);
}