Program: 49587
Project: 49587
Buggy source:
public Address pickAddress() throws Exception {
  InetAddress currentInetAddress=null;
  try {
    final Config config=node.getConfig();
    final String localAddress=System.getProperty("String_Node_Str");
    if (localAddress != null) {
      currentInetAddress=InetAddress.getByName(localAddress.trim());
    }
    if (currentInetAddress == null) {
      final Collection<String> interfaces=new HashSet<String>();
      if (config.getNetworkConfig().getInterfaces().isEnabled()) {
        interfaces.addAll(config.getNetworkConfig().getInterfaces().getInterfaces());
        logger.log(Level.INFO,"String_Node_Str" + "String_Node_Str" + interfaces);
      }
 else       if (config.getNetworkConfig().getJoin().getTcpIpConfig().isEnabled()) {
        final Collection<String> possibleAddresses=TcpIpJoiner.getConfigurationMembers(node.config);
        for (        String possibleAddress : possibleAddresses) {
          interfaces.add(AddressUtil.getAddressHolder(possibleAddress).address);
        }
        logger.log(Level.FINEST,"String_Node_Str" + "String_Node_Str" + interfaces);
      }
      if (interfaces.contains("String_Node_Str") || interfaces.contains("String_Node_Str")) {
        currentInetAddress=InetAddress.getByName("String_Node_Str");
      }
 else {
        if (interfaces.size() > 0) {
          currentInetAddress=pickInetAddress(interfaces);
        }
        if (currentInetAddress == null) {
          if (config.getNetworkConfig().getInterfaces().isEnabled()) {
            String msg="String_Node_Str";
            msg+="String_Node_Str";
            logger.log(Level.SEVERE,msg);
            throw new RuntimeException(msg);
          }
 else {
            currentInetAddress=pickInetAddress(null);
          }
        }
      }
    }
    if (currentInetAddress != null) {
      currentInetAddress=AddressUtil.fixAndGetInetAddress(currentInetAddress);
    }
    if (currentInetAddress == null) {
      currentInetAddress=InetAddress.getByName("String_Node_Str");
    }
    final InetAddress inetAddress=currentInetAddress;
    final boolean reuseAddress=config.isReuseAddress();
    ServerSocket serverSocket=serverSocketChannel.socket();
    logger.log(Level.FINEST,"String_Node_Str" + reuseAddress);
    serverSocket.setReuseAddress(reuseAddress);
    serverSocket.setSoTimeout(1000);
    InetSocketAddress isa;
    int port=config.getPort();
    for (int i=0; i < 100; i++) {
      try {
        boolean bindAny=node.getGroupProperties().SOCKET_BIND_ANY.getBoolean();
        if (bindAny) {
          isa=new InetSocketAddress(port);
        }
 else {
          isa=new InetSocketAddress(inetAddress,port);
        }
        logger.log(Level.FINEST,"String_Node_Str" + isa);
        serverSocket.bind(isa,100);
        break;
      }
 catch (      final Exception e) {
        if (config.isPortAutoIncrement()) {
          serverSocket=serverSocketChannel.socket();
          serverSocket.setReuseAddress(reuseAddress);
          port++;
        }
 else {
          String msg="String_Node_Str" + port + "String_Node_Str"+ "String_Node_Str";
          logger.log(Level.SEVERE,msg,e);
          throw e;
        }
      }
    }
    serverSocketChannel.configureBlocking(false);
    return new Address(inetAddress,port);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    throw e;
  }
}

Fixed version (ground truth):
public void pickAddress() throws Exception {
  if (address != null) {
    return;
  }
  try {
    final Config config=node.getConfig();
    final InetAddress inetAddress=pickInetAddress(config);
    final boolean reuseAddress=config.isReuseAddress();
    serverSocketChannel=ServerSocketChannel.open();
    final ServerSocket serverSocket=serverSocketChannel.socket();
    logger.log(Level.FINEST,"String_Node_Str" + reuseAddress);
    serverSocket.setReuseAddress(reuseAddress);
    serverSocket.setSoTimeout(1000);
    InetSocketAddress isa;
    int port=config.getPort();
    for (int i=0; i < 100; i++) {
      try {
        boolean bindAny=node.getGroupProperties().SOCKET_BIND_ANY.getBoolean();
        if (bindAny) {
          isa=new InetSocketAddress(port);
        }
 else {
          isa=new InetSocketAddress(inetAddress,port);
        }
        logger.log(Level.FINEST,"String_Node_Str" + isa);
        serverSocket.bind(isa,100);
        break;
      }
 catch (      final Exception e) {
        if (config.isPortAutoIncrement()) {
          port++;
        }
 else {
          String msg="String_Node_Str" + port + "String_Node_Str"+ "String_Node_Str";
          logger.log(Level.SEVERE,msg,e);
          throw e;
        }
      }
    }
    serverSocketChannel.configureBlocking(false);
    address=new Address(inetAddress,port);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    throw e;
  }
}