Program: 185031
Project: 185031
Buggy source:
/** 
 * Attempts to determine whether user input is a URL or search terms.  Anything with a space is passed to search. Converts to lowercase any mistakenly uppercased schema (i.e., "Http://" converts to "http://"
 * @return Original or modified URL
 */
String smartUrlFilter(String url){
  String inUrl=url.trim();
  boolean hasSpace=inUrl.indexOf(' ') != -1;
  Matcher matcher=ACCEPTED_URI_SCHEMA.matcher(inUrl);
  if (matcher.matches()) {
    if (hasSpace) {
      inUrl=inUrl.replace("String_Node_Str","String_Node_Str");
    }
    String scheme=matcher.group(1);
    String lcScheme=scheme.toLowerCase();
    if (!lcScheme.equals(scheme)) {
      return lcScheme + matcher.group(2);
    }
    return inUrl;
  }
  if (hasSpace) {
    if (inUrl.length() > 2 && inUrl.charAt(1) == ' ') {
      char char0=inUrl.charAt(0);
      if (char0 == 'g') {
        Browser.addSearchUrl(mResolver,inUrl);
        return composeSearchUrl(inUrl.substring(2));
      }
 else       if (char0 == 'w') {
        Browser.addSearchUrl(mResolver,inUrl);
        return URLUtil.composeSearchUrl(inUrl.substring(2),QuickSearch_W,QUERY_PLACE_HOLDER);
      }
 else       if (char0 == 'd') {
        Browser.addSearchUrl(mResolver,inUrl);
        return URLUtil.composeSearchUrl(inUrl.substring(2),QuickSearch_D,QUERY_PLACE_HOLDER);
      }
 else       if (char0 == 'l') {
        Browser.addSearchUrl(mResolver,inUrl);
        return URLUtil.composeSearchUrl(inUrl.substring(2),QuickSearch_L,QUERY_PLACE_HOLDER);
      }
    }
  }
 else {
    if (Regex.WEB_URL_PATTERN.matcher(inUrl).matches()) {
      return URLUtil.guessUrl(inUrl);
    }
  }
  Browser.addSearchUrl(mResolver,inUrl);
  return composeSearchUrl(inUrl);
}

Fixed version (ground truth):
/** 
 * Attempts to determine whether user input is a URL or search terms.  Anything with a space is passed to search. Converts to lowercase any mistakenly uppercased schema (i.e., "Http://" converts to "http://"
 * @return Original or modified URL
 */
String smartUrlFilter(String url){
  String inUrl=url.trim();
  boolean hasSpace=inUrl.indexOf(' ') != -1;
  Matcher matcher=ACCEPTED_URI_SCHEMA.matcher(inUrl);
  if (matcher.matches()) {
    String scheme=matcher.group(1);
    String lcScheme=scheme.toLowerCase();
    if (!lcScheme.equals(scheme)) {
      inUrl=lcScheme + matcher.group(2);
    }
    if (hasSpace) {
      inUrl=inUrl.replace("String_Node_Str","String_Node_Str");
    }
    return inUrl;
  }
  if (hasSpace) {
    if (inUrl.length() > 2 && inUrl.charAt(1) == ' ') {
      char char0=inUrl.charAt(0);
      if (char0 == 'g') {
        Browser.addSearchUrl(mResolver,inUrl);
        return composeSearchUrl(inUrl.substring(2));
      }
 else       if (char0 == 'w') {
        Browser.addSearchUrl(mResolver,inUrl);
        return URLUtil.composeSearchUrl(inUrl.substring(2),QuickSearch_W,QUERY_PLACE_HOLDER);
      }
 else       if (char0 == 'd') {
        Browser.addSearchUrl(mResolver,inUrl);
        return URLUtil.composeSearchUrl(inUrl.substring(2),QuickSearch_D,QUERY_PLACE_HOLDER);
      }
 else       if (char0 == 'l') {
        Browser.addSearchUrl(mResolver,inUrl);
        return URLUtil.composeSearchUrl(inUrl.substring(2),QuickSearch_L,QUERY_PLACE_HOLDER);
      }
    }
  }
 else {
    if (Regex.WEB_URL_PATTERN.matcher(inUrl).matches()) {
      return URLUtil.guessUrl(inUrl);
    }
  }
  Browser.addSearchUrl(mResolver,inUrl);
  return composeSearchUrl(inUrl);
}