Program: 178642
Project: 178642
Buggy source:
@Override public void run(){
  ProtocolUnitArray.ops[0x50]=new ProtocolUnitArray.Op[]{ProtocolUnitArray.Op.JUMP_FIXED,ProtocolUnitArray.Op.SHORT_SIZED};
  ProtocolUnitArray.params[0x50]=new int[]{1,0};
  ProtocolUnitArray.ops[0x51]=new ProtocolUnitArray.Op[]{ProtocolUnitArray.Op.JUMP_FIXED,ProtocolUnitArray.Op.INT_SIZED};
  ProtocolUnitArray.params[0x51]=new int[]{14,0};
  ServerSocket listener=null;
  try {
    listener=new ServerSocket(port);
    listener.setSoTimeout(200);
  }
 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(200);
    }
 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());
        ProtocolOutputStream packetOutputStream=new ProtocolOutputStream(outputStream);
        packetOutputStream.sendPacket(new PacketFFKick("String_Node_Str"));
        outputStream.flush();
        socket.close();
      }
 catch (      IOException e) {
        Logging.log("String_Node_Str");
      }
    }
 else {
      try {
        PassthroughConnection ptc=new PassthroughConnection(socket,defaultHostname,listenHostname,fairnessManager,this);
        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");
    }
  }
  if (Globals.localCache()) {
    hs.flushPending(true);
    hs.writeFAT();
  }
  if (fairnessManager != null) {
    System.out.println("String_Node_Str");
    fairnessManager.killTimerAndJoin();
    System.out.println("String_Node_Str");
  }
  interruptConnections();
}

Fixed version (ground truth):
@Override public void run(){
  ProtocolUnitArray.ops[0x50]=new ProtocolUnitArray.Op[]{ProtocolUnitArray.Op.JUMP_FIXED,ProtocolUnitArray.Op.SHORT_SIZED};
  ProtocolUnitArray.params[0x50]=new int[]{1,0};
  ProtocolUnitArray.ops[0x51]=new ProtocolUnitArray.Op[]{ProtocolUnitArray.Op.JUMP_FIXED,ProtocolUnitArray.Op.INT_SIZED};
  ProtocolUnitArray.params[0x51]=new int[]{14,0};
  ServerSocket listener=null;
  try {
    listener=new ServerSocket(port);
    listener.setSoTimeout(200);
  }
 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(200);
    }
 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());
        ProtocolOutputStream packetOutputStream=new ProtocolOutputStream(outputStream);
        packetOutputStream.sendPacket(new PacketFFKick("String_Node_Str"));
        outputStream.flush();
        socket.close();
      }
 catch (      IOException e) {
        Logging.log("String_Node_Str");
      }
    }
 else {
      try {
        PassthroughConnection ptc=new PassthroughConnection(socket,defaultHostname,listenHostname,fairnessManager,this);
        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");
    }
  }
  if (Globals.localCache()) {
    hs.flushPending(true);
    hs.writeFAT();
  }
  interruptConnections();
}