Program: 59444
Project: 59444
Buggy source:
/** 
 * Perform a HTTP get request.
 * @param url The url to query.
 * @param headerlines Optional header lines for the request.
 * @return The reply as a string, or null if an error occured.
 */
public synchronized static String httpGet(String url,Map<String,String> headerlines){
  URL requestURL;
  HttpURLConnection connection;
  String agent="String_Node_Str";
  BufferedReader reader;
  String currentLine;
  StringBuffer result=new StringBuffer();
  if (TRUST_ALL_SSL_CERTS && (_trustAllCerts == null)) {
    installAllCertsTruster();
  }
  try {
    requestURL=new URL(url);
  }
 catch (  MalformedURLException me) {
    LogUtils.getInstance().getLogger().error("String_Node_Str" + url);
    return null;
  }
  try {
    connection=(HttpURLConnection)requestURL.openConnection();
    connection.setConnectTimeout(15 * 1000);
  }
 catch (  IOException ioe) {
    LogUtils.getInstance().getLogger().error("String_Node_Str" + url);
    return null;
  }
  connection.setRequestProperty("String_Node_Str",agent);
  if (headerlines != null) {
    for (    Map.Entry<String,String> entry : headerlines.entrySet()) {
      connection.setRequestProperty(entry.getKey(),entry.getValue());
    }
  }
  try {
    connection.setRequestMethod("String_Node_Str");
    reader=new BufferedReader(new InputStreamReader(connection.getInputStream()));
    while ((currentLine=reader.readLine()) != null) {
      result.append(currentLine);
    }
    reader.close();
  }
 catch (  ProtocolException pe) {
    LogUtils.getInstance().getLogger().error("String_Node_Str" + pe.toString());
    result=null;
  }
catch (  IOException ioe) {
    LogUtils.getInstance().getLogger().error("String_Node_Str" + url + "String_Node_Str"+ ioe.toString());
    result=null;
  }
 finally {
    if (connection != null) {
      connection.disconnect();
    }
  }
  return result != null ? result.toString() : null;
}

Fixed version (ground truth):
/** 
 * Perform a HTTP get request.
 * @param url The url to query.
 * @param headerlines Optional header lines for the request.
 * @return The reply as a string, or null if an error occured.
 */
public synchronized static String httpGet(String url,Map<String,String> headerlines){
  URL requestURL;
  HttpURLConnection connection;
  String agent="String_Node_Str";
  BufferedReader reader;
  String currentLine;
  StringBuffer result=new StringBuffer();
  if (TRUST_ALL_SSL_CERTS && (_trustAllCerts == null)) {
    installAllCertsTruster();
  }
  try {
    requestURL=new URL(url);
  }
 catch (  MalformedURLException me) {
    LogUtils.getInstance().getLogger().error("String_Node_Str" + url);
    return null;
  }
  try {
    connection=(HttpURLConnection)requestURL.openConnection();
    connection.setConnectTimeout(15 * 1000);
  }
 catch (  IOException ioe) {
    LogUtils.getInstance().getLogger().error("String_Node_Str" + url);
    return null;
  }
  connection.setRequestProperty("String_Node_Str",agent);
  if (headerlines != null) {
    for (    Map.Entry<String,String> entry : headerlines.entrySet()) {
      connection.setRequestProperty(entry.getKey(),entry.getValue());
    }
  }
  try {
    connection.setRequestMethod("String_Node_Str");
    reader=new BufferedReader(new InputStreamReader(connection.getInputStream()));
    while ((currentLine=reader.readLine()) != null) {
      result.append(currentLine);
    }
    reader.close();
  }
 catch (  FileNotFoundException fnfe) {
    LogUtils.getInstance().getLogger().error("String_Node_Str" + fnfe.toString());
    result=null;
  }
catch (  ProtocolException pe) {
    LogUtils.getInstance().getLogger().error("String_Node_Str" + pe.toString());
    result=null;
  }
catch (  IOException ioe) {
    LogUtils.getInstance().getLogger().error("String_Node_Str" + url + "String_Node_Str"+ ioe.toString());
    result=null;
  }
 finally {
    if (connection != null) {
      connection.disconnect();
    }
  }
  return result != null ? result.toString() : null;
}