hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1468823 - in /httpcomponents/httpclient/trunk: RELEASE_NOTES.txt httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCache.java httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheEntryUpdater.java
Date Wed, 17 Apr 2013 10:18:49 GMT
Author: olegk
Date: Wed Apr 17 10:18:48 2013
New Revision: 1468823

URL: http://svn.apache.org/r1468823
Log:
HTTPCLIENT-1299: (regression) cache incorrectly disposes of the underlying cache resource
when storing variant entry (follow-up)
Contributed by James Leigh <james at 3roundstones.com>

Modified:
    httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCache.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheEntryUpdater.java

Modified: httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/RELEASE_NOTES.txt?rev=1468823&r1=1468822&r2=1468823&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/trunk/RELEASE_NOTES.txt Wed Apr 17 10:18:48 2013
@@ -1,6 +1,10 @@
 Changes since release 4.3 BETA1
 -------------------
 
+* [HTTPCLIENT-1299] (regression) cache incorrectly disposes of the underlying cache resource

+  when storing variant entry.
+  Contributed by James Leigh <james at 3roundstones.com> 
+
 * [HTTPCLIENT-1342] Redirects with underscore character in the location hostname cause
   "java.lang.IllegalArgumentException: Host name may not be null".  
   Contributed by Oleg Kalnichevski <olegk at apache.org>

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCache.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCache.java?rev=1468823&r1=1468822&r2=1468823&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCache.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/BasicHttpCache.java
Wed Apr 17 10:18:48 2013
@@ -199,10 +199,9 @@ class BasicHttpCache implements HttpCach
             src = entry;
         }
 
-        final Resource oldResource = entry.getResource();
         Resource resource = null;
-        if (oldResource != null) {
-            resource = resourceFactory.copy(requestId, entry.getResource());
+        if (src.getResource() != null) {
+            resource = resourceFactory.copy(requestId, src.getResource());
         }
         final Map<String,String> variantMap = new HashMap<String,String>(src.getVariantMap());
         variantMap.put(variantKey, variantCacheKey);

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheEntryUpdater.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheEntryUpdater.java?rev=1468823&r1=1468822&r2=1468823&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheEntryUpdater.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheEntryUpdater.java
Wed Apr 17 10:18:48 2013
@@ -87,11 +87,9 @@ class CacheEntryUpdater {
         Args.check(response.getStatusLine().getStatusCode() == HttpStatus.SC_NOT_MODIFIED,
                 "Response must have 304 status code");
         final Header[] mergedHeaders = mergeHeaders(entry, response);
-        final Resource oldResource = entry.getResource();
         Resource resource = null;
-        if (oldResource != null) {
+        if (entry.getResource() != null) {
             resource = resourceFactory.copy(requestId, entry.getResource());
-            oldResource.dispose();
         }
         return new HttpCacheEntry(
                 requestDate,



Mime
View raw message