We don't need the content length as an int; avoid the boxing

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1571393 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2014-02-24 18:48:09 +00:00
parent 92448db3b4
commit 036e717655
1 changed files with 1 additions and 1 deletions

View File

@ -213,7 +213,7 @@ class BasicHttpCache implements HttpCache {
CloseableHttpResponse generateIncompleteResponseError( CloseableHttpResponse generateIncompleteResponseError(
final HttpResponse response, final Resource resource) { final HttpResponse response, final Resource resource) {
final int contentLength = Integer.parseInt(response.getFirstHeader(HTTP.CONTENT_LEN).getValue()); final Integer contentLength = Integer.valueOf(response.getFirstHeader(HTTP.CONTENT_LEN).getValue());
final HttpResponse error = final HttpResponse error =
new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_BAD_GATEWAY, "Bad Gateway"); new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_BAD_GATEWAY, "Bad Gateway");
error.setHeader("Content-Type","text/plain;charset=UTF-8"); error.setHeader("Content-Type","text/plain;charset=UTF-8");