Program: 153245
Project: 153245
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=null;
  ;
  if (Globals.localCache() || Globals.bridgingConnection()) {
    Packet02Handshake initialHandshake=new Packet02Handshake(clientSocket.in,this,this);
    if (initialHandshake.packetId == null || initialHandshake.read(clientSocket.in,this,this,true,null) == null) {
      kickMessage="String_Node_Str";
    }
 else {
      kickMessage=null;
    }
    clientInfo.setUsername(initialHandshake.getUsername());
  }
 else {
    kickMessage=Packet01Login.processLogin(clientSocket.in,clientSocket.out,this,this,Globals.isAuth(),clientInfo);
  }
  if (kickMessage != null) {
    printLogMessage(kickMessage);
    PacketFFKick.kickAndClose(clientSocket,this,this,kickMessage);
    connected=false;
    return;
  }
  if (clientInfo.getUsername() == null || BanList.banned(clientInfo.getUsername())) {
    if (clientInfo.getUsername() != null) {
      printLogMessage(clientInfo.getUsername() + "String_Node_Str");
    }
 else {
      printLogMessage("String_Node_Str");
    }
    PacketFFKick.kickAndClose(clientSocket,this,this,"String_Node_Str");
    connected=false;
    return;
  }
  if (connected && 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(),clientInfo.getForward());
    Integer nextPortnum=RedirectManager.getNextPort(listenHostname,clientInfo.getHostname(),clientInfo.getForward());
    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);
      if (firstConnection) {
        ReconnectCache.remove(clientInfo.getUsername());
      }
      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);
      if (firstConnection) {
        ReconnectCache.remove(clientInfo.getUsername());
      }
      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(),clientInfo.getForward());
    if (proxyLogin == null) {
      printLogMessage("String_Node_Str");
      PacketFFKick.kickAndClose(clientSocket,this,this,"String_Node_Str");
      if (firstConnection) {
        ReconnectCache.remove(clientInfo.getUsername());
      }
      return;
    }
    if (!Globals.localCache() && !Globals.bridgingConnection()) {
      kickMessage=Packet01Login.serverLogin(serverSocket.in,serverSocket.out,this,this,proxyLogin,clientInfo);
    }
 else {
      kickMessage=Packet01Login.bridgingLogin(clientSocket.in,clientSocket.out,serverSocket.in,serverSocket.out,this,this,proxyLogin,clientInfo);
    }
    if (kickMessage != null) {
      printLogMessage(kickMessage);
      PacketFFKick.kick(clientSocket.out,this,this,kickMessage);
      connected=false;
      if (firstConnection) {
        ReconnectCache.remove(clientInfo.getUsername());
      }
    }
    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());
          }
          if (Globals.getSeed() != null) {
            clientLoginPacket.setMapSeed(Globals.getSeed());
          }
 else {
            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");
            }
          }
          if (Main.craftGUI != null) {
            Main.craftGUI.safeSetStatus("String_Node_Str" + clientInfo.getUsername() + "String_Node_Str"+ clientInfo.getIP()+ "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();
synchronized (hashThreadSyncObject) {
                  if (hashThreads != null) {
                    for (                    HashThread h : hashThreads) {
                      h.interrupt();
                    }
                  }
                }
              }
            }
            connected=getRedirect() != null;
          }
        }
      }
    }
    printLogMessage("String_Node_Str");
    LocalSocket.closeSocket(serverSocket.socket,this);
synchronized (hashThreadSyncObject) {
      hashThreads=null;
    }
    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);
  if (Globals.localCache()) {
    HashCache.pruneCache();
  }
}

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=null;
  ;
  if (Globals.localCache() || Globals.bridgingConnection()) {
    Packet02Handshake initialHandshake=new Packet02Handshake(clientSocket.in,this,this);
    if (initialHandshake.packetId == null || initialHandshake.read(clientSocket.in,this,this,true,null) == null) {
      kickMessage="String_Node_Str";
    }
 else {
      kickMessage=null;
    }
    clientInfo.setUsername(initialHandshake.getUsername());
  }
 else {
    kickMessage=Packet01Login.processLogin(clientSocket.in,clientSocket.out,this,this,Globals.isAuth(),clientInfo);
  }
  if (kickMessage != null) {
    printLogMessage(kickMessage);
    PacketFFKick.kickAndClose(clientSocket,this,this,kickMessage);
    connected=false;
    return;
  }
  if (clientInfo.getUsername() == null || BanList.banned(clientInfo.getUsername())) {
    if (clientInfo.getUsername() != null) {
      printLogMessage(clientInfo.getUsername() + "String_Node_Str");
    }
 else {
      printLogMessage("String_Node_Str");
    }
    PacketFFKick.kickAndClose(clientSocket,this,this,"String_Node_Str");
    connected=false;
    return;
  }
  if (connected && 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(),clientInfo.getForward());
    Integer nextPortnum=RedirectManager.getNextPort(listenHostname,clientInfo.getHostname(),clientInfo.getForward());
    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);
      if (firstConnection) {
        ReconnectCache.remove(clientInfo.getUsername());
      }
      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);
      if (firstConnection) {
        ReconnectCache.remove(clientInfo.getUsername());
      }
      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(),clientInfo.getForward());
    if (proxyLogin == null) {
      printLogMessage("String_Node_Str");
      PacketFFKick.kickAndClose(clientSocket,this,this,"String_Node_Str");
      if (firstConnection) {
        ReconnectCache.remove(clientInfo.getUsername());
      }
      return;
    }
    if (!Globals.localCache() && !Globals.bridgingConnection()) {
      kickMessage=Packet01Login.serverLogin(serverSocket.in,serverSocket.out,this,this,proxyLogin,clientInfo);
    }
 else {
      kickMessage=Packet01Login.bridgingLogin(clientSocket.in,clientSocket.out,serverSocket.in,serverSocket.out,this,this,proxyLogin,clientInfo);
    }
    if (kickMessage != null) {
      printLogMessage(kickMessage);
      PacketFFKick.kick(clientSocket.out,this,this,kickMessage);
      connected=false;
      if (firstConnection) {
        ReconnectCache.remove(clientInfo.getUsername());
      }
    }
    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());
          }
          if (Globals.getSeed() != null) {
            clientLoginPacket.setMapSeed(Globals.getSeed());
          }
 else {
            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");
            }
          }
          if (Main.craftGUI != null) {
            Main.craftGUI.safeSetStatus("String_Node_Str" + clientInfo.getUsername() + "String_Node_Str"+ clientInfo.getIP()+ "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();
synchronized (hashThreadSyncObject) {
                  if (hashThreads != null) {
                    for (                    HashThread h : hashThreads) {
                      h.interrupt();
                    }
                  }
                }
              }
            }
            connected=getRedirect() != null;
          }
        }
      }
    }
    printLogMessage("String_Node_Str");
    LocalSocket.closeSocket(serverSocket.socket,this);
synchronized (hashThreadSyncObject) {
      hashThreads=null;
    }
    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);
  if (Globals.localCache()) {
    HashCache.pruneCache();
  }
  for (  KillableThread hashThread : hashThreads) {
    if (hashThread != null) {
      hashThread.interrupt();
    }
  }
  for (  KillableThread hashThread : hashThreads) {
    if (hashThread != null) {
      try {
        hashThread.join();
      }
 catch (      InterruptedException e) {
      }
    }
  }
}