Program: 50576
Project: 50576
Buggy source:
public static Address pickAddress(Node node,final ServerSocketChannel serverSocketChannel) throws Exception {
  String currentAddress=null;
  try {
    final Config config=Config.get();
    final String localAddress=System.getProperty("String_Node_Str");
    if (localAddress != null) {
      currentAddress=InetAddress.getByName(localAddress.trim()).getHostAddress();
    }
    if (currentAddress == null) {
      final Enumeration<NetworkInterface> enums=NetworkInterface.getNetworkInterfaces();
      interfaces:       while (enums.hasMoreElements()) {
        final NetworkInterface ni=enums.nextElement();
        final Enumeration<InetAddress> e=ni.getInetAddresses();
        while (e.hasMoreElements()) {
          final InetAddress inetAddress=e.nextElement();
          if (inetAddress instanceof Inet4Address) {
            final String address=inetAddress.getHostAddress();
            if (config.getNetworkConfig().getInterfaces().isEnabled()) {
              if (matchAddress(address)) {
                currentAddress=address;
                break interfaces;
              }
            }
 else {
              if (!inetAddress.isLoopbackAddress()) {
                currentAddress=address;
                break interfaces;
              }
            }
          }
        }
      }
      if (config.getNetworkConfig().getInterfaces().isEnabled() && currentAddress == null) {
        String msg="String_Node_Str";
        msg+="String_Node_Str";
        logger.log(Level.SEVERE,msg);
        node.dumpCore(null);
        return null;
      }
    }
    if (currentAddress == null) {
      currentAddress="String_Node_Str";
    }
    final InetAddress inetAddress=InetAddress.getByName(currentAddress);
    ServerSocket serverSocket=serverSocketChannel.socket();
    serverSocket.setReuseAddress(false);
    InetSocketAddress isa;
    int port=config.getPort();
    for (int i=0; i < 100; i++) {
      try {
        isa=new InetSocketAddress(inetAddress,port);
        serverSocket.bind(isa,100);
        break;
      }
 catch (      final Exception e) {
        serverSocket=serverSocketChannel.socket();
        serverSocket.setReuseAddress(false);
        port++;
      }
    }
    serverSocketChannel.configureBlocking(false);
    return new Address(currentAddress,port);
  }
 catch (  final Exception e) {
    node.dumpCore(e);
    e.printStackTrace();
    throw e;
  }
}

Fixed version (ground truth):
public static Address pickAddress(Node node,final ServerSocketChannel serverSocketChannel) throws Exception {
  String currentAddress=null;
  try {
    final Config config=Config.get();
    final String localAddress=System.getProperty("String_Node_Str");
    if (localAddress != null) {
      currentAddress=InetAddress.getByName(localAddress.trim()).getHostAddress();
    }
    if (currentAddress == null) {
      final Enumeration<NetworkInterface> enums=NetworkInterface.getNetworkInterfaces();
      interfaces:       while (enums.hasMoreElements()) {
        final NetworkInterface ni=enums.nextElement();
        final Enumeration<InetAddress> e=ni.getInetAddresses();
        while (e.hasMoreElements()) {
          final InetAddress inetAddress=e.nextElement();
          if (inetAddress instanceof Inet4Address) {
            final String address=inetAddress.getHostAddress();
            if (config.getNetworkConfig().getInterfaces().isEnabled()) {
              if (matchAddress(address)) {
                currentAddress=address;
                break interfaces;
              }
            }
 else {
              if (!inetAddress.isLoopbackAddress()) {
                currentAddress=address;
                break interfaces;
              }
            }
          }
        }
      }
      if (config.getNetworkConfig().getInterfaces().isEnabled() && currentAddress == null) {
        String msg="String_Node_Str";
        msg+="String_Node_Str";
        logger.log(Level.SEVERE,msg);
        node.dumpCore(null);
        return null;
      }
    }
    if (currentAddress == null) {
      currentAddress="String_Node_Str";
    }
    final InetAddress inetAddress=InetAddress.getByName(currentAddress);
    ServerSocket serverSocket=serverSocketChannel.socket();
    serverSocket.setReuseAddress(true);
    InetSocketAddress isa;
    int port=config.getPort();
    for (int i=0; i < 100; i++) {
      try {
        isa=new InetSocketAddress(inetAddress,port);
        serverSocket.bind(isa,100);
        break;
      }
 catch (      final Exception e) {
        serverSocket=serverSocketChannel.socket();
        serverSocket.setReuseAddress(true);
        port++;
      }
    }
    serverSocketChannel.configureBlocking(false);
    return new Address(currentAddress,port);
  }
 catch (  final Exception e) {
    node.dumpCore(e);
    e.printStackTrace();
    throw e;
  }
}