Program: 47276
Project: 47276
Buggy source:
@Override public void run(){
  boolean bindErrorReported=false;
  while (true) {
    MulticastSocket multicastSocket=null;
    try {
      multicastSocket=new MulticastSocket(configuration.getUpnpPort());
      if (bindErrorReported) {
        LOGGER.warn("String_Node_Str" + configuration.getUpnpPort() + "String_Node_Str");
      }
      NetworkInterface ni=NetworkConfiguration.getInstance().getNetworkInterfaceByServerName();
      if (ni != null) {
        multicastSocket.setNetworkInterface(ni);
      }
 else       if (PMS.get().getServer().getNetworkInterface() != null) {
        LOGGER.trace("String_Node_Str" + PMS.get().getServer().getNetworkInterface());
        multicastSocket.setNetworkInterface(PMS.get().getServer().getNetworkInterface());
      }
      multicastSocket.setTimeToLive(4);
      multicastSocket.setReuseAddress(true);
      InetAddress upnpAddress=getUPNPAddress();
      multicastSocket.joinGroup(upnpAddress);
      while (true) {
        byte[] buf=new byte[1024];
        DatagramPacket receivePacket=new DatagramPacket(buf,buf.length);
        multicastSocket.receive(receivePacket);
        String s=new String(receivePacket.getData());
        InetAddress address=receivePacket.getAddress();
        if (s.startsWith("String_Node_Str")) {
          String remoteAddr=address.getHostAddress();
          int remotePort=receivePacket.getPort();
          if (configuration.getIpFiltering().allowed(address)) {
            LOGGER.trace("String_Node_Str" + remoteAddr + "String_Node_Str"+ remotePort+ "String_Node_Str");
            if (StringUtils.indexOf(s,"String_Node_Str") > 0) {
              sendDiscover(remoteAddr,remotePort,"String_Node_Str");
            }
            if (StringUtils.indexOf(s,"String_Node_Str") > 0) {
              sendDiscover(remoteAddr,remotePort,"String_Node_Str");
            }
            if (StringUtils.indexOf(s,"String_Node_Str") > 0) {
              sendDiscover(remoteAddr,remotePort,"String_Node_Str");
            }
            if (StringUtils.indexOf(s,"String_Node_Str") > 0) {
              sendDiscover(remoteAddr,remotePort,"String_Node_Str");
            }
            if (StringUtils.indexOf(s,PMS.get().usn()) > 0) {
              sendDiscover(remoteAddr,remotePort,PMS.get().usn());
            }
          }
        }
 else         if (s.startsWith("String_Node_Str")) {
          String remoteAddr=address.getHostAddress();
          int remotePort=receivePacket.getPort();
          LOGGER.trace("String_Node_Str" + remoteAddr + "String_Node_Str"+ remotePort+ "String_Node_Str");
        }
      }
    }
 catch (    BindException e) {
      if (!bindErrorReported) {
        LOGGER.error("String_Node_Str" + configuration.getUpnpPort() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ e.getMessage()+ "String_Node_Str");
      }
      bindErrorReported=true;
      sleep(5000);
    }
catch (    IOException e) {
      LOGGER.error("String_Node_Str",e);
      sleep(1000);
    }
 finally {
      if (multicastSocket != null) {
        try {
          InetAddress upnpAddress=getUPNPAddress();
          multicastSocket.leaveGroup(upnpAddress);
        }
 catch (        IOException e) {
        }
        multicastSocket.disconnect();
        multicastSocket.close();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  boolean bindErrorReported=false;
  while (true) {
    MulticastSocket multicastSocket=null;
    try {
      multicastSocket=new MulticastSocket(configuration.getUpnpPort());
      if (bindErrorReported) {
        LOGGER.warn("String_Node_Str" + configuration.getUpnpPort() + "String_Node_Str");
      }
      multicastSocket.setTimeToLive(4);
      multicastSocket.setReuseAddress(true);
      InetAddress upnpAddress=getUPNPAddress();
      multicastSocket.joinGroup(upnpAddress);
      while (true) {
        byte[] buf=new byte[1024];
        DatagramPacket receivePacket=new DatagramPacket(buf,buf.length);
        multicastSocket.receive(receivePacket);
        String s=new String(receivePacket.getData());
        InetAddress address=receivePacket.getAddress();
        if (s.startsWith("String_Node_Str")) {
          String remoteAddr=address.getHostAddress();
          int remotePort=receivePacket.getPort();
          if (configuration.getIpFiltering().allowed(address)) {
            LOGGER.trace("String_Node_Str" + remoteAddr + "String_Node_Str"+ remotePort+ "String_Node_Str");
            if (StringUtils.indexOf(s,"String_Node_Str") > 0) {
              sendDiscover(remoteAddr,remotePort,"String_Node_Str");
            }
            if (StringUtils.indexOf(s,"String_Node_Str") > 0) {
              sendDiscover(remoteAddr,remotePort,"String_Node_Str");
            }
            if (StringUtils.indexOf(s,"String_Node_Str") > 0) {
              sendDiscover(remoteAddr,remotePort,"String_Node_Str");
            }
            if (StringUtils.indexOf(s,"String_Node_Str") > 0) {
              sendDiscover(remoteAddr,remotePort,"String_Node_Str");
            }
            if (StringUtils.indexOf(s,PMS.get().usn()) > 0) {
              sendDiscover(remoteAddr,remotePort,PMS.get().usn());
            }
          }
        }
 else         if (s.startsWith("String_Node_Str")) {
          String remoteAddr=address.getHostAddress();
          int remotePort=receivePacket.getPort();
          LOGGER.trace("String_Node_Str" + remoteAddr + "String_Node_Str"+ remotePort+ "String_Node_Str");
        }
      }
    }
 catch (    BindException e) {
      if (!bindErrorReported) {
        LOGGER.error("String_Node_Str" + configuration.getUpnpPort() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ e.getMessage()+ "String_Node_Str");
      }
      bindErrorReported=true;
      sleep(5000);
    }
catch (    IOException e) {
      LOGGER.error("String_Node_Str",e);
      sleep(1000);
    }
 finally {
      if (multicastSocket != null) {
        try {
          InetAddress upnpAddress=getUPNPAddress();
          multicastSocket.leaveGroup(upnpAddress);
        }
 catch (        IOException e) {
        }
        multicastSocket.disconnect();
        multicastSocket.close();
      }
    }
  }
}