Program: 153246
Project: 153246
Buggy source:
@Override public void run(){
  ServerSocket listener=null;
  try {
    listener=new ServerSocket(port);
    listener.setSoTimeout(1000);
  }
 catch (  BindException be) {
    Logging.log("String_Node_Str");
    Logging.log("String_Node_Str");
    Logging.log("String_Node_Str");
    Logging.log("String_Node_Str");
    Logging.log("String_Node_Str");
    Logging.log("String_Node_Str");
    if (Main.craftGUI != null) {
      Main.craftGUI.safeSetStatus("String_Node_Str" + port + "String_Node_Str");
    }
    if (listener != null) {
      try {
        listener.close();
      }
 catch (      IOException e) {
        Logging.log("String_Node_Str");
      }
    }
    kill();
    interruptConnections();
    return;
  }
catch (  IOException ioe) {
    Logging.log("String_Node_Str");
    ioe.printStackTrace();
    if (listener != null) {
      try {
        listener.close();
      }
 catch (      IOException e) {
        Logging.log("String_Node_Str");
      }
    }
    return;
  }
  Logging.log("String_Node_Str" + port);
  if (Main.craftGUI != null) {
    Main.craftGUI.safeSetStatus("String_Node_Str" + port + "String_Node_Str");
  }
  while (!killed()) {
    if (this.isInterrupted()) {
      System.out.println("String_Node_Str");
      kill();
    }
    Socket socket=null;
    try {
      socket=listener.accept();
    }
 catch (    SocketTimeoutException ste) {
      if (socket != null) {
        Logging.log("String_Node_Str");
      }
      continue;
    }
catch (    IOException e) {
      Logging.log("String_Node_Str");
      e.printStackTrace();
      continue;
    }
    if (socket == null) {
      continue;
    }
    try {
      socket.setSoTimeout(1000);
    }
 catch (    SocketException e) {
      Logging.log("String_Node_Str");
      if (socket != null) {
        try {
          socket.close();
        }
 catch (        IOException e1) {
          Logging.log("String_Node_Str");
        }
        continue;
      }
    }
    String address=socket.getInetAddress().getHostAddress().toString();
    int port=socket.getPort();
    Logging.log("String_Node_Str" + address + "String_Node_Str"+ port);
    long currentTime=System.currentTimeMillis();
    Long lastConnect=lastLogin.get(address);
    boolean floodProtection=!address.equals("String_Node_Str") && Globals.isFlood() && lastConnect != null && lastConnect + 5000 > currentTime;
    lastLogin.put(address,currentTime);
    if (floodProtection) {
      Logging.log("String_Node_Str");
      try {
        DataOutputStream outputStream=new DataOutputStream(socket.getOutputStream());
        PacketFFKick.kick(outputStream,null,null,"String_Node_Str");
        outputStream.flush();
        socket.close();
      }
 catch (      IOException e) {
        Logging.log("String_Node_Str");
      }
    }
 else {
      try {
        PassthroughConnection ptc=new PassthroughConnection(socket,defaultHostname,listenHostname);
        ptc.start();
        if (Main.craftGUI != null) {
          Main.craftGUI.safeSetStatus("String_Node_Str" + address + "String_Node_Str"+ port);
        }
        addPassthroughConnection(ptc);
      }
 catch (      Exception e) {
        kill();
        e.printStackTrace();
      }
    }
  }
  System.out.println("String_Node_Str" + listener);
  if (listener != null) {
    try {
      listener.close();
    }
 catch (    IOException ioe) {
      System.out.println("String_Node_Str");
    }
  }
  interruptConnections();
}

Fixed version (ground truth):
@Override public void run(){
  ServerSocket listener=null;
  try {
    listener=new ServerSocket(port);
    listener.setSoTimeout(1000);
  }
 catch (  BindException be) {
    Logging.log("String_Node_Str");
    Logging.log("String_Node_Str");
    Logging.log("String_Node_Str");
    Logging.log("String_Node_Str");
    Logging.log("String_Node_Str");
    Logging.log("String_Node_Str");
    if (Main.craftGUI != null) {
      Main.craftGUI.safeSetStatus("String_Node_Str" + port + "String_Node_Str");
    }
    if (listener != null) {
      try {
        listener.close();
      }
 catch (      IOException e) {
        Logging.log("String_Node_Str");
      }
    }
    kill();
    interruptConnections();
    return;
  }
catch (  IOException ioe) {
    Logging.log("String_Node_Str");
    ioe.printStackTrace();
    if (listener != null) {
      try {
        listener.close();
      }
 catch (      IOException e) {
        Logging.log("String_Node_Str");
      }
    }
    return;
  }
  Logging.log("String_Node_Str" + port);
  if (Main.craftGUI != null) {
    Main.craftGUI.safeSetStatus("String_Node_Str" + port + "String_Node_Str");
  }
  while (!killed()) {
    if (this.isInterrupted()) {
      System.out.println("String_Node_Str");
      kill();
    }
    Socket socket=null;
    try {
      socket=listener.accept();
    }
 catch (    SocketTimeoutException ste) {
      if (socket != null) {
        Logging.log("String_Node_Str");
      }
      continue;
    }
catch (    IOException e) {
      Logging.log("String_Node_Str");
      e.printStackTrace();
      continue;
    }
    if (socket == null) {
      continue;
    }
    try {
      socket.setSoTimeout(1000);
    }
 catch (    SocketException e) {
      Logging.log("String_Node_Str");
      if (socket != null) {
        try {
          socket.close();
        }
 catch (        IOException e1) {
          Logging.log("String_Node_Str");
        }
        continue;
      }
    }
    String address=socket.getInetAddress().getHostAddress().toString();
    int port=socket.getPort();
    Logging.log("String_Node_Str" + address + "String_Node_Str"+ port);
    long currentTime=System.currentTimeMillis();
    Long lastConnect=lastLogin.get(address);
    boolean floodProtection=!address.equals("String_Node_Str") && Globals.isFlood() && lastConnect != null && lastConnect + 5000 > currentTime;
    lastLogin.put(address,currentTime);
    if (floodProtection) {
      Logging.log("String_Node_Str");
      try {
        DataOutputStream outputStream=new DataOutputStream(socket.getOutputStream());
        PacketFFKick.kick(outputStream,null,null,"String_Node_Str");
        outputStream.flush();
        socket.close();
      }
 catch (      IOException e) {
        Logging.log("String_Node_Str");
      }
    }
 else {
      try {
        PassthroughConnection ptc=new PassthroughConnection(socket,defaultHostname,listenHostname);
        ptc.start();
        if (Main.craftGUI != null) {
          Main.craftGUI.safeSetStatus("String_Node_Str" + address + "String_Node_Str"+ port);
        }
        addPassthroughConnection(ptc);
      }
 catch (      Exception e) {
        kill();
        e.printStackTrace();
      }
    }
  }
  if (listener != null) {
    try {
      listener.close();
    }
 catch (    IOException ioe) {
      System.out.println("String_Node_Str");
    }
  }
  interruptConnections();
}