title: Potential resource leak: 'httpclient' may not be closed at this location
body: <p>Getting the error mentioned in the title in the line </p>
  
  <blockquote>
    <p>return responseXML.toString();</p>
  </blockquote>
  
  <pre><code>HttpClient httpclient = HttpClientBuilder.create().build();
  HttpPost httppost = new HttpPost("test");
  httppost.setHeader("Authorization", "test");
  httppost.setHeader("content-type", "text/html; charset=UTF-8");
  try {
          httppost.setEntity(new UrlEncodedFormEntity(NameValuePairs));
      } catch (UnsupportedEncodingException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      HttpResponse response = null;
      try {
          response = httpclient.execute(httppost);
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
      InputStream inputStream = null;
      try {
          inputStream = response.getEntity().getContent();
      } catch (IllegalStateException | IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
      BufferedReader bufferReader = new BufferedReader(
              new InputStreamReader(inputStream));
  
      StringBuffer responseXML = new StringBuffer();
      String line = "";
      try {
          while ((line = bufferReader.readLine()) != null) {
              responseXML.append(line);
          }
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      try {
          inputStream.close();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      System.out.println( responseXML.toString());
      return responseXML.toString();
  </code></pre>