Program: 21058
Project: 21058
Buggy source:
/** 
 * Sucht alle Links heraus
 * @param data ist der Quelltext einer Html-Datei
 * @param url der Link von dem der Quelltext stammt (um die base automatisch zu setzen)
 * @return Linkliste aus data extrahiert
 */
public static String[] getHttpLinks(String data,String url){
  data=data.trim();
  String protocolPattern="String_Node_Str";
  if (!data.matches("String_Node_Str")) {
    int c=new Regex(data,"String_Node_Str" + protocolPattern + "String_Node_Str").count();
    if (c == 0)     return new String[]{};
 else     if (c == 1 && data.length() < 100 && data.matches("String_Node_Str" + protocolPattern + "String_Node_Str")) {
      String link=data.replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str");
      URLConnectionAdapter con=null;
      try {
        if (!link.matches("String_Node_Str") || (con=new Browser().openGetConnection(link.replaceFirst("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str"))).isOK()) {
          if (con != null)           con.disconnect();
          return new String[]{link.replaceAll("String_Node_Str","String_Node_Str")};
        }
      }
 catch (      Exception e) {
        JDLogger.exception(e);
      }
      if (con != null)       con.disconnect();
    }
  }
  url=url == null ? "String_Node_Str" : url;
  Matcher m;
  String link;
  String basename="String_Node_Str";
  String host="String_Node_Str";
  LinkedList<String> set=new LinkedList<String>();
  Pattern[] basePattern=new Pattern[]{Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE),Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE)};
  for (  Pattern element : basePattern) {
    m=element.matcher(data);
    if (m.find()) {
      url=m.group(2);
      break;
    }
  }
  String pro="String_Node_Str";
  if (url != null && url.trim().length() > 0) {
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    url=url.replace(pro + "String_Node_Str","String_Node_Str");
    int dot=url.lastIndexOf('/');
    if (dot != -1) {
      basename=pro + "String_Node_Str" + url.substring(0,dot + 1);
    }
 else {
      basename=pro + "String_Node_Str" + url+ "String_Node_Str";
    }
    dot=url.indexOf('/');
    if (dot != -1) {
      host=pro + "String_Node_Str" + url.substring(0,dot);
    }
 else {
      host=pro + "String_Node_Str" + url;
    }
    url=pro + "String_Node_Str" + url;
  }
 else {
    url="String_Node_Str";
  }
final class Httppattern {
    public Pattern p;
    public int group;
    public Httppattern(    Pattern p,    int group){
      this.p=p;
      this.group=group;
    }
  }
  Httppattern[] linkAndFormPattern=new Httppattern[]{new Httppattern(Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE | Pattern.DOTALL),1),new Httppattern(Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE | Pattern.DOTALL),1),new Httppattern(Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE | Pattern.DOTALL),3),new Httppattern(Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE | Pattern.DOTALL),2),new Httppattern(Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE | Pattern.DOTALL),2)};
  for (  Httppattern element : linkAndFormPattern) {
    m=element.p.matcher(data);
    while (m.find()) {
      link=m.group(element.group);
      link=link.replaceAll("String_Node_Str","String_Node_Str");
      if (!(link.length() > 3 && link.matches("String_Node_Str" + protocolPattern + "String_Node_Str")) && link.length() > 0) {
        if (link.length() > 2 && link.startsWith("String_Node_Str")) {
          link=pro + "String_Node_Str" + link;
        }
        if (link.charAt(0) == '/') {
          link=host + link;
        }
 else         if (link.charAt(0) == '#') {
          link=url + link;
        }
 else {
          link=basename + link;
        }
      }
      link=link.trim();
      try {
        new URL(link);
        if (!set.contains(link)) {
          set.add(link);
        }
      }
 catch (      MalformedURLException e) {
      }
    }
  }
  data=data.replaceAll("String_Node_Str","String_Node_Str");
  data=data.replaceAll("String_Node_Str","String_Node_Str");
  m=Pattern.compile("String_Node_Str" + protocolPattern + "String_Node_Str"+ protocolPattern+ "String_Node_Str",Pattern.CASE_INSENSITIVE).matcher(data);
  while (m.find()) {
    link=m.group(0);
    link=link.replaceAll("String_Node_Str","String_Node_Str");
    link=link.replaceFirst("String_Node_Str","String_Node_Str");
    link=link.trim();
    if (!set.contains(link)) {
      set.add(link);
    }
  }
  return set.toArray(new String[set.size()]);
}

Fixed version (ground truth):
/** 
 * Sucht alle Links heraus
 * @param data ist der Quelltext einer Html-Datei
 * @param url der Link von dem der Quelltext stammt (um die base automatisch zu setzen)
 * @return Linkliste aus data extrahiert
 */
public static String[] getHttpLinks(String data,String url){
  data=data.trim();
  String protocolPattern="String_Node_Str";
  if (!data.matches("String_Node_Str")) {
    int c=new Regex(data,"String_Node_Str" + protocolPattern + "String_Node_Str").count();
    if (c == 0)     return new String[]{};
 else     if (c == 1 && data.length() < 100 && data.matches("String_Node_Str" + protocolPattern + "String_Node_Str")) {
      String link=data.replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str");
      URLConnectionAdapter con=null;
      try {
        if (!link.matches("String_Node_Str") || (con=new Browser().openGetConnection(link.replaceFirst("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str"))).isOK()) {
          if (con != null)           con.disconnect();
          return new String[]{link.replaceAll("String_Node_Str","String_Node_Str")};
        }
      }
 catch (      Exception e) {
        JDLogger.exception(e);
      }
      if (con != null)       con.disconnect();
    }
  }
  url=url == null ? "String_Node_Str" : url;
  Matcher m;
  String link;
  String basename="String_Node_Str";
  String host="String_Node_Str";
  LinkedList<String> set=new LinkedList<String>();
  Pattern[] basePattern=new Pattern[]{Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE),Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE)};
  for (  Pattern element : basePattern) {
    m=element.matcher(data);
    if (m.find()) {
      url=m.group(2);
      break;
    }
  }
  String pro="String_Node_Str";
  if (url != null && url.trim().length() > 0) {
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    if (url.startsWith("String_Node_Str")) {
      pro="String_Node_Str";
    }
    url=url.replace(pro + "String_Node_Str","String_Node_Str");
    int dot=url.lastIndexOf('/');
    if (dot != -1) {
      basename=pro + "String_Node_Str" + url.substring(0,dot + 1);
    }
 else {
      basename=pro + "String_Node_Str" + url+ "String_Node_Str";
    }
    dot=url.indexOf('/');
    if (dot != -1) {
      host=pro + "String_Node_Str" + url.substring(0,dot);
    }
 else {
      host=pro + "String_Node_Str" + url;
    }
    url=pro + "String_Node_Str" + url;
  }
 else {
    url="String_Node_Str";
  }
final class Httppattern {
    public Pattern p;
    public int group;
    public Httppattern(    Pattern p,    int group){
      this.p=p;
      this.group=group;
    }
  }
  Httppattern[] linkAndFormPattern=new Httppattern[]{new Httppattern(Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE | Pattern.DOTALL),1),new Httppattern(Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE | Pattern.DOTALL),1),new Httppattern(Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE | Pattern.DOTALL),3),new Httppattern(Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE | Pattern.DOTALL),2),new Httppattern(Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE | Pattern.DOTALL),2)};
  for (  Httppattern element : linkAndFormPattern) {
    m=element.p.matcher(data);
    while (m.find()) {
      link=m.group(element.group);
      link=link.replaceAll("String_Node_Str","String_Node_Str");
      if (!(link.length() > 3 && link.matches("String_Node_Str" + protocolPattern + "String_Node_Str")) && link.length() > 0) {
        if (link.length() > 2 && link.startsWith("String_Node_Str")) {
          link=pro + "String_Node_Str" + link;
        }
        if (link.charAt(0) == '/') {
          link=host + link;
        }
 else         if (link.charAt(0) == '#') {
          link=url + link;
        }
 else {
          link=basename + link;
        }
      }
      link=link.trim();
      try {
        new URL(link);
        if (!set.contains(link)) {
          set.add(link);
        }
      }
 catch (      MalformedURLException e) {
      }
    }
  }
  data=data.replaceAll("String_Node_Str","String_Node_Str");
  data=data.replaceAll("String_Node_Str","String_Node_Str");
  m=Pattern.compile("String_Node_Str" + protocolPattern + "String_Node_Str"+ protocolPattern+ "String_Node_Str",Pattern.CASE_INSENSITIVE).matcher(data);
  while (m.find()) {
    link=m.group(0);
    link=link.replaceAll("String_Node_Str","String_Node_Str");
    link=link.replaceFirst("String_Node_Str","String_Node_Str");
    link=link.trim();
    if (!set.contains(link)) {
      set.add(link);
    }
  }
  return set.toArray(new String[set.size()]);
}