Program: 153276
Project: 153276
Buggy source:
public void run(){
  boolean connected=true;
  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());
  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;
  }
  String hostname=ReconnectCache.get(clientInfo.getUsername());
  int portnum=ReconnectCache.getPort(hostname,defaultPort);
  hostname=ReconnectCache.getHost(hostname,"String_Node_Str");
  boolean firstConnection=true;
  while (connected && !killed()) {
    String redirectLocal=getRedirect();
    setRedirect(null);
    if (redirectLocal != null) {
      String[] split=redirectLocal.split("String_Node_Str");
      if (split.length != 2) {
        printLogMessage("String_Node_Str");
        connected=false;
      }
 else {
        hostname=split[0];
        try {
          portnum=Integer.parseInt(split[1]);
        }
 catch (        NumberFormatException nfe) {
          printLogMessage("String_Node_Str");
          connected=false;
        }
      }
    }
    printLogMessage("String_Node_Str" + hostname + "String_Node_Str"+ portnum);
    Socket serverBasicSocket=LocalSocket.openSocket(hostname,portnum,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;
    }
    kickMessage=Packet01Login.serverLogin(serverSocket.in,serverSocket.out,this,this);
    if (kickMessage != null) {
      printLogMessage(kickMessage);
      PacketFFKick.kick(clientSocket.out,this,this,kickMessage);
      connected=false;
    }
    if (connected) {
      ReconnectCache.store(clientInfo.getUsername(),hostname,portnum);
      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 {
        clientInfo.setPlayerEntityId(serverLoginPacket.getVersion());
        if (firstConnection) {
          firstConnection=false;
          Packet01Login clientLoginPacket=new Packet01Login(clientSocket.out,this,this);
          if (!forward) {
            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 (forward) {
            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;
  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());
  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;
  }
  String hostname=ReconnectCache.get(clientInfo.getUsername());
  int portnum=ReconnectCache.getPort(hostname,defaultPort);
  hostname=ReconnectCache.getHost(hostname,"String_Node_Str");
  boolean firstConnection=true;
  while (connected && !killed()) {
    String redirectLocal=getRedirect();
    setRedirect(null);
    if (redirectLocal != null) {
      String[] split=redirectLocal.split("String_Node_Str");
      if (split.length != 2) {
        printLogMessage("String_Node_Str");
        connected=false;
      }
 else {
        hostname=split[0];
        try {
          portnum=Integer.parseInt(split[1]);
        }
 catch (        NumberFormatException nfe) {
          printLogMessage("String_Node_Str");
          connected=false;
        }
      }
    }
    printLogMessage("String_Node_Str" + hostname + "String_Node_Str"+ portnum);
    Socket serverBasicSocket=LocalSocket.openSocket(hostname,portnum,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;
    }
    kickMessage=Packet01Login.serverLogin(serverSocket.in,serverSocket.out,this,this);
    if (kickMessage != null) {
      printLogMessage(kickMessage);
      PacketFFKick.kick(clientSocket.out,this,this,kickMessage);
      connected=false;
    }
    if (connected) {
      ReconnectCache.store(clientInfo.getUsername(),hostname,portnum);
      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 (!forward) {
            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 (forward) {
            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);
}