Program: 21192
Project: 21192
Buggy source:
public void handleFree(DownloadLink downloadLink) throws Exception {
  if (downloadLink.getDownloadURL().matches("String_Node_Str")) {
    ((PluginForHost)PluginWrapper.getNewInstance("String_Node_Str")).handleFree(downloadLink);
    return;
  }
  if (downloadLink.getLinkType() == DownloadLink.LINKTYPE_CONTAINER) {
    if (Sniffy.hasSniffer())     throw new SnifferException();
  }
  LinkStatus linkStatus=downloadLink.getLinkStatus();
  Rapidshare.correctURL(downloadLink);
  checkMirrorsInProgress(downloadLink);
  String freeOrPremiumSelectPostURL=null;
  Browser br=new Browser();
  br.setAcceptLanguage(ACCEPT_LANGUAGE);
  br.setFollowRedirects(false);
  String link=downloadLink.getDownloadURL();
  br.getPage(link);
  if (br.getRedirectLocation() != null) {
    logger.info("String_Node_Str");
    this.handlePremium(downloadLink,new Account("String_Node_Str","String_Node_Str"));
    return;
  }
  freeOrPremiumSelectPostURL=new Regex(br,PATTERN_FIND_MIRROR_URL).getMatch(0);
  if (freeOrPremiumSelectPostURL == null) {
    String error=null;
    if ((error=findError(br + "String_Node_Str")) != null) {
      throw new PluginException(LinkStatus.ERROR_FATAL,dynTranslate(error));
    }
    reportUnknownError(br,1);
    logger.warning("String_Node_Str");
    throw new PluginException(LinkStatus.ERROR_RETRY);
  }
  Form[] forms=br.getForms();
  br.submitForm(forms[0]);
  String error=null;
  if ((error=findError(br + "String_Node_Str")) != null) {
    if (new Regex(error,"String_Node_Str").matches()) {
      String waitfor=new Regex(br,"String_Node_Str").getMatch(0);
      if (waitfor == null) {
        waitfor=new Regex(br,"String_Node_Str").getMatch(0);
      }
      long waitTime=60 * 60 * 1000l;
      try {
        waitTime=new Long(waitfor.trim()) * 60 * 1000l;
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
      throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,waitTime);
    }
    throw new PluginException(LinkStatus.ERROR_FATAL,dynTranslate(error));
  }
  if (Regex.matches(br,PATTERN_MATCHER_TOO_MANY_USERS)) {
    logger.warning("String_Node_Str");
    throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE,120 * 1000l);
  }
 else   if (new Regex(br,PATTERM_MATCHER_ALREADY_LOADING).matches()) {
    logger.severe("String_Node_Str");
    throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,120 * 1000l);
  }
 else   if ((error=findError(br + "String_Node_Str")) != null) {
    reportUnknownError(br,2);
    throw new PluginException(LinkStatus.ERROR_FATAL,dynTranslate(error));
  }
  String ticketTime=new Regex(br,PATTERN_FIND_TICKET_WAITTIME).getMatch(0);
  if (ticketTime != null && ticketTime.equals("String_Node_Str")) {
    ticketTime=null;
  }
  String ticketCode=br + "String_Node_Str";
  String tt=new Regex(ticketCode,"String_Node_Str").getMatch(0);
  String fun="String_Node_Str" + tt + "String_Node_Str";
  Context cx=Context.enter();
  Scriptable scope=cx.initStandardObjects();
  Object result=cx.evaluateString(scope,fun,"String_Node_Str",1,null);
  String code=Context.toString(result);
  if (tt != null)   ticketCode=code;
  Context.exit();
  if (new Regex(ticketCode,"String_Node_Str").matches()) {
    String waitfor=new Regex(ticketCode,"String_Node_Str").getMatch(0);
    long waitTime=60 * 60 * 1000l;
    try {
      waitTime=new Long(waitfor.trim()) * 60 * 1000l;
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,waitTime);
  }
  long pendingTime=0;
  if (ticketTime != null) {
    pendingTime=Long.parseLong(ticketTime);
    if (getPluginConfig().getIntegerProperty(PROPERTY_INCREASE_TICKET,0) > 0) {
      logger.warning("String_Node_Str" + pendingTime + "String_Node_Str"+ (pendingTime + getPluginConfig().getIntegerProperty(PROPERTY_INCREASE_TICKET,0) * pendingTime / 100));
      pendingTime=pendingTime + getPluginConfig().getIntegerProperty(PROPERTY_INCREASE_TICKET,0) * pendingTime / 100;
    }
    pendingTime*=1000;
  }
  waitTicketTime(downloadLink,pendingTime);
  if (ticketCode.contains("String_Node_Str")) {
    downloadLink.getLinkStatus().setStatusText("String_Node_Str");
    logger.warning("String_Node_Str");
    throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE,120000);
  }
  String postTarget=getDownloadTarget(downloadLink,ticketCode);
  if (linkStatus.isFailed())   return;
  Request request=br.createPostRequest(postTarget,"String_Node_Str" + Math.random() * 40 + "String_Node_Str" + Math.random() * 40);
  dl=new RAFDownload(this,downloadLink,request);
  HTTPConnection con=dl.connect();
  if (!con.isContentDisposition() && con.getHeaderField("String_Node_Str") != null) {
    con.disconnect();
    throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE,10 * 60 * 1000l);
  }
  dl.startDownload();
}

Fixed version (ground truth):
public void handleFree(DownloadLink downloadLink) throws Exception {
  if (downloadLink.getDownloadURL().matches("String_Node_Str")) {
    ((PluginForHost)PluginWrapper.getNewInstance("String_Node_Str")).handleFree(downloadLink);
    return;
  }
  if (downloadLink.getLinkType() == DownloadLink.LINKTYPE_CONTAINER) {
    if (Sniffy.hasSniffer())     throw new SnifferException();
  }
  LinkStatus linkStatus=downloadLink.getLinkStatus();
  Rapidshare.correctURL(downloadLink);
  checkMirrorsInProgress(downloadLink);
  String freeOrPremiumSelectPostURL=null;
  Browser br=new Browser();
  br.setAcceptLanguage(ACCEPT_LANGUAGE);
  br.setFollowRedirects(false);
  String link=downloadLink.getDownloadURL();
  br.getPage(link);
  if (br.getRedirectLocation() != null) {
    logger.info("String_Node_Str");
    this.handlePremium(downloadLink,new Account("String_Node_Str","String_Node_Str"));
    return;
  }
  freeOrPremiumSelectPostURL=new Regex(br,PATTERN_FIND_MIRROR_URL).getMatch(0);
  if (freeOrPremiumSelectPostURL == null) {
    String error=null;
    if ((error=findError(br + "String_Node_Str")) != null) {
      throw new PluginException(LinkStatus.ERROR_FATAL,dynTranslate(error));
    }
    reportUnknownError(br,1);
    logger.warning("String_Node_Str");
    throw new PluginException(LinkStatus.ERROR_RETRY);
  }
  Form[] forms=br.getForms();
  br.submitForm(forms[0]);
  String error=null;
  if ((error=findError(br + "String_Node_Str")) != null) {
    if (new Regex(error,"String_Node_Str").matches()) {
      String waitfor=new Regex(br,"String_Node_Str").getMatch(0);
      if (waitfor == null) {
        waitfor=new Regex(br,"String_Node_Str").getMatch(0);
      }
      long waitTime=60 * 60 * 1000l;
      try {
        waitTime=new Long(waitfor.trim()) * 60 * 1000l;
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
      throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,waitTime);
    }
    throw new PluginException(LinkStatus.ERROR_FATAL,dynTranslate(error));
  }
  if (Regex.matches(br,PATTERN_MATCHER_TOO_MANY_USERS)) {
    logger.warning("String_Node_Str");
    throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE,120 * 1000l);
  }
 else   if (new Regex(br,PATTERM_MATCHER_ALREADY_LOADING).matches()) {
    logger.severe("String_Node_Str");
    throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,120 * 1000l);
  }
 else   if ((error=findError(br + "String_Node_Str")) != null) {
    reportUnknownError(br,2);
    throw new PluginException(LinkStatus.ERROR_FATAL,dynTranslate(error));
  }
  String ticketTime=new Regex(br,PATTERN_FIND_TICKET_WAITTIME).getMatch(0);
  if (ticketTime != null && ticketTime.equals("String_Node_Str")) {
    ticketTime=null;
  }
  String ticketCode=br + "String_Node_Str";
  String tt=new Regex(ticketCode,"String_Node_Str").getMatch(0);
  String fun="String_Node_Str" + tt + "String_Node_Str";
  Context cx=Context.enter();
  Scriptable scope=cx.initStandardObjects();
  Object result=cx.evaluateString(scope,fun,"String_Node_Str",1,null);
  String code=Context.toString(result);
  if (tt != null)   ticketCode=code;
  Context.exit();
  if (ticketCode.contains("String_Node_Str")) {
    downloadLink.getLinkStatus().setStatusText("String_Node_Str");
    logger.warning("String_Node_Str");
    throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE,120000);
  }
  if (new Regex(ticketCode,"String_Node_Str").matches()) {
    String waitfor=new Regex(ticketCode,"String_Node_Str").getMatch(0);
    long waitTime=60 * 60 * 1000l;
    try {
      waitTime=new Long(waitfor.trim()) * 60 * 1000l;
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    throw new PluginException(LinkStatus.ERROR_IP_BLOCKED,waitTime);
  }
  long pendingTime=0;
  if (ticketTime != null) {
    pendingTime=Long.parseLong(ticketTime);
    if (getPluginConfig().getIntegerProperty(PROPERTY_INCREASE_TICKET,0) > 0) {
      logger.warning("String_Node_Str" + pendingTime + "String_Node_Str"+ (pendingTime + getPluginConfig().getIntegerProperty(PROPERTY_INCREASE_TICKET,0) * pendingTime / 100));
      pendingTime=pendingTime + getPluginConfig().getIntegerProperty(PROPERTY_INCREASE_TICKET,0) * pendingTime / 100;
    }
    pendingTime*=1000;
  }
  waitTicketTime(downloadLink,pendingTime);
  String postTarget=getDownloadTarget(downloadLink,ticketCode);
  if (linkStatus.isFailed())   return;
  Request request=br.createPostRequest(postTarget,"String_Node_Str" + Math.random() * 40 + "String_Node_Str" + Math.random() * 40);
  dl=new RAFDownload(this,downloadLink,request);
  HTTPConnection con=dl.connect();
  if (!con.isContentDisposition() && con.getHeaderField("String_Node_Str") != null) {
    con.disconnect();
    throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE,10 * 60 * 1000l);
  }
  dl.startDownload();
}