Program: 20698
Project: 20698
Buggy source:
public boolean checkLinksIntern(final DownloadLink[] urls){
  if (urls == null) {
    return false;
  }
  final ArrayList<DownloadLink> checkurls=new ArrayList<DownloadLink>();
  final ArrayList<DownloadLink> finishedurls=new ArrayList<DownloadLink>();
  for (  final DownloadLink u : urls) {
    checkurls.add(u);
  }
  try {
    for (int retry=0; retry < 3; retry++) {
      final StringBuilder idlist=new StringBuilder();
      final StringBuilder namelist=new StringBuilder();
      checkurls.removeAll(finishedurls);
      for (      final DownloadLink u : checkurls) {
        idlist.append("String_Node_Str").append(Rapidshare.getID(u.getDownloadURL()));
        namelist.append("String_Node_Str").append(this.getName(u));
      }
      final String req="String_Node_Str" + idlist.toString().substring(1) + "String_Node_Str"+ namelist.toString().substring(1)+ "String_Node_Str";
      this.queryAPI(null,req,null);
      if (this.br.containsHTML("String_Node_Str")) {
        logger.warning("String_Node_Str");
        Rapidshare.RS_API_WAIT=System.currentTimeMillis() + 5 * 60 * 1000l;
        return false;
      }
      final String[][] matches=this.br.getRegex("String_Node_Str").getMatches();
      int i=0;
      boolean doretry=false;
      for (      final DownloadLink u : checkurls) {
        finishedurls.add(u);
        if (i > matches.length - 1) {
          doretry=true;
          break;
        }
        u.setDownloadSize(Long.parseLong(matches[i][2]));
        u.setFinalFileName(matches[i][1]);
        if (!"String_Node_Str".equalsIgnoreCase(matches[i][6])) {
          u.setMD5Hash(matches[i][6]);
        }
 else {
          u.setMD5Hash(null);
        }
switch (Integer.parseInt(matches[i][4])) {
case 0:
          if (new Regex(u.getDownloadURL(),"String_Node_Str").matches() && tryWorkaround(u)) {
            finishedurls.remove(u);
            doretry=true;
          }
        u.getLinkStatus().setErrorMessage(JDL.L("String_Node_Str","String_Node_Str"));
      u.getLinkStatus().setStatusText(JDL.L("String_Node_Str","String_Node_Str"));
    u.setAvailable(false);
  break;
case 1:
u.setAvailable(true);
u.getLinkStatus().setStatusText("String_Node_Str");
u.getLinkStatus().setErrorMessage(null);
break;
case 2:
u.setAvailable(true);
u.getLinkStatus().setStatusText(JDL.L("String_Node_Str","String_Node_Str"));
u.getLinkStatus().setErrorMessage(null);
break;
case 3:
u.getLinkStatus().setErrorMessage(JDL.L("String_Node_Str","String_Node_Str"));
u.getLinkStatus().setStatusText(JDL.L("String_Node_Str","String_Node_Str"));
u.setAvailable(false);
break;
case 4:
u.setAvailable(false);
u.getLinkStatus().setErrorMessage(JDL.L("String_Node_Str","String_Node_Str"));
u.getLinkStatus().setStatusText(JDL.L("String_Node_Str","String_Node_Str"));
break;
case 5:
u.setAvailableStatus(AvailableStatus.UNCHECKABLE);
u.getLinkStatus().setErrorMessage(JDL.L("String_Node_Str","String_Node_Str"));
u.getLinkStatus().setStatusText(JDL.L("String_Node_Str","String_Node_Str"));
break;
}
i++;
}
if (!doretry) {
return true;
}
}
return false;
}
 catch (final Exception e) {
if (this.br.containsHTML("String_Node_Str")) {
logger.warning("String_Node_Str");
Rapidshare.RS_API_WAIT=System.currentTimeMillis() + 5 * 60 * 1000l;
}
return false;
}
}

Fixed version (ground truth):
public boolean checkLinksIntern(final DownloadLink[] urls){
  if (urls == null) {
    return false;
  }
  final ArrayList<DownloadLink> checkurls=new ArrayList<DownloadLink>();
  final ArrayList<DownloadLink> finishedurls=new ArrayList<DownloadLink>();
  for (  final DownloadLink u : urls) {
    checkurls.add(u);
  }
  try {
    for (int retry=0; retry < 3; retry++) {
      final StringBuilder idlist=new StringBuilder();
      final StringBuilder namelist=new StringBuilder();
      checkurls.removeAll(finishedurls);
      for (      final DownloadLink u : checkurls) {
        idlist.append("String_Node_Str").append(Rapidshare.getID(u.getDownloadURL()));
        namelist.append("String_Node_Str").append(this.getName(u));
      }
      final String req="String_Node_Str" + idlist.toString().substring(1) + "String_Node_Str"+ namelist.toString().substring(1)+ "String_Node_Str";
      this.queryAPI(null,req,null);
      if (this.br.containsHTML("String_Node_Str")) {
        logger.warning("String_Node_Str");
        Rapidshare.RS_API_WAIT=System.currentTimeMillis() + 5 * 60 * 1000l;
        return false;
      }
      final String[][] matches=this.br.getRegex("String_Node_Str").getMatches();
      int i=0;
      boolean doretry=false;
      for (      final DownloadLink u : checkurls) {
        finishedurls.add(u);
        if (i > matches.length - 1) {
          doretry=true;
          break;
        }
        u.setDownloadSize(Long.parseLong(matches[i][2]));
        u.setFinalFileName(matches[i][1]);
        if (matches[i][6].trim().length() == 32) {
          u.setMD5Hash(matches[i][6]);
        }
 else {
          u.setMD5Hash(null);
        }
switch (Integer.parseInt(matches[i][4])) {
case 0:
          if (new Regex(u.getDownloadURL(),"String_Node_Str").matches() && tryWorkaround(u)) {
            finishedurls.remove(u);
            doretry=true;
          }
        u.getLinkStatus().setErrorMessage(JDL.L("String_Node_Str","String_Node_Str"));
      u.getLinkStatus().setStatusText(JDL.L("String_Node_Str","String_Node_Str"));
    u.setAvailable(false);
  break;
case 1:
u.setAvailable(true);
u.getLinkStatus().setStatusText("String_Node_Str");
u.getLinkStatus().setErrorMessage(null);
break;
case 2:
u.setAvailable(true);
u.getLinkStatus().setStatusText(JDL.L("String_Node_Str","String_Node_Str"));
u.getLinkStatus().setErrorMessage(null);
break;
case 3:
u.getLinkStatus().setErrorMessage(JDL.L("String_Node_Str","String_Node_Str"));
u.getLinkStatus().setStatusText(JDL.L("String_Node_Str","String_Node_Str"));
u.setAvailable(false);
break;
case 4:
u.setAvailable(false);
u.getLinkStatus().setErrorMessage(JDL.L("String_Node_Str","String_Node_Str"));
u.getLinkStatus().setStatusText(JDL.L("String_Node_Str","String_Node_Str"));
break;
case 5:
u.setAvailableStatus(AvailableStatus.UNCHECKABLE);
u.getLinkStatus().setErrorMessage(JDL.L("String_Node_Str","String_Node_Str"));
u.getLinkStatus().setStatusText(JDL.L("String_Node_Str","String_Node_Str"));
break;
}
i++;
}
if (!doretry) {
return true;
}
}
return false;
}
 catch (final Exception e) {
if (this.br.containsHTML("String_Node_Str")) {
logger.warning("String_Node_Str");
Rapidshare.RS_API_WAIT=System.currentTimeMillis() + 5 * 60 * 1000l;
}
return false;
}
}