Program: 92375
Project: 92375
Buggy source:
private JSONObject _requestByHost(HttpRequestBase req,String host,String url,String json,HashMap<String,String> errors,boolean searchTimeout) throws AlgoliaException {
  req.reset();
  try {
    req.setURI(new URI("String_Node_Str" + host + url));
  }
 catch (  URISyntaxException e) {
    throw new IllegalStateException(e);
  }
  req.setHeader("String_Node_Str",this.applicationID);
  if (forwardAdminAPIKey == null) {
    req.setHeader("String_Node_Str",this.apiKey);
  }
 else {
    req.setHeader("String_Node_Str",this.forwardAdminAPIKey);
    req.setHeader("String_Node_Str",this.forwardEndUserIP);
    req.setHeader("String_Node_Str",this.forwardRateLimitAPIKey);
  }
  for (  Entry<String,String> entry : headers.entrySet()) {
    req.setHeader(entry.getKey(),entry.getValue());
  }
  req.setHeader("String_Node_Str",userAgent);
  if (json != null) {
    if (!(req instanceof HttpEntityEnclosingRequestBase)) {
      throw new IllegalArgumentException("String_Node_Str" + req.getMethod() + "String_Node_Str");
    }
    req.setHeader("String_Node_Str","String_Node_Str");
    try {
      StringEntity se=new StringEntity(json,"String_Node_Str");
      se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE,"String_Node_Str"));
      ((HttpEntityEnclosingRequestBase)req).setEntity(se);
    }
 catch (    Exception e) {
      throw new AlgoliaException("String_Node_Str" + json);
    }
  }
  RequestConfig config=RequestConfig.custom().setSocketTimeout(searchTimeout ? httpSearchTimeoutMS : httpSocketTimeoutMS).setConnectTimeout(httpConnectTimeoutMS).setConnectionRequestTimeout(httpConnectTimeoutMS).build();
  req.setConfig(config);
  HttpResponse response;
  try {
    response=httpClient.execute(req);
  }
 catch (  IOException e) {
    if (verbose) {
      System.out.println(String.format("String_Node_Str",host,e.getClass().getName(),e.getMessage()));
    }
    errors.put(host,String.format("String_Node_Str",e.getClass().getName(),e.getMessage()));
    return null;
  }
  try {
    int code=response.getStatusLine().getStatusCode();
    if (code / 100 == 4) {
      String message="String_Node_Str";
      try {
        message=EntityUtils.toString(response.getEntity());
      }
 catch (      ParseException e) {
        e.printStackTrace();
      }
catch (      IOException e) {
        e.printStackTrace();
      }
      if (code == 400) {
        throw new AlgoliaException(code,message.length() > 0 ? message : "String_Node_Str");
      }
 else       if (code == 403) {
        throw new AlgoliaException(code,message.length() > 0 ? message : "String_Node_Str");
      }
 else       if (code == 404) {
        throw new AlgoliaException(code,message.length() > 0 ? message : "String_Node_Str");
      }
 else {
        throw new AlgoliaException(code,message.length() > 0 ? message : "String_Node_Str");
      }
    }
    if (code / 100 != 2) {
      try {
        if (verbose) {
          System.out.println(String.format("String_Node_Str",host,EntityUtils.toString(response.getEntity())));
        }
        errors.put(host,EntityUtils.toString(response.getEntity()));
      }
 catch (      IOException e) {
        if (verbose) {
          System.out.println(String.format("String_Node_Str",host,String.valueOf(code)));
        }
        errors.put(host,String.valueOf(code));
      }
      return null;
    }
    try {
      InputStream istream=response.getEntity().getContent();
      InputStreamReader is=new InputStreamReader(istream,"String_Node_Str");
      JSONTokener tokener=new JSONTokener(is);
      JSONObject res=new JSONObject(tokener);
      is.close();
      return res;
    }
 catch (    IOException e) {
      if (verbose) {
        System.out.println(String.format("String_Node_Str",host,e.getClass().getName(),e.getMessage()));
      }
      errors.put(host,String.format("String_Node_Str",e.getClass().getName(),e.getMessage()));
      return null;
    }
catch (    JSONException e) {
      throw new AlgoliaException("String_Node_Str" + e.getMessage());
    }
  }
  finally {
    req.releaseConnection();
  }
}

Fixed version (ground truth):
private JSONObject _requestByHost(HttpRequestBase req,String host,String url,String json,HashMap<String,String> errors,boolean searchTimeout) throws AlgoliaException {
  req.reset();
  try {
    req.setURI(new URI("String_Node_Str" + host + url));
  }
 catch (  URISyntaxException e) {
    throw new IllegalStateException(e);
  }
  req.setHeader("String_Node_Str",this.applicationID);
  if (forwardAdminAPIKey == null) {
    req.setHeader("String_Node_Str",this.apiKey);
  }
 else {
    req.setHeader("String_Node_Str",this.forwardAdminAPIKey);
    req.setHeader("String_Node_Str",this.forwardEndUserIP);
    req.setHeader("String_Node_Str",this.forwardRateLimitAPIKey);
  }
  for (  Entry<String,String> entry : headers.entrySet()) {
    req.setHeader(entry.getKey(),entry.getValue());
  }
  req.setHeader("String_Node_Str",userAgent);
  if (json != null) {
    if (!(req instanceof HttpEntityEnclosingRequestBase)) {
      throw new IllegalArgumentException("String_Node_Str" + req.getMethod() + "String_Node_Str");
    }
    req.setHeader("String_Node_Str","String_Node_Str");
    try {
      StringEntity se=new StringEntity(json,"String_Node_Str");
      se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE,"String_Node_Str"));
      ((HttpEntityEnclosingRequestBase)req).setEntity(se);
    }
 catch (    Exception e) {
      throw new AlgoliaException("String_Node_Str" + json);
    }
  }
  RequestConfig config=RequestConfig.custom().setSocketTimeout(searchTimeout ? httpSearchTimeoutMS : httpSocketTimeoutMS).setConnectTimeout(httpConnectTimeoutMS).setConnectionRequestTimeout(httpConnectTimeoutMS).build();
  req.setConfig(config);
  HttpResponse response;
  try {
    response=httpClient.execute(req);
  }
 catch (  IOException e) {
    if (verbose) {
      System.out.println(String.format("String_Node_Str",host,e.getClass().getName(),e.getMessage()));
    }
    errors.put(host,String.format("String_Node_Str",e.getClass().getName(),e.getMessage()));
    return null;
  }
  try {
    int code=response.getStatusLine().getStatusCode();
    if (code / 100 == 4) {
      String message="String_Node_Str";
      try {
        message=EntityUtils.toString(response.getEntity());
      }
 catch (      ParseException e) {
        e.printStackTrace();
      }
catch (      IOException e) {
        e.printStackTrace();
      }
      if (code == 400) {
        throw new AlgoliaException(code,message.length() > 0 ? message : "String_Node_Str");
      }
 else       if (code == 403) {
        throw new AlgoliaException(code,message.length() > 0 ? message : "String_Node_Str");
      }
 else       if (code == 404) {
        throw new AlgoliaException(code,message.length() > 0 ? message : "String_Node_Str");
      }
 else {
        throw new AlgoliaException(code,message.length() > 0 ? message : "String_Node_Str");
      }
    }
    if (code / 100 != 2) {
      try {
        if (verbose) {
          System.out.println(String.format("String_Node_Str",host,EntityUtils.toString(response.getEntity())));
        }
        errors.put(host,EntityUtils.toString(response.getEntity()));
      }
 catch (      IOException e) {
        if (verbose) {
          System.out.println(String.format("String_Node_Str",host,String.valueOf(code)));
        }
        errors.put(host,String.valueOf(code));
      }
      return null;
    }
    try {
      InputStream istream=response.getEntity().getContent();
      InputStreamReader is=new InputStreamReader(istream,"String_Node_Str");
      String jsonRaw=IOUtils.toString(is);
      JSONObject res=new JSONObject(jsonRaw);
      is.close();
      return res;
    }
 catch (    IOException e) {
      if (verbose) {
        System.out.println(String.format("String_Node_Str",host,e.getClass().getName(),e.getMessage()));
      }
      errors.put(host,String.format("String_Node_Str",e.getClass().getName(),e.getMessage()));
      return null;
    }
catch (    JSONException e) {
      throw new AlgoliaException("String_Node_Str" + e.getMessage());
    }
  }
  finally {
    req.releaseConnection();
  }
}