} else if (objectMapper != null) {
this.body = objectMapper.readValue(new String(rawBody, charset), responseClass);
} else {
throw new Exception("Only String, JsonNode and InputStream are supported, or an ObjectMapper implementation is required.");
}
if the objectmapper throw exception or new Exception is throw, the exception is catcher and a new RuntimeException will be throw out.
then the line 110, EntityUtils.consume(responseEntity); will never be executed.
i believe, it should be clean up, before throw the RuntimeException
HttpResponse.java line 101, 103,
} else if (objectMapper != null) { this.body = objectMapper.readValue(new String(rawBody, charset), responseClass); } else { throw new Exception("Only String, JsonNode and InputStream are supported, or an ObjectMapper implementation is required."); }
if the objectmapper throw exception or new Exception is throw, the exception is catcher and a new RuntimeException will be throw out.
then the line 110, EntityUtils.consume(responseEntity); will never be executed.
i believe, it should be clean up, before throw the RuntimeException