Program: 86478
Project: 86478
Buggy source:
public <T>T post(final String path,final Object object,final Class<T> type){
  try {
    URL url=new URL(endpoint + path);
    HttpURLConnection conn=(HttpURLConnection)url.openConnection();
    conn.setRequestMethod("String_Node_Str");
    conn.setRequestProperty("String_Node_Str",USER_AGENT);
    conn.setRequestProperty("String_Node_Str","String_Node_Str");
    if (conn instanceof HttpsURLConnection) {
      ((HttpsURLConnection)conn).setSSLSocketFactory(new SSLSupport());
    }
    if (authentication != null) {
      authentication.authenticate(conn);
    }
    conn.setDoOutput(true);
    LOGGER.debug("String_Node_Str",url.toString());
    logHeaders(conn.getRequestProperties().entrySet());
    DataOutputStream wr=new DataOutputStream(conn.getOutputStream());
    wr.writeBytes(gson.toJson(object));
    wr.flush();
    wr.close();
    LOGGER.debug("String_Node_Str");
    int responseCode=conn.getResponseCode();
    LOGGER.debug("String_Node_Str",responseCode,conn.getResponseMessage());
    logHeaders(conn.getHeaderFields().entrySet());
    StringBuilder responseBody=new StringBuilder();
    if (responseCode >= 200 && responseCode < 299) {
      responseBody=readBody(conn.getInputStream());
    }
    if (responseCode >= 400 && responseCode < 499) {
      responseBody=readBody(conn.getErrorStream());
      Errors errors=gson.fromJson(responseBody.toString(),Errors.class);
      throw new ValidationException(responseCode,conn.getResponseMessage(),errors);
    }
    if (responseCode >= 500) {
      throw new UnexpectecException();
    }
    LOGGER.debug("String_Node_Str");
    LOGGER.debug("String_Node_Str",responseBody.toString());
    LOGGER.debug("String_Node_Str",conn.getContentLength());
    return gson.fromJson(responseBody.toString(),type);
  }
 catch (  java.io.IOException e) {
    throw new MoipException("String_Node_Str" + e.getMessage(),e);
  }
catch (  NoSuchAlgorithmException e) {
    throw new MoipException("String_Node_Str" + e.getMessage(),e);
  }
catch (  KeyManagementException e) {
    throw new MoipException("String_Node_Str" + e.getMessage(),e);
  }
}

Fixed version (ground truth):
public <T>T post(final String path,final Object object,final Class<T> type){
  try {
    URL url=new URL(endpoint + path);
    HttpURLConnection conn=(HttpURLConnection)url.openConnection();
    conn.setRequestMethod("String_Node_Str");
    conn.setRequestProperty("String_Node_Str",USER_AGENT);
    conn.setRequestProperty("String_Node_Str","String_Node_Str");
    if (conn instanceof HttpsURLConnection) {
      ((HttpsURLConnection)conn).setSSLSocketFactory(new SSLSupport());
    }
    if (authentication != null) {
      authentication.authenticate(conn);
    }
    conn.setDoOutput(true);
    LOGGER.debug("String_Node_Str",url.toString());
    logHeaders(conn.getRequestProperties().entrySet());
    DataOutputStream wr=new DataOutputStream(conn.getOutputStream());
    wr.writeBytes(gson.toJson(object));
    wr.flush();
    wr.close();
    LOGGER.debug("String_Node_Str");
    int responseCode=conn.getResponseCode();
    LOGGER.debug("String_Node_Str",responseCode,conn.getResponseMessage());
    logHeaders(conn.getHeaderFields().entrySet());
    StringBuilder responseBody=new StringBuilder();
    if (responseCode >= 200 && responseCode < 299) {
      responseBody=readBody(conn.getInputStream());
    }
    if (responseCode >= 400 && responseCode < 499) {
      responseBody=readBody(conn.getErrorStream());
      Errors errors=gson.fromJson(responseBody.toString(),Errors.class);
      throw new ValidationException(responseCode,conn.getResponseMessage(),errors);
    }
    if (responseCode >= 500) {
      throw new UnexpectecException();
    }
    LOGGER.debug("String_Node_Str");
    LOGGER.debug("String_Node_Str",responseBody.toString());
    LOGGER.debug("String_Node_Str",conn.getContentLength());
    return gson.fromJson(responseBody.toString(),type);
  }
 catch (  IOException e) {
    throw new MoipException("String_Node_Str" + e.getMessage(),e);
  }
catch (  NoSuchAlgorithmException e) {
    throw new MoipException("String_Node_Str" + e.getMessage(),e);
  }
catch (  KeyManagementException e) {
    throw new MoipException("String_Node_Str" + e.getMessage(),e);
  }
}