Program: 20777
Project: 20777
Buggy source:
@Override public void handleFree(final DownloadLink downloadLink) throws Exception {
  String downloadUrl=null;
  String passCode=null;
  passCode=null;
  this.br.setCookiesExclusive(false);
  this.br.forceDebug(true);
  final long waited=System.currentTimeMillis() - FileSonicCom.LAST_FREE_DOWNLOAD;
  if (FileSonicCom.LAST_FREE_DOWNLOAD > 0 && waited < 300000) {
    FileSonicCom.LAST_FREE_DOWNLOAD=0;
    throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,null,600000 - waited);
  }
  this.requestFileInformation(downloadLink);
  passCode=null;
  final String id=new Regex(downloadLink.getDownloadURL(),"String_Node_Str").getMatch(0);
  this.br.postPage("String_Node_Str" + id + "String_Node_Str","String_Node_Str");
  if (br.containsHTML("String_Node_Str")) {
    String size=br.getRegex("String_Node_Str").getMatch(0);
    if (size != null) {
      throw new PluginException(LinkStatus.ERROR_FATAL,"String_Node_Str" + size.trim() + "String_Node_Str");
    }
 else {
      throw new PluginException(LinkStatus.ERROR_FATAL,"String_Node_Str");
    }
  }
  this.removeComments();
  if (this.br.containsHTML("String_Node_Str")) {
    Plugin.logger.info("String_Node_Str");
    this.br.getPage("String_Node_Str" + id + "String_Node_Str");
    this.removeComments();
  }
  this.br.setFollowRedirects(true);
  String re="String_Node_Str";
  downloadUrl=this.br.getRegex(re).getMatch(0);
  if (downloadUrl == null) {
    this.errorHandling(downloadLink);
    final String countDownDelay=this.br.getRegex("String_Node_Str").getMatch(0);
    if (countDownDelay != null) {
      if (Long.parseLong(countDownDelay) > 300) {
        throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,Long.parseLong(countDownDelay) * 1001l);
      }
      this.sleep(Long.parseLong(countDownDelay) * 1001,downloadLink);
      this.br.postPage("String_Node_Str" + id + "String_Node_Str","String_Node_Str");
      this.removeComments();
    }
    if (this.br.containsHTML("String_Node_Str")) {
      final PluginForHost recplug=JDUtilities.getPluginForHost("String_Node_Str");
      final jd.plugins.hoster.DirectHTTP.Recaptcha rc=((DirectHTTP)recplug).getReCaptcha(this.br);
      rc.parse();
      rc.load();
      final File cf=rc.downloadCaptcha(this.getLocalCaptchaFile());
      final String code=this.getCaptchaCode(cf,downloadLink);
      rc.setCode(code);
      if (this.br.containsHTML("String_Node_Str")) {
        throw new PluginException(LinkStatus.ERROR_CAPTCHA);
      }
    }
    if (this.br.containsHTML("String_Node_Str")) {
      if (downloadLink.getStringProperty("String_Node_Str",null) == null) {
        passCode=Plugin.getUserInput(null,downloadLink);
      }
 else {
        passCode=downloadLink.getStringProperty("String_Node_Str",null);
      }
      final Form form=this.br.getForm(0);
      form.put("String_Node_Str",Encoding.urlEncode(passCode));
      this.br.submitForm(form);
    }
    downloadUrl=this.br.getRegex(re).getMatch(0);
  }
  if (downloadUrl == null)   throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
  this.dl=jd.plugins.BrowserAdapter.openDownload(this.br,downloadLink,downloadUrl,true,1);
  if (this.dl.getConnection() != null && this.dl.getConnection().getContentType() != null && (this.dl.getConnection().getContentType().contains("String_Node_Str") || this.dl.getConnection().getContentType().contains("String_Node_Str"))) {
    this.br.followConnection();
    this.errorHandling(downloadLink);
    throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
  }
  if (passCode != null) {
    downloadLink.setProperty("String_Node_Str",passCode);
  }
  this.dl.setFilenameFix(true);
  this.dl.startDownload();
  FileSonicCom.LAST_FREE_DOWNLOAD=System.currentTimeMillis();
}

Fixed version (ground truth):
@Override public void handleFree(final DownloadLink downloadLink) throws Exception {
  String downloadUrl=null;
  String passCode=null;
  passCode=null;
  this.br.setCookiesExclusive(false);
  this.br.forceDebug(true);
  final long waited=System.currentTimeMillis() - FileSonicCom.LAST_FREE_DOWNLOAD;
  if (FileSonicCom.LAST_FREE_DOWNLOAD > 0 && waited < 300000) {
    FileSonicCom.LAST_FREE_DOWNLOAD=0;
    throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,null,600000 - waited);
  }
  this.requestFileInformation(downloadLink);
  passCode=null;
  final String id=new Regex(downloadLink.getDownloadURL(),"String_Node_Str").getMatch(0);
  this.br.postPage("String_Node_Str" + id + "String_Node_Str","String_Node_Str");
  if (br.containsHTML("String_Node_Str")) {
    String size=br.getRegex("String_Node_Str").getMatch(0);
    if (size != null) {
      throw new PluginException(LinkStatus.ERROR_FATAL,JDL.LF("String_Node_Str","String_Node_Str",size.trim()));
    }
 else {
      throw new PluginException(LinkStatus.ERROR_FATAL,JDL.L("String_Node_Str","String_Node_Str"));
    }
  }
  this.removeComments();
  if (br.containsHTML("String_Node_Str")) {
    throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,JDL.L("String_Node_Str","String_Node_Str"),5 * 60 * 1000l);
  }
  this.br.setFollowRedirects(true);
  String re="String_Node_Str";
  downloadUrl=this.br.getRegex(re).getMatch(0);
  if (downloadUrl == null) {
    this.errorHandling(downloadLink);
    final String countDownDelay=this.br.getRegex("String_Node_Str").getMatch(0);
    if (countDownDelay != null) {
      if (Long.parseLong(countDownDelay) > 300) {
        throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,Long.parseLong(countDownDelay) * 1001l);
      }
      this.sleep(Long.parseLong(countDownDelay) * 1001,downloadLink);
      this.br.postPage("String_Node_Str" + id + "String_Node_Str","String_Node_Str");
      this.removeComments();
    }
    if (this.br.containsHTML("String_Node_Str")) {
      final PluginForHost recplug=JDUtilities.getPluginForHost("String_Node_Str");
      final jd.plugins.hoster.DirectHTTP.Recaptcha rc=((DirectHTTP)recplug).getReCaptcha(this.br);
      rc.parse();
      rc.load();
      final File cf=rc.downloadCaptcha(this.getLocalCaptchaFile());
      final String code=this.getCaptchaCode(cf,downloadLink);
      rc.setCode(code);
      if (this.br.containsHTML("String_Node_Str")) {
        throw new PluginException(LinkStatus.ERROR_CAPTCHA);
      }
    }
    if (this.br.containsHTML("String_Node_Str")) {
      if (downloadLink.getStringProperty("String_Node_Str",null) == null) {
        passCode=Plugin.getUserInput(null,downloadLink);
      }
 else {
        passCode=downloadLink.getStringProperty("String_Node_Str",null);
      }
      final Form form=this.br.getForm(0);
      form.put("String_Node_Str",Encoding.urlEncode(passCode));
      this.br.submitForm(form);
    }
    downloadUrl=this.br.getRegex(re).getMatch(0);
  }
  if (downloadUrl == null)   throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
  this.dl=jd.plugins.BrowserAdapter.openDownload(this.br,downloadLink,downloadUrl,true,1);
  if (this.dl.getConnection() != null && this.dl.getConnection().getContentType() != null && (this.dl.getConnection().getContentType().contains("String_Node_Str") || this.dl.getConnection().getContentType().contains("String_Node_Str"))) {
    this.br.followConnection();
    this.errorHandling(downloadLink);
    throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
  }
  if (passCode != null) {
    downloadLink.setProperty("String_Node_Str",passCode);
  }
  this.dl.setFilenameFix(true);
  this.dl.startDownload();
  FileSonicCom.LAST_FREE_DOWNLOAD=System.currentTimeMillis();
}