Program: 20686
Project: 20686
Buggy source:
public void doFree(DownloadLink downloadLink,boolean resumable,int maxchunks) throws Exception, PluginException {
  String dllink=null;
  String passCode=null;
  if (BRBEFORE.contains("String_Node_Str")) {
    br.postPage(downloadLink.getDownloadURL(),"String_Node_Str" + new Regex(downloadLink.getDownloadURL(),COOKIE_HOST.replace("String_Node_Str","String_Node_Str") + "String_Node_Str" + "String_Node_Str").getMatch(0) + "String_Node_Str"+ Encoding.urlEncode(downloadLink.getName())+ "String_Node_Str");
    doSomething();
  }
  checkErrors(downloadLink,false,passCode);
  String md5hash=new Regex(BRBEFORE,"String_Node_Str").getMatch(0);
  if (md5hash != null) {
    md5hash=md5hash.trim();
    logger.info("String_Node_Str" + md5hash);
    downloadLink.setMD5Hash(md5hash);
  }
  br.setFollowRedirects(false);
  dllink=getDllink();
  if (dllink == null) {
    Form DLForm=br.getFormbyProperty("String_Node_Str","String_Node_Str");
    if (DLForm == null) {
      if (BRBEFORE.contains("String_Node_Str"))       throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE,"String_Node_Str",10 * 60 * 1000l);
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
    long timeBefore=System.currentTimeMillis();
    boolean password=false;
    if (BRBEFORE.contains(PASSWORDTEXT0) || BRBEFORE.contains(PASSWORDTEXT1)) {
      password=true;
      logger.info("String_Node_Str");
    }
    boolean wait=true;
    if (BRBEFORE.contains("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 (BRBEFORE.contains("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;
          break;
        }
      }
      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 (BRBEFORE.contains("String_Node_Str") || BRBEFORE.contains("String_Node_Str")) {
      logger.info("String_Node_Str");
      PluginForHost recplug=JDUtilities.getPluginForHost("String_Node_Str");
      jd.plugins.hoster.DirectHTTP.Recaptcha rc=((DirectHTTP)recplug).getReCaptcha(br);
      rc.findID();
      rc.setForm(DLForm);
      rc.load();
      File cf=rc.downloadCaptcha(getLocalCaptchaFile());
      String c=getCaptchaCode(cf,downloadLink);
      rc.prepareForm(c);
      DLForm=rc.getForm();
      logger.info("String_Node_Str" + c + "String_Node_Str");
    }
    if (password) {
      passCode=handlePassword(passCode,DLForm,downloadLink);
    }
    if (wait)     waitTime(timeBefore,downloadLink);
    br.submitForm(DLForm);
    logger.info("String_Node_Str");
    doSomething();
    checkErrors(downloadLink,true,passCode);
    dllink=getDllink();
    if (dllink == null) {
      logger.warning("String_Node_Str");
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
  }
  logger.info("String_Node_Str" + dllink + "String_Node_Str");
  dl=jd.plugins.BrowserAdapter.openDownload(br,downloadLink,dllink,resumable,maxchunks);
  if (dl.getConnection().getContentType().contains("String_Node_Str")) {
    logger.warning("String_Node_Str");
    br.followConnection();
    checkServerErrors();
    throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
  }
  if (passCode != null) {
    downloadLink.setProperty("String_Node_Str",passCode);
  }
  dl.startDownload();
}

Fixed version (ground truth):
public void doFree(DownloadLink downloadLink,boolean resumable,int maxchunks) throws Exception, PluginException {
  String dllink=null;
  String passCode=null;
  if (BRBEFORE.contains("String_Node_Str")) {
    br.postPage(downloadLink.getDownloadURL(),"String_Node_Str" + new Regex(downloadLink.getDownloadURL(),COOKIE_HOST.replace("String_Node_Str","String_Node_Str") + "String_Node_Str" + "String_Node_Str").getMatch(0) + "String_Node_Str"+ Encoding.urlEncode(downloadLink.getName())+ "String_Node_Str");
    doSomething();
  }
  checkErrors(downloadLink,false,passCode);
  String md5hash=new Regex(BRBEFORE,"String_Node_Str").getMatch(0);
  if (md5hash != null) {
    md5hash=md5hash.trim();
    logger.info("String_Node_Str" + md5hash);
    downloadLink.setMD5Hash(md5hash);
  }
  br.setFollowRedirects(false);
  dllink=getDllink();
  if (dllink == null) {
    Form DLForm=br.getFormbyProperty("String_Node_Str","String_Node_Str");
    if (DLForm == null) {
      if (BRBEFORE.contains("String_Node_Str"))       throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE,"String_Node_Str",10 * 60 * 1000l);
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
    long timeBefore=System.currentTimeMillis();
    boolean password=false;
    if (BRBEFORE.contains(PASSWORDTEXT0) || BRBEFORE.contains(PASSWORDTEXT1)) {
      password=true;
      logger.info("String_Node_Str");
    }
    boolean wait=true;
    if (BRBEFORE.contains("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 (BRBEFORE.contains("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;
          break;
        }
      }
      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 (BRBEFORE.contains("String_Node_Str") || BRBEFORE.contains("String_Node_Str")) {
      logger.info("String_Node_Str");
      PluginForHost recplug=JDUtilities.getPluginForHost("String_Node_Str");
      jd.plugins.hoster.DirectHTTP.Recaptcha rc=((DirectHTTP)recplug).getReCaptcha(br);
      String id=this.br.getRegex("String_Node_Str").getMatch(0);
      rc.setId(id);
      rc.setForm(DLForm);
      rc.load();
      File cf=rc.downloadCaptcha(getLocalCaptchaFile());
      String c=getCaptchaCode(cf,downloadLink);
      rc.prepareForm(c);
      DLForm=rc.getForm();
      logger.info("String_Node_Str" + c + "String_Node_Str");
    }
    if (password) {
      passCode=handlePassword(passCode,DLForm,downloadLink);
    }
    if (wait)     waitTime(timeBefore,downloadLink);
    br.submitForm(DLForm);
    logger.info("String_Node_Str");
    doSomething();
    checkErrors(downloadLink,true,passCode);
    dllink=getDllink();
    if (dllink == null) {
      logger.warning("String_Node_Str");
      throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
    }
  }
  logger.info("String_Node_Str" + dllink + "String_Node_Str");
  dl=jd.plugins.BrowserAdapter.openDownload(br,downloadLink,dllink,resumable,maxchunks);
  if (dl.getConnection().getContentType().contains("String_Node_Str")) {
    logger.warning("String_Node_Str");
    br.followConnection();
    checkServerErrors();
    throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
  }
  if (passCode != null) {
    downloadLink.setProperty("String_Node_Str",passCode);
  }
  dl.startDownload();
}