Program: 14941
Project: 14941
Buggy source:
private String getSelfHostedXmlrpcUrl(String url){
  String xmlrpcUrl=null;
  if (!Charset.forName("String_Node_Str").newEncoder().canEncode(url)) {
    if (url.toLowerCase().startsWith("String_Node_Str")) {
      url="String_Node_Str" + IDN.toASCII(url.substring(7));
    }
 else     if (url.toLowerCase().startsWith("String_Node_Str")) {
      url="String_Node_Str" + IDN.toASCII(url.substring(8));
    }
  }
  if (!(url.toLowerCase().startsWith("String_Node_Str")) && !(url.toLowerCase().startsWith("String_Node_Str"))) {
    url="String_Node_Str" + url;
  }
  if (!URLUtil.isValidUrl(url)) {
    mErrorMsgId=R.string.invalid_url_message;
    return null;
  }
  String rsdUrl=ApiHelper.getRSDMetaTagHrefRegEx(url);
  if (rsdUrl == null) {
    rsdUrl=ApiHelper.getRSDMetaTagHref(url);
  }
  if (rsdUrl != null) {
    xmlrpcUrl=ApiHelper.getXMLRPCUrl(rsdUrl);
    if (xmlrpcUrl == null)     xmlrpcUrl=rsdUrl.replace("String_Node_Str","String_Node_Str");
  }
 else {
    try {
      XMLRPCClient client=new XMLRPCClient(url,mHttpUsername,mHttpPassword);
      try {
        client.call("String_Node_Str");
        xmlrpcUrl=url;
        mIsCustomUrl=true;
      }
 catch (      XMLRPCException e) {
        if (e.getMessage().contains("String_Node_Str")) {
          mHttpAuthRequired=true;
          return null;
        }
        String guessURL=url;
        if (guessURL.substring(guessURL.length() - 1,guessURL.length()).equals("String_Node_Str")) {
          guessURL=guessURL.substring(0,guessURL.length() - 1);
        }
        guessURL+="String_Node_Str";
        client=new XMLRPCClient(guessURL,mHttpUsername,mHttpPassword);
        try {
          client.call("String_Node_Str");
          xmlrpcUrl=guessURL;
        }
 catch (        XMLRPCException ex) {
        }
      }
    }
 catch (    Exception e) {
    }
  }
  return xmlrpcUrl;
}

Fixed version (ground truth):
private String getSelfHostedXmlrpcUrl(String url){
  String xmlrpcUrl=null;
  if (!Charset.forName("String_Node_Str").newEncoder().canEncode(url)) {
    if (url.toLowerCase().startsWith("String_Node_Str")) {
      url="String_Node_Str" + IDN.toASCII(url.substring(7));
    }
 else     if (url.toLowerCase().startsWith("String_Node_Str")) {
      url="String_Node_Str" + IDN.toASCII(url.substring(8));
    }
 else {
      url=IDN.toASCII(url);
    }
  }
  if (!(url.toLowerCase().startsWith("String_Node_Str")) && !(url.toLowerCase().startsWith("String_Node_Str"))) {
    url="String_Node_Str" + url;
  }
  if (!URLUtil.isValidUrl(url)) {
    mErrorMsgId=R.string.invalid_url_message;
    return null;
  }
  String rsdUrl=ApiHelper.getRSDMetaTagHrefRegEx(url);
  if (rsdUrl == null) {
    rsdUrl=ApiHelper.getRSDMetaTagHref(url);
  }
  if (rsdUrl != null) {
    xmlrpcUrl=ApiHelper.getXMLRPCUrl(rsdUrl);
    if (xmlrpcUrl == null)     xmlrpcUrl=rsdUrl.replace("String_Node_Str","String_Node_Str");
  }
 else {
    try {
      XMLRPCClient client=new XMLRPCClient(url,mHttpUsername,mHttpPassword);
      try {
        client.call("String_Node_Str");
        xmlrpcUrl=url;
        mIsCustomUrl=true;
      }
 catch (      XMLRPCException e) {
        if (e.getMessage().contains("String_Node_Str")) {
          mHttpAuthRequired=true;
          return null;
        }
        String guessURL=url;
        if (guessURL.substring(guessURL.length() - 1,guessURL.length()).equals("String_Node_Str")) {
          guessURL=guessURL.substring(0,guessURL.length() - 1);
        }
        guessURL+="String_Node_Str";
        client=new XMLRPCClient(guessURL,mHttpUsername,mHttpPassword);
        try {
          client.call("String_Node_Str");
          xmlrpcUrl=guessURL;
        }
 catch (        XMLRPCException ex) {
        }
      }
    }
 catch (    Exception e) {
    }
  }
  return xmlrpcUrl;
}