From 036e71765502f6148c646ba473a4a9d8da7c8ccc Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Mon, 24 Feb 2014 18:48:09 +0000 Subject: [PATCH] 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 --- .../java/org/apache/http/impl/client/cache/BasicHttpCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCache.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCache.java index 705af1b3d..908599c19 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCache.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCache.java @@ -213,7 +213,7 @@ class BasicHttpCache implements HttpCache { CloseableHttpResponse generateIncompleteResponseError( 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 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_BAD_GATEWAY, "Bad Gateway"); error.setHeader("Content-Type","text/plain;charset=UTF-8");