Program: 20865
Project: 20865
Buggy source:
private void startLinkCheck(){
  if (checkThread != null && checkThread.isAlive()) {
    return;
  }
  checkThread=new Thread(){
    public void run(){
      setName("String_Node_Str");
      getBroadcaster().fireEvent(new LinkCheckEvent(this,LinkCheckEvent.START));
      pc=new ProgressController(JDL.L("String_Node_Str","String_Node_Str"),null);
      pc.getBroadcaster().addListener(LinkCheck.getLinkChecker());
      pc.setRange(0);
      while (linksToCheck.size() != 0) {
        ArrayList<DownloadLink> currentList;
synchronized (linksToCheck) {
          currentList=new ArrayList<DownloadLink>(linksToCheck);
          pc.addToMax(currentList.size());
        }
        HashMap<String,ArrayList<DownloadLink>> map=new HashMap<String,ArrayList<DownloadLink>>();
        for (        DownloadLink dl : currentList) {
          ArrayList<DownloadLink> localList=map.get(dl.getPlugin().getHost());
          if (localList == null) {
            localList=new ArrayList<DownloadLink>();
            map.put(dl.getPlugin().getHost(),localList);
          }
          localList.add(dl);
        }
        checkJobbers=new Jobber(4);
        ArrayList<DownloadLink> hosterList;
        for (Iterator<ArrayList<DownloadLink>> it=map.values().iterator(); it.hasNext(); ) {
          hosterList=it.next();
          CheckThread cthread=new CheckThread(hosterList);
          checkJobbers.add(cthread);
        }
        int todo=checkJobbers.getJobsAdded();
        checkJobbers.start();
        while (checkJobbers.getJobsFinished() != todo) {
          try {
            Thread.sleep(200);
          }
 catch (          InterruptedException e) {
            return;
          }
        }
        checkJobbers.stop();
synchronized (linksToCheck) {
          linksToCheck.removeAll(currentList);
        }
        try {
          Thread.sleep(2000);
        }
 catch (        InterruptedException e) {
          return;
        }
      }
      pc.doFinalize();
      pc.getBroadcaster().removeListener(LinkCheck.getLinkChecker());
      getBroadcaster().fireEvent(new LinkCheckEvent(this,LinkCheckEvent.STOP));
      checkRunning=false;
    }
  }
;
  checkThread.start();
}

Fixed version (ground truth):
private void startLinkCheck(){
  if (checkThread != null && checkThread.isAlive()) {
    return;
  }
  checkThread=new Thread(){
    public void run(){
      setName("String_Node_Str");
      getBroadcaster().fireEvent(new LinkCheckEvent(this,LinkCheckEvent.START));
      pc=new ProgressController(JDL.L("String_Node_Str","String_Node_Str"),null);
      pc.getBroadcaster().addListener(LinkCheck.getLinkChecker());
      pc.setRange(0);
      while (linksToCheck.size() != 0) {
        ArrayList<DownloadLink> currentList;
synchronized (linksToCheck) {
          currentList=new ArrayList<DownloadLink>(linksToCheck);
          pc.addToMax(currentList.size());
        }
        HashMap<String,ArrayList<DownloadLink>> map=new HashMap<String,ArrayList<DownloadLink>>();
        for (        DownloadLink dl : currentList) {
          if (dl.getPlugin() == null)           continue;
          ArrayList<DownloadLink> localList=map.get(dl.getPlugin().getHost());
          if (localList == null) {
            localList=new ArrayList<DownloadLink>();
            map.put(dl.getPlugin().getHost(),localList);
          }
          localList.add(dl);
        }
        checkJobbers=new Jobber(4);
        ArrayList<DownloadLink> hosterList;
        for (Iterator<ArrayList<DownloadLink>> it=map.values().iterator(); it.hasNext(); ) {
          hosterList=it.next();
          CheckThread cthread=new CheckThread(hosterList);
          checkJobbers.add(cthread);
        }
        int todo=checkJobbers.getJobsAdded();
        checkJobbers.start();
        while (checkJobbers.getJobsFinished() != todo) {
          try {
            Thread.sleep(200);
          }
 catch (          InterruptedException e) {
            return;
          }
        }
        checkJobbers.stop();
synchronized (linksToCheck) {
          linksToCheck.removeAll(currentList);
        }
        try {
          Thread.sleep(2000);
        }
 catch (        InterruptedException e) {
          return;
        }
      }
      pc.doFinalize();
      pc.getBroadcaster().removeListener(LinkCheck.getLinkChecker());
      getBroadcaster().fireEvent(new LinkCheckEvent(this,LinkCheckEvent.STOP));
      checkRunning=false;
    }
  }
;
  checkThread.start();
}