Program: 50789
Project: 50789
Buggy source:
public void run(){
  try {
    socketChannel=SocketChannel.open();
    final Address thisAddress=Node.get().getThisAddress();
    final int addition=(thisAddress.getPort() - Config.get().port);
    localPort=10000 + addition;
    boolean bindOk=false;
    while (!bindOk) {
      try {
        localPort+=20;
        if (boundPorts.size() > 2000 || localPort > 60000) {
          boundPorts.clear();
          final Connection[] conns=ConnectionManager.get().getConnections();
          for (          final Connection conn : conns) {
            boundPorts.add(conn.localPort);
          }
        }
        if (boundPorts.add(localPort)) {
          socketChannel.socket().bind(new InetSocketAddress(thisAddress.getInetAddress(),localPort));
          bindOk=true;
          socketChannel.configureBlocking(false);
          if (DEBUG)           logger.log(Level.INFO,"String_Node_Str" + address);
          socketChannel.connect(new InetSocketAddress(address.getInetAddress(),address.getPort()));
        }
      }
 catch (      final Exception e) {
      }
    }
    socketChannel.register(selector,SelectionKey.OP_CONNECT,Connector.this);
  }
 catch (  final Exception e) {
    try {
      socketChannel.close();
    }
 catch (    final IOException ignored) {
    }
    if (numberOfConnectionError++ < 5) {
      if (DEBUG) {
        logger.log(Level.INFO,"String_Node_Str" + e.getMessage());
      }
      run();
    }
 else {
      ConnectionManager.get().failedConnection(address);
    }
  }
}

Fixed version (ground truth):
public void run(){
  try {
    socketChannel=SocketChannel.open();
    final Address thisAddress=Node.get().getThisAddress();
    final int addition=(thisAddress.getPort() - Config.get().port);
    localPort=10000 + addition;
    boolean bindOk=false;
    while (!bindOk) {
      try {
        localPort+=20;
        if (boundPorts.size() > 2000 || localPort > 60000) {
          boundPorts.clear();
          final Connection[] conns=ConnectionManager.get().getConnections();
          for (          final Connection conn : conns) {
            boundPorts.add(conn.localPort);
          }
        }
        if (boundPorts.add(localPort)) {
          socketChannel.socket().bind(new InetSocketAddress(thisAddress.getInetAddress(),localPort));
          bindOk=true;
          socketChannel.configureBlocking(false);
          if (DEBUG)           logger.log(Level.FINEST,"String_Node_Str" + address + "String_Node_Str"+ localPort);
          boolean connected=socketChannel.connect(new InetSocketAddress(address.getInetAddress(),address.getPort()));
          if (DEBUG)           logger.log(Level.FINEST,"String_Node_Str" + connected + "String_Node_Str"+ address+ "String_Node_Str"+ localPort);
          if (connected) {
            handle();
            return;
          }
        }
      }
 catch (      final Throwable e) {
        if (DEBUG)         logger.log(Level.FINEST,"String_Node_Str" + localPort,e);
      }
    }
    socketChannel.register(selector,SelectionKey.OP_CONNECT,Connector.this);
  }
 catch (  final Exception e) {
    try {
      socketChannel.close();
    }
 catch (    final IOException ignored) {
    }
    if (numberOfConnectionError++ < 5) {
      if (DEBUG) {
        logger.log(Level.FINEST,"String_Node_Str" + e.getMessage());
      }
      run();
    }
 else {
      ConnectionManager.get().failedConnection(address);
    }
  }
}