Program: 20926
Project: 20926
Buggy source:
@Override public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
  requestFileInformation(downloadLink);
  Form freeform=br.getFormBySubmitvalue("String_Node_Str");
  if (freeform == null) {
    freeform=br.getFormBySubmitvalue("String_Node_Str");
    if (freeform == null) {
      freeform=br.getFormbyKey("String_Node_Str");
    }
  }
  if (freeform != null)   br.submitForm(freeform);
  if (br.containsHTML("String_Node_Str")) {
    String filesizelimit=br.getRegex("String_Node_Str").getMatch(0);
    if (filesizelimit != null) {
      filesizelimit=filesizelimit.trim();
      logger.warning("String_Node_Str" + filesizelimit + "String_Node_Str");
      throw new PluginException(LinkStatus.ERROR_FATAL,"String_Node_Str" + filesizelimit + "String_Node_Str");
    }
 else {
      logger.warning("String_Node_Str");
      throw new PluginException(LinkStatus.ERROR_FATAL,"String_Node_Str");
    }
  }
  if (br.containsHTML("String_Node_Str")) {
    int minutes=0, seconds=0, hours=0;
    String tmphrs=br.getRegex("String_Node_Str").getMatch(0);
    if (tmphrs != null)     hours=Integer.parseInt(tmphrs);
    String tmpmin=br.getRegex("String_Node_Str").getMatch(0);
    if (tmpmin != null)     minutes=Integer.parseInt(tmpmin);
    String tmpsec=br.getRegex("String_Node_Str").getMatch(0);
    if (tmpsec != null)     seconds=Integer.parseInt(tmpsec);
    int waittime=((3600 * hours) + (60 * minutes) + seconds+ 1) * 1000;
    logger.info("String_Node_Str" + waittime + "String_Node_Str");
    throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,null,waittime);
  }
  if (br.containsHTML("String_Node_Str")) {
    String tmphrs=br.getRegex("String_Node_Str").getMatch(0);
    String tmpmin=br.getRegex("String_Node_Str").getMatch(0);
    String tmpsec=br.getRegex("String_Node_Str").getMatch(0);
    if (tmphrs == null && tmpmin == null && tmpsec == null) {
      throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,null,60 * 60 * 1000l);
    }
 else {
      int minutes=0, seconds=0, hours=0;
      if (tmphrs != null)       hours=Integer.parseInt(tmphrs);
      if (tmpmin != null)       minutes=Integer.parseInt(tmpmin);
      if (tmpsec != null)       seconds=Integer.parseInt(tmpsec);
      int waittime=((3600 * hours) + (60 * minutes) + seconds+ 1) * 1000;
      logger.info("String_Node_Str" + waittime + "String_Node_Str");
      throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,null,waittime);
    }
  }
  String md5hash=br.getRegex("String_Node_Str").getMatch(0);
  if (md5hash != null) {
    md5hash=md5hash.trim();
    logger.info("String_Node_Str" + md5hash);
    downloadLink.setMD5Hash(md5hash);
  }
  br.setFollowRedirects(false);
  Form DLForm=br.getFormbyProperty("String_Node_Str","String_Node_Str");
  if (DLForm == null)   throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
  String passCode=null;
  boolean password=false;
  boolean recaptcha=false;
  if (br.containsHTML("String_Node_Str")) {
    password=true;
    logger.info("String_Node_Str");
  }
  if (br.containsHTML("String_Node_Str")) {
    logger.info("String_Node_Str");
    String[][] letters=new Regex(Encoding.htmlDecode(br.toString()),"String_Node_Str").getMatches();
    if (letters == null || letters.length == 0) {
      logger.warning("String_Node_Str");
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
    SortedMap<Integer,String> capMap=new TreeMap<Integer,String>();
    for (    String[] letter : letters) {
      capMap.put(Integer.parseInt(letter[0]),letter[1]);
    }
    StringBuilder code=new StringBuilder();
    for (    String value : capMap.values()) {
      code.append(value);
    }
    DLForm.put("String_Node_Str",code.toString());
    logger.info("String_Node_Str" + code.toString() + "String_Node_Str");
  }
 else   if (br.containsHTML("String_Node_Str")) {
    logger.info("String_Node_Str");
    String[] sitelinks=HTMLParser.getHttpLinks(br.toString(),null);
    String captchaurl=null;
    if (sitelinks == null || sitelinks.length == 0) {
      logger.warning("String_Node_Str");
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
    for (    String link : sitelinks) {
      if (link.contains("String_Node_Str")) {
        captchaurl=link;
      }
    }
    if (captchaurl == null) {
      logger.warning("String_Node_Str");
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
    String code=getCaptchaCode(captchaurl,downloadLink);
    DLForm.put("String_Node_Str",code);
    logger.info("String_Node_Str" + code + "String_Node_Str");
  }
 else   if (br.containsHTML("String_Node_Str") && !br.containsHTML("String_Node_Str")) {
    logger.info("String_Node_Str");
    Recaptcha rc=new Recaptcha(br);
    rc.parse();
    rc.load();
    File cf=rc.downloadCaptcha(getLocalCaptchaFile());
    String c=getCaptchaCode(cf,downloadLink);
    if (password == true) {
      if (downloadLink.getStringProperty("String_Node_Str",null) == null) {
        passCode=Plugin.getUserInput("String_Node_Str",downloadLink);
      }
 else {
        passCode=downloadLink.getStringProperty("String_Node_Str",null);
      }
      rc.getForm().put("String_Node_Str",passCode);
      logger.info("String_Node_Str" + passCode + "String_Node_Str");
      password=false;
    }
    recaptcha=true;
    rc.setCode(c);
    logger.info("String_Node_Str" + c + "String_Node_Str");
  }
  String ttt=br.getRegex("String_Node_Str").getMatch(0);
  if (ttt != null) {
    logger.info("String_Node_Str" + ttt.trim() + "String_Node_Str");
    int tt=Integer.parseInt(ttt);
    sleep(tt * 1001,downloadLink);
  }
  if (recaptcha == false) {
    if (password == true) {
      if (downloadLink.getStringProperty("String_Node_Str",null) == null) {
        passCode=Plugin.getUserInput("String_Node_Str",downloadLink);
      }
 else {
        passCode=downloadLink.getStringProperty("String_Node_Str",null);
      }
      DLForm.put("String_Node_Str",passCode);
      logger.info("String_Node_Str" + passCode + "String_Node_Str");
    }
    jd.plugins.BrowserAdapter.openDownload(br,downloadLink,DLForm,false,1);
    logger.info("String_Node_Str");
  }
  boolean error=false;
  try {
    if (dl.getConnection().getContentType() != null && dl.getConnection().getContentType().contains("String_Node_Str")) {
      error=true;
    }
  }
 catch (  Exception e) {
    error=true;
  }
  if (br.getRedirectLocation() != null || error == true) {
    br.followConnection();
    logger.info("String_Node_Str");
    String dllink=br.getRedirectLocation();
    if (dllink == null) {
      if (br.containsHTML("String_Node_Str")) {
        int minutes=0, seconds=0, hours=0;
        String tmphrs=br.getRegex("String_Node_Str").getMatch(0);
        if (tmphrs != null)         hours=Integer.parseInt(tmphrs);
        String tmpmin=br.getRegex("String_Node_Str").getMatch(0);
        if (tmpmin != null)         minutes=Integer.parseInt(tmpmin);
        String tmpsec=br.getRegex("String_Node_Str").getMatch(0);
        if (tmpsec != null)         seconds=Integer.parseInt(tmpsec);
        int waittime=((3600 * hours) + (60 * minutes) + seconds+ 1) * 1000;
        logger.info("String_Node_Str" + waittime + "String_Node_Str");
        throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,null,waittime);
      }
      if (br.containsHTML("String_Node_Str")) {
        String tmphrs=br.getRegex("String_Node_Str").getMatch(0);
        String tmpmin=br.getRegex("String_Node_Str").getMatch(0);
        String tmpsec=br.getRegex("String_Node_Str").getMatch(0);
        if (tmphrs == null && tmpmin == null && tmpsec == null) {
          throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,null,60 * 60 * 1000l);
        }
 else {
          int minutes=0, seconds=0, hours=0;
          if (tmphrs != null)           hours=Integer.parseInt(tmphrs);
          if (tmpmin != null)           minutes=Integer.parseInt(tmpmin);
          if (tmpsec != null)           seconds=Integer.parseInt(tmpsec);
          int waittime=((3600 * hours) + (60 * minutes) + seconds+ 1) * 1000;
          logger.info("String_Node_Str" + waittime + "String_Node_Str");
          throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,null,waittime);
        }
      }
      if (br.containsHTML("String_Node_Str"))       throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,null,10 * 60 * 1001l);
      if (br.containsHTML("String_Node_Str")) {
        logger.warning("String_Node_Str" + passCode + "String_Node_Str");
        downloadLink.setProperty("String_Node_Str",null);
        throw new PluginException(LinkStatus.ERROR_RETRY);
      }
      if (br.containsHTML("String_Node_Str")) {
        logger.warning("String_Node_Str");
        throw new PluginException(LinkStatus.ERROR_CAPTCHA);
      }
      if (dllink == null) {
        dllink=br.getRegex("String_Node_Str").getMatch(0);
        if (dllink == null) {
          dllink=br.getRegex("String_Node_Str").getMatch(0);
          if (dllink == null) {
            dllink=br.getRegex("String_Node_Str").getMatch(0);
          }
        }
      }
    }
    if (dllink == null) {
      logger.warning("String_Node_Str");
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
    jd.plugins.BrowserAdapter.openDownload(br,downloadLink,dllink,false,1);
  }
  if (passCode != null) {
    downloadLink.setProperty("String_Node_Str",passCode);
  }
  boolean error2=false;
  try {
    if (dl.getConnection().getContentType() != null && dl.getConnection().getContentType().contains("String_Node_Str")) {
      error2=true;
    }
  }
 catch (  Exception e) {
    error2=true;
  }
  if (error2 == true) {
    logger.warning("String_Node_Str");
    br.followConnection();
    if (br.containsHTML("String_Node_Str")) {
      logger.warning("String_Node_Str");
      throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
    }
    throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
  }
  dl.startDownload();
}

Fixed version (ground truth):
@Override public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
  requestFileInformation(downloadLink);
  doFree2(downloadLink);
}