Program: 152778
Project: 152778
Buggy source:
/** 
 * Send the data via http post
 * @param message
 * @throws IOException
 */
private int sendData(List<Entry> messages) throws IOException {
  URL url=new URL(logglyUrl);
  Proxy proxy=Proxy.NO_PROXY;
  if (proxyHost != null) {
    SocketAddress addr=new InetSocketAddress(proxyHost,proxyPort);
    proxy=new Proxy(Proxy.Type.HTTP,addr);
  }
  URLConnection conn=url.openConnection(proxy);
  conn.setDoOutput(true);
  conn.setDoInput(true);
  conn.setUseCaches(false);
  conn.setRequestProperty("String_Node_Str","String_Node_Str");
  OutputStreamWriter wr=new OutputStreamWriter(conn.getOutputStream());
  for (  Entry message : messages) {
    if (message.getMessage().getBytes().length < 5200)     wr.write(message.getMessage());
 else     LogLog.warn("String_Node_Str");
  }
  wr.flush();
  wr.close();
  HttpURLConnection huc=((HttpURLConnection)conn);
  int respCode=huc.getResponseCode();
  BufferedReader in=null;
  StringBuffer response=null;
  try {
    in=new BufferedReader(new InputStreamReader(conn.getInputStream()));
    response=new StringBuffer();
    int value=-1;
    while ((value=in.read()) != -1) {
      response.append((char)value);
    }
    in.close();
  }
 catch (  IOException e) {
    try {
      response=new StringBuffer();
      response.append("String_Node_Str").append(respCode).append("String_Node_Str");
      in=new BufferedReader(new InputStreamReader(huc.getErrorStream()));
      int value=-1;
      while ((value=in.read()) != -1) {
        response.append((char)value);
      }
      in.close();
      errorHandler.error(String.format("String_Node_Str",logglyUrl,response));
    }
 catch (    IOException ee) {
      errorHandler.error(String.format("String_Node_Str",logglyUrl),e,2);
    }
  }
  return respCode;
}

Fixed version (ground truth):
/** 
 * Send the data via http post
 * @param message
 * @throws IOException
 */
private int sendData(List<Entry> messages) throws IOException {
  URL url=new URL(logglyUrl);
  Proxy proxy=Proxy.NO_PROXY;
  if (proxyHost != null) {
    SocketAddress addr=new InetSocketAddress(proxyHost,proxyPort);
    proxy=new Proxy(Proxy.Type.HTTP,addr);
  }
  URLConnection conn=url.openConnection(proxy);
  conn.setDoOutput(true);
  conn.setDoInput(true);
  conn.setUseCaches(false);
  conn.setRequestProperty("String_Node_Str","String_Node_Str");
  OutputStream os=conn.getOutputStream();
  for (  Entry message : messages) {
    final byte[] msgBytes=message.getMessage().getBytes();
    if (msgBytes.length < 5200) {
      conn.getOutputStream().write(msgBytes);
    }
 else {
      LogLog.warn("String_Node_Str" + msgBytes);
    }
  }
  os.flush();
  os.close();
  HttpURLConnection huc=((HttpURLConnection)conn);
  int respCode=huc.getResponseCode();
  BufferedReader in=null;
  StringBuffer response=null;
  try {
    in=new BufferedReader(new InputStreamReader(conn.getInputStream()));
    response=new StringBuffer();
    int value=-1;
    while ((value=in.read()) != -1) {
      response.append((char)value);
    }
    in.close();
  }
 catch (  IOException e) {
    try {
      response=new StringBuffer();
      response.append("String_Node_Str").append(respCode).append("String_Node_Str");
      in=new BufferedReader(new InputStreamReader(huc.getErrorStream()));
      int value=-1;
      while ((value=in.read()) != -1) {
        response.append((char)value);
      }
      in.close();
      errorHandler.error(String.format("String_Node_Str",logglyUrl,response));
    }
 catch (    IOException ee) {
      errorHandler.error(String.format("String_Node_Str",logglyUrl),e,2);
    }
  }
  return respCode;
}