Program: 178635
Project: 178635
Buggy source:
public void run(){
  LocalSocket clientLocalSocket=new LocalSocket(clientSocket,this);
  if (!clientLocalSocket.success) {
    printLogMessage("String_Node_Str");
    return;
  }
  String reply;
  String hostnameForPing=RedirectManager.getNextHostname(listenHostname,defaultHostname);
  Integer portnumForPing=RedirectManager.getNextPort(listenHostname,defaultHostname);
  reply=LoginManager.getUsername(clientLocalSocket,connectionInfo,this,hostnameForPing,portnumForPing);
  if (reply != null) {
    sendKickMessageAndClose(clientLocalSocket,reply);
    clientLocalSocket.closeSocket(this);
    return;
  }
  if (BanList.banned(connectionInfo.getUsername())) {
    String message=BanList.getWhiteList() ? "String_Node_Str" : "String_Node_Str";
    sendKickMessageAndClose(clientLocalSocket,message);
    clientLocalSocket.closeSocket(this);
    return;
  }
  if (!BanList.getWhiteList()) {
    if (BanList.banned(connectionInfo.getIP())) {
      String message="String_Node_Str";
      sendKickMessageAndClose(clientLocalSocket,message);
      clientLocalSocket.closeSocket(this);
      return;
    }
  }
  String cached=ReconnectCache.get(connectionInfo.getUsername());
  String hostname=(cached.length() > 0) ? cached : defaultHostname;
  if (connectionInfo.getHostname() == null) {
    connectionInfo.setHostname(hostname);
  }
  connectionInfo.redirect=true;
  boolean firstConnection=true;
  while (connectionInfo.redirect) {
    String nextHostname=RedirectManager.getNextHostname(listenHostname,connectionInfo.getHostname());
    Integer nextPortnum=RedirectManager.getNextPort(listenHostname,connectionInfo.getHostname());
    Boolean isNextProxy=RedirectManager.isNextProxy(listenHostname,connectionInfo.getHostname());
    String fullHostname=(isNextProxy != null && isNextProxy) ? connectionInfo.getHostname() : null;
    printLogMessage("String_Node_Str" + nextHostname + "String_Node_Str"+ nextPortnum);
    Socket serverSocket=LocalSocket.openSocket(nextHostname,nextPortnum,this);
    if (serverSocket == null) {
      printLogMessage("String_Node_Str");
      ReconnectCache.remove(connectionInfo.getUsername());
      this.sendKickMessageAndClose(clientLocalSocket,"String_Node_Str");
      return;
    }
    LocalSocket serverLocalSocket=new LocalSocket(serverSocket,this);
    if (!serverLocalSocket.success) {
      printLogMessage("String_Node_Str");
      ReconnectCache.remove(connectionInfo.getUsername());
      this.sendKickMessageAndClose(clientLocalSocket,"String_Node_Str");
      serverLocalSocket.closeSocket(this);
      return;
    }
 else {
      printLogMessage("String_Node_Str");
    }
    reply=LoginManager.bridgeLogin(clientLocalSocket,serverLocalSocket,connectionInfo,this,!firstConnection,fullHostname);
    if (reply != null) {
      printLogMessage("String_Node_Str" + reply);
      ReconnectCache.remove(connectionInfo.getUsername());
      sendKickMessageAndClose(clientLocalSocket,reply);
      clientLocalSocket.closeSocket(this);
      serverLocalSocket.closeSocket(this);
      return;
    }
 else {
      printLogMessage("String_Node_Str");
    }
    if (connectionInfo.holding != 0) {
      Packet10Holding holdingPacket=new Packet10Holding(connectionInfo.holding);
      try {
        serverLocalSocket.pout.sendPacket(holdingPacket);
      }
 catch (      IOException e) {
        printLogMessage("String_Node_Str");
        kill();
      }
    }
    if (!firstConnection) {
      byte otherDimension=(byte)((connectionInfo.loginDimension == 0) ? -1 : 0);
      Packet09Respawn otherDimensionPacket=new Packet09Respawn(otherDimension);
      Packet09Respawn dimensionPacket=new Packet09Respawn(connectionInfo.loginDimension);
      try {
        clientLocalSocket.pout.sendPacket(otherDimensionPacket);
        clientLocalSocket.pout.sendPacket(dimensionPacket);
      }
 catch (      IOException e) {
        printLogMessage("String_Node_Str");
        kill();
      }
    }
    firstConnection=false;
    connectionInfo.redirect=false;
    ReconnectCache.store(connectionInfo.getUsername(),connectionInfo.getHostname());
    KillableThread StCBridge=new DownstreamBridge(serverLocalSocket.pin,clientLocalSocket.pout,this,fairnessManager);
    KillableThread CtSBridge=new UpstreamBridge(clientLocalSocket.pin,serverLocalSocket.pout,this,fairnessManager);
    StCBridge.setName("String_Node_Str");
    CtSBridge.setName("String_Node_Str");
    StCBridge.start();
    CtSBridge.start();
    while (StCBridge.isAlive() || CtSBridge.isAlive()) {
      try {
        StCBridge.join(500);
        CtSBridge.join(500);
      }
 catch (      InterruptedException ie) {
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException ie2) {
        }
        this.interrupt();
      }
      if (killed() || (!StCBridge.isAlive())) {
        CtSBridge.interrupt();
      }
      if (killed() || (!CtSBridge.isAlive())) {
        StCBridge.interrupt();
      }
    }
    serverLocalSocket.closeSocket(this);
    printLogMessage("String_Node_Str");
  }
  clientLocalSocket.closeSocket(this);
  printLogMessage("String_Node_Str");
  if (Main.craftGUI != null) {
    Main.craftGUI.safeSetStatus("String_Node_Str");
  }
}

Fixed version (ground truth):
public void run(){
  LocalSocket clientLocalSocket=new LocalSocket(clientSocket,this);
  if (!clientLocalSocket.success) {
    printLogMessage("String_Node_Str");
    return;
  }
  String reply;
  String hostnameForPing=RedirectManager.getNextHostname(listenHostname,defaultHostname);
  Integer portnumForPing=RedirectManager.getNextPort(listenHostname,defaultHostname);
  reply=LoginManager.getUsername(clientLocalSocket,connectionInfo,this,hostnameForPing,portnumForPing);
  if (reply != null) {
    sendKickMessageAndClose(clientLocalSocket,reply);
    clientLocalSocket.closeSocket(this);
    return;
  }
  if (BanList.banned(connectionInfo.getUsername())) {
    String message=BanList.getWhiteList() ? "String_Node_Str" : "String_Node_Str";
    sendKickMessageAndClose(clientLocalSocket,message);
    clientLocalSocket.closeSocket(this);
    return;
  }
  if (!BanList.getWhiteList()) {
    if (BanList.banned(connectionInfo.getIP())) {
      String message="String_Node_Str";
      sendKickMessageAndClose(clientLocalSocket,message);
      clientLocalSocket.closeSocket(this);
      return;
    }
  }
  String cached=ReconnectCache.get(connectionInfo.getUsername());
  String hostname=(cached.length() > 0) ? cached : defaultHostname;
  if (connectionInfo.getHostname() == null) {
    connectionInfo.setHostname(hostname);
  }
  connectionInfo.redirect=true;
  boolean firstConnection=true;
  while (connectionInfo.redirect) {
    String nextHostname=RedirectManager.getNextHostname(listenHostname,connectionInfo.getHostname());
    Integer nextPortnum=RedirectManager.getNextPort(listenHostname,connectionInfo.getHostname());
    Boolean isNextProxy=RedirectManager.isNextProxy(listenHostname,connectionInfo.getHostname());
    String fullHostname=(isNextProxy != null && isNextProxy) ? connectionInfo.getHostname() : null;
    printLogMessage("String_Node_Str" + nextHostname + "String_Node_Str"+ nextPortnum);
    Socket serverSocket=LocalSocket.openSocket(nextHostname,nextPortnum,this);
    if (serverSocket == null) {
      printLogMessage("String_Node_Str");
      ReconnectCache.remove(connectionInfo.getUsername());
      this.sendKickMessageAndClose(clientLocalSocket,"String_Node_Str");
      return;
    }
    LocalSocket serverLocalSocket=new LocalSocket(serverSocket,this);
    if (!serverLocalSocket.success) {
      printLogMessage("String_Node_Str");
      ReconnectCache.remove(connectionInfo.getUsername());
      this.sendKickMessageAndClose(clientLocalSocket,"String_Node_Str");
      serverLocalSocket.closeSocket(this);
      return;
    }
 else {
      printLogMessage("String_Node_Str");
    }
    reply=LoginManager.bridgeLogin(clientLocalSocket,serverLocalSocket,connectionInfo,this,!firstConnection,fullHostname);
    if (reply != null) {
      printLogMessage("String_Node_Str" + reply);
      ReconnectCache.remove(connectionInfo.getUsername());
      sendKickMessageAndClose(clientLocalSocket,reply);
      clientLocalSocket.closeSocket(this);
      serverLocalSocket.closeSocket(this);
      return;
    }
 else {
      printLogMessage("String_Node_Str");
    }
    if (connectionInfo.holding != 0) {
      Packet10Holding holdingPacket=new Packet10Holding(connectionInfo.holding);
      try {
        serverLocalSocket.pout.sendPacket(holdingPacket);
      }
 catch (      IOException e) {
        printLogMessage("String_Node_Str");
        kill();
      }
    }
    if (!firstConnection) {
      byte otherDimension=(byte)((connectionInfo.loginDimension == 0) ? -1 : 0);
      Packet09Respawn otherDimensionPacket=new Packet09Respawn(otherDimension,(byte)2,(byte)0,(short)128,0L);
      Packet09Respawn dimensionPacket=new Packet09Respawn(connectionInfo.loginDimension,connectionInfo.loginUnknownRespawn,connectionInfo.loginCreative,connectionInfo.loginHeight,connectionInfo.loginSeed);
      try {
        clientLocalSocket.pout.sendPacket(otherDimensionPacket);
        clientLocalSocket.pout.sendPacket(dimensionPacket);
      }
 catch (      IOException e) {
        printLogMessage("String_Node_Str");
        kill();
      }
    }
    firstConnection=false;
    connectionInfo.redirect=false;
    ReconnectCache.store(connectionInfo.getUsername(),connectionInfo.getHostname());
    KillableThread StCBridge=new DownstreamBridge(serverLocalSocket.pin,clientLocalSocket.pout,this,fairnessManager);
    KillableThread CtSBridge=new UpstreamBridge(clientLocalSocket.pin,serverLocalSocket.pout,this,fairnessManager);
    StCBridge.setName("String_Node_Str");
    CtSBridge.setName("String_Node_Str");
    StCBridge.start();
    CtSBridge.start();
    while (StCBridge.isAlive() || CtSBridge.isAlive()) {
      try {
        StCBridge.join(500);
        CtSBridge.join(500);
      }
 catch (      InterruptedException ie) {
        try {
          Thread.sleep(200);
        }
 catch (        InterruptedException ie2) {
        }
        this.interrupt();
      }
      if (killed() || (!StCBridge.isAlive())) {
        CtSBridge.interrupt();
      }
      if (killed() || (!CtSBridge.isAlive())) {
        StCBridge.interrupt();
      }
    }
    serverLocalSocket.closeSocket(this);
    printLogMessage("String_Node_Str");
  }
  clientLocalSocket.closeSocket(this);
  printLogMessage("String_Node_Str");
  if (Main.craftGUI != null) {
    Main.craftGUI.safeSetStatus("String_Node_Str");
  }
}