Program: 21304
Project: 21304
Buggy source:
public void handle0(DownloadLink downloadLink) throws Exception {
  LinkStatus linkStatus=downloadLink.getLinkStatus();
  String link=(String)downloadLink.getProperty("String_Node_Str");
  String[] mirrors=(String[])downloadLink.getProperty("String_Node_Str");
  int c=0;
  while (active) {
    if (c++ == 120)     break;
    try {
      downloadLink.getLinkStatus().setStatusText("String_Node_Str");
      Thread.sleep(1000);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  active=true;
  downloadLink.getLinkStatus().setStatusText("String_Node_Str");
  downloadLink.requestGuiUpdate();
  ArrayList<DownloadLink> dls=getDLinks(link);
  if (dls.size() < 1) {
    linkStatus.addStatus(LinkStatus.ERROR_PLUGIN_DEFEKT);
    linkStatus.setErrorMessage(JDLocale.L("String_Node_Str","String_Node_Str"));
    logger.warning("String_Node_Str");
    active=false;
    return;
  }
  FilePackage fp=downloadLink.getFilePackage();
  int index=fp.indexOf(downloadLink);
  fp.remove(downloadLink);
  Vector<Integer> down=new Vector<Integer>();
  Vector<DownloadLink> ret=new Vector<DownloadLink>();
  for (int i=dls.size() - 1; i >= 0; i--) {
    DistributeData distributeData=new DistributeData(dls.get(i).getDownloadURL());
    Vector<DownloadLink> links=distributeData.findLinks();
    Iterator<DownloadLink> it2=links.iterator();
    boolean online=false;
    while (it2.hasNext()) {
      DownloadLink downloadLink3=(DownloadLink)it2.next();
      if (downloadLink3.isAvailable()) {
        fp.add(index,downloadLink3);
        online=true;
      }
 else {
        down.add(i);
      }
    }
    if (online) {
      ret.addAll(links);
    }
  }
  if (mirrors != null) {
    for (    String element : mirrors) {
      if (down.size() > 0) {
        try {
          dls=getDLinks(element);
          Iterator<Integer> iter=down.iterator();
          while (iter.hasNext()) {
            Integer integer=(Integer)iter.next();
            DistributeData distributeData=new DistributeData(dls.get(down.get(integer)).getDownloadURL());
            Vector<DownloadLink> links=distributeData.findLinks();
            Iterator<DownloadLink> it2=links.iterator();
            boolean online=false;
            while (it2.hasNext()) {
              DownloadLink downloadLink3=(DownloadLink)it2.next();
              if (downloadLink3.isAvailable()) {
                fp.add(index,downloadLink3);
                online=true;
                iter.remove();
              }
            }
            if (online) {
              ret.addAll(links);
            }
          }
        }
 catch (        Exception e) {
        }
      }
 else {
        break;
      }
    }
  }
  if (down.size() > 0) {
    fp.add(downloadLink);
    linkStatus.addStatus(LinkStatus.ERROR_FATAL);
    linkStatus.setErrorMessage(JDLocale.L("String_Node_Str","String_Node_Str"));
    active=false;
    return;
  }
  active=false;
}

Fixed version (ground truth):
public void handle0(DownloadLink downloadLink) throws Exception {
  LinkStatus linkStatus=downloadLink.getLinkStatus();
  String link=(String)downloadLink.getProperty("String_Node_Str");
  String[] mirrors=(String[])downloadLink.getProperty("String_Node_Str");
  int c=0;
  while (active) {
    if (c++ == 120)     break;
    try {
      downloadLink.getLinkStatus().setStatusText("String_Node_Str");
      Thread.sleep(1000);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  active=true;
  downloadLink.getLinkStatus().setStatusText("String_Node_Str");
  downloadLink.requestGuiUpdate();
  ArrayList<DownloadLink> dls=getDLinks(link);
  if (dls.size() < 1) {
    linkStatus.addStatus(LinkStatus.ERROR_PLUGIN_DEFEKT);
    linkStatus.setErrorMessage(JDLocale.L("String_Node_Str","String_Node_Str"));
    logger.warning("String_Node_Str");
    active=false;
    return;
  }
  FilePackage fp=downloadLink.getFilePackage();
  int index=fp.indexOf(downloadLink);
  fp.remove(downloadLink);
  Vector<Integer> down=new Vector<Integer>();
  Vector<DownloadLink> ret=new Vector<DownloadLink>();
  for (int i=dls.size() - 1; i >= 0; i--) {
    DistributeData distributeData=new DistributeData(dls.get(i).getDownloadURL());
    Vector<DownloadLink> links=distributeData.findLinks();
    Iterator<DownloadLink> it2=links.iterator();
    boolean online=false;
    while (it2.hasNext()) {
      DownloadLink downloadLink3=(DownloadLink)it2.next();
      if (downloadLink3.isAvailable()) {
        fp.add(index,downloadLink3);
        online=true;
      }
 else {
        down.add(i);
      }
    }
    if (online) {
      ret.addAll(links);
    }
  }
  if (mirrors != null) {
    for (    String element : mirrors) {
      if (down.size() > 0) {
        try {
          dls=getDLinks(element);
          Iterator<Integer> iter=down.iterator();
          while (iter.hasNext()) {
            Integer integer=(Integer)iter.next();
            DistributeData distributeData=new DistributeData(dls.get(integer).getDownloadURL());
            Vector<DownloadLink> links=distributeData.findLinks();
            Iterator<DownloadLink> it2=links.iterator();
            boolean online=false;
            while (it2.hasNext()) {
              DownloadLink downloadLink3=(DownloadLink)it2.next();
              if (downloadLink3.isAvailable()) {
                fp.add(index,downloadLink3);
                online=true;
                iter.remove();
              }
            }
            if (online) {
              ret.addAll(links);
            }
          }
        }
 catch (        Exception e) {
        }
      }
 else {
        break;
      }
    }
  }
  if (down.size() > 0) {
    fp.add(downloadLink);
    linkStatus.addStatus(LinkStatus.ERROR_FATAL);
    linkStatus.setErrorMessage(JDLocale.L("String_Node_Str","String_Node_Str"));
    active=false;
    return;
  }
  active=false;
}