Program: 103359
Project: 103359
Buggy source:
private void checkNetworkInterfaces(boolean fireEvents){
  try {
    if (activeInterfaces.size() == 0) {
synchronized (this) {
        try {
          wait(1000);
        }
 catch (        InterruptedException ex) {
        }
      }
    }
    Enumeration<NetworkInterface> e=NetworkInterface.getNetworkInterfaces();
    List<NetworkInterface> currentActiveInterfaces=new ArrayList<NetworkInterface>();
    while (e.hasMoreElements()) {
      NetworkInterface networkInterface=e.nextElement();
      if (isInterfaceLoopback(networkInterface))       continue;
      if (isInterfaceUp(networkInterface) && hasValidAddress(networkInterface)) {
        currentActiveInterfaces.add(networkInterface);
      }
    }
    List<NetworkInterface> inactiveActiveInterfaces=new ArrayList<NetworkInterface>(activeInterfaces);
    inactiveActiveInterfaces.removeAll(currentActiveInterfaces);
    for (int i=0; i < inactiveActiveInterfaces.size(); i++) {
      NetworkInterface iface=inactiveActiveInterfaces.get(i);
      if (!containsInterfaceWithName(currentActiveInterfaces,iface.getName())) {
        if (fireEvents)         fireChangeEvent(new ChangeEvent(iface,ChangeEvent.IFACE_DOWN,false));
        activeInterfaces.remove(iface);
      }
    }
    currentActiveInterfaces.removeAll(activeInterfaces);
    for (int i=0; i < currentActiveInterfaces.size(); i++) {
      NetworkInterface iface=currentActiveInterfaces.get(i);
      if (fireEvents)       fireChangeEvent(new ChangeEvent(iface,ChangeEvent.IFACE_UP,false));
      activeInterfaces.add(iface);
    }
  }
 catch (  SocketException e) {
    logger.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void checkNetworkInterfaces(boolean fireEvents){
  try {
synchronized (this) {
      try {
        wait(1000);
      }
 catch (      InterruptedException ex) {
      }
    }
    Enumeration<NetworkInterface> e=NetworkInterface.getNetworkInterfaces();
    List<NetworkInterface> currentActiveInterfaces=new ArrayList<NetworkInterface>();
    while (e.hasMoreElements()) {
      NetworkInterface networkInterface=e.nextElement();
      if (isInterfaceLoopback(networkInterface))       continue;
      if (isInterfaceUp(networkInterface) && hasValidAddress(networkInterface)) {
        currentActiveInterfaces.add(networkInterface);
      }
    }
    List<NetworkInterface> inactiveActiveInterfaces=new ArrayList<NetworkInterface>(activeInterfaces);
    inactiveActiveInterfaces.removeAll(currentActiveInterfaces);
    for (int i=0; i < inactiveActiveInterfaces.size(); i++) {
      NetworkInterface iface=inactiveActiveInterfaces.get(i);
      if (!containsInterfaceWithName(currentActiveInterfaces,iface.getName())) {
        if (fireEvents)         fireChangeEvent(new ChangeEvent(iface,ChangeEvent.IFACE_DOWN,false));
        activeInterfaces.remove(iface);
      }
    }
    currentActiveInterfaces.removeAll(activeInterfaces);
    for (int i=0; i < currentActiveInterfaces.size(); i++) {
      NetworkInterface iface=currentActiveInterfaces.get(i);
      if (fireEvents)       fireChangeEvent(new ChangeEvent(iface,ChangeEvent.IFACE_UP,false));
      activeInterfaces.add(iface);
    }
  }
 catch (  SocketException e) {
    logger.error("String_Node_Str",e);
  }
}