Program: 178619
Project: 178619
Buggy source:
public void run(){
  LocalSocket clientLocalSocket=new LocalSocket(clientSocket,this,Globals.getMaxWorldHeight());
  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 reconnectUsername=connectionInfo.getUsername();
  String hostname=defaultHostname;
  String[] split=connectionInfo.getUsernameRaw().split("String_Node_Str");
  if (split.length >= 2) {
    split=split[1].split("String_Node_Str");
    reconnectUsername=connectionInfo.getUsername() + "String_Node_Str" + split[0];
    String cached=ReconnectCache.get(reconnectUsername);
    hostname=hostnameMap == null ? null : hostnameMap.getString(split[0],"String_Node_Str");
    if (cached.length() > 0) {
      hostname=cached;
      this.printLogMessage("String_Node_Str" + hostname);
    }
 else     if (hostname == null || hostname.equals("String_Node_Str")) {
      hostname=defaultHostname;
    }
 else {
      this.printLogMessage("String_Node_Str" + split[0] + "String_Node_Str"+ hostname);
    }
  }
 else {
    this.printLogMessage("String_Node_Str");
    hostname=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(reconnectUsername);
      this.sendKickMessageAndClose(clientLocalSocket,"String_Node_Str");
      return;
    }
    LocalSocket serverLocalSocket=new LocalSocket(serverSocket,this,Globals.getMaxWorldHeight());
    if (!serverLocalSocket.success) {
      printLogMessage("String_Node_Str");
      ReconnectCache.remove(reconnectUsername);
      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(reconnectUsername);
      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,"String_Node_Str");
      Packet09Respawn dimensionPacket=new Packet09Respawn(connectionInfo.loginDimension,connectionInfo.loginUnknownRespawn,connectionInfo.loginCreative,connectionInfo.loginHeight,connectionInfo.loginSeed,connectionInfo.levelType);
      try {
        clientLocalSocket.pout.sendPacket(otherDimensionPacket);
        clientLocalSocket.pout.sendPacket(dimensionPacket);
      }
 catch (      IOException e) {
        printLogMessage("String_Node_Str");
        kill();
      }
    }
    firstConnection=false;
    connectionInfo.redirect=false;
    ReconnectCache.store(reconnectUsername,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,Globals.getMaxWorldHeight());
  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 reconnectUsername=connectionInfo.getUsername();
  String hostname=defaultHostname;
  String[] split=connectionInfo.getUsernameRaw().split("String_Node_Str");
  if (split.length >= 2) {
    split=split[1].split("String_Node_Str");
    reconnectUsername=connectionInfo.getUsername() + "String_Node_Str" + split[0];
    String cached=ReconnectCache.get(reconnectUsername);
    hostname=hostnameMap == null ? null : hostnameMap.getString(split[0],"String_Node_Str");
    if (cached.length() > 0) {
      hostname=cached;
      this.printLogMessage("String_Node_Str" + hostname);
    }
 else     if (hostname == null || hostname.equals("String_Node_Str")) {
      hostname=defaultHostname;
    }
 else {
      this.printLogMessage("String_Node_Str" + split[0] + "String_Node_Str"+ hostname);
    }
  }
 else {
    this.printLogMessage("String_Node_Str");
    hostname=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(reconnectUsername);
      this.sendKickMessageAndClose(clientLocalSocket,"String_Node_Str");
      return;
    }
    LocalSocket serverLocalSocket=new LocalSocket(serverSocket,this,Globals.getMaxWorldHeight());
    if (!serverLocalSocket.success) {
      printLogMessage("String_Node_Str");
      ReconnectCache.remove(reconnectUsername);
      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(reconnectUsername);
      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)Globals.getMaxWorldHeight(),"String_Node_Str");
      Packet09Respawn dimensionPacket=new Packet09Respawn(connectionInfo.loginDimension,connectionInfo.loginUnknownRespawn,connectionInfo.loginCreative,connectionInfo.loginHeight,connectionInfo.levelType);
      try {
        clientLocalSocket.pout.sendPacket(otherDimensionPacket);
        clientLocalSocket.pout.sendPacket(dimensionPacket);
      }
 catch (      IOException e) {
        printLogMessage("String_Node_Str");
        kill();
      }
    }
    firstConnection=false;
    connectionInfo.redirect=false;
    ReconnectCache.store(reconnectUsername,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");
  }
}