hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1055725 - in /httpcomponents/httpclient/trunk/httpclient-cache/src: main/java/org/apache/http/client/cache/ main/java/org/apache/http/impl/client/cache/ test/java/org/apache/http/impl/client/cache/
Date Thu, 06 Jan 2011 03:02:16 GMT
Author: sebb
Date: Thu Jan  6 03:02:16 2011
New Revision: 1055725

URL: http://svn.apache.org/viewvc?rev=1055725&view=rev
Log:
Tab police

Modified:
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/client/cache/HttpCacheEntry.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheEntryUpdater.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/Variant.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/WarningValue.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestRFC5861Compliance.java

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/client/cache/HttpCacheEntry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/client/cache/HttpCacheEntry.java?rev=1055725&r1=1055724&r2=1055725&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/client/cache/HttpCacheEntry.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/client/cache/HttpCacheEntry.java
Thu Jan  6 03:02:16 2011
@@ -228,7 +228,7 @@ public class HttpCacheEntry implements S
     public Map<String, String> getVariantMap() {
         if (variantMap == null) {
             throw new UnsupportedOperationException("variant maps not" +
-            		"supported if constructed with deprecated variant set");
+                    "supported if constructed with deprecated variant set");
         }
         return Collections.unmodifiableMap(variantMap);
     }

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=1055725&r1=1055724&r2=1055725&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
Thu Jan  6 03:02:16 2011
@@ -100,12 +100,12 @@ class CacheEntryUpdater {
 
         if (entryAndResponseHaveDateHeader(entry, response)
                 && entryDateHeaderNewerThenResponse(entry, response)) {
-        	// Don't merge headers, keep the entry's headers as they are newer.
-        	return entry.getAllHeaders();
+            // Don't merge headers, keep the entry's headers as they are newer.
+            return entry.getAllHeaders();
         }
 
         List<Header> cacheEntryHeaderList = new ArrayList<Header>(Arrays.asList(entry
-        		.getAllHeaders()));
+                .getAllHeaders()));
         removeCacheHeadersThatMatchResponse(cacheEntryHeaderList, response);
         removeCacheEntry1xxWarnings(cacheEntryHeaderList, entry);
         cacheEntryHeaderList.addAll(Arrays.asList(response.getAllHeaders()));

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java?rev=1055725&r1=1055724&r2=1055725&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java
Thu Jan  6 03:02:16 2011
@@ -666,8 +666,8 @@ public class CachingHttpClient implement
 
     }
 
-	private boolean revalidationResponseIsTooOld(HttpResponse backendResponse,
-			HttpCacheEntry cacheEntry) {
+    private boolean revalidationResponseIsTooOld(HttpResponse backendResponse,
+            HttpCacheEntry cacheEntry) {
         final Header entryDateHeader = cacheEntry.getFirstHeader("Date");
         final Header responseDateHeader = backendResponse.getFirstHeader("Date");
         if (entryDateHeader != null && responseDateHeader != null) {
@@ -682,8 +682,8 @@ public class CachingHttpClient implement
                 // unconditional retry recommended in 13.2.6 of RFC 2616.
             }
         }
-		return false;
-	}
+        return false;
+    }
     
     HttpResponse negotiateResponseFromVariants(HttpHost target,
             HttpRequest request, HttpContext context,
@@ -716,7 +716,7 @@ public class CachingHttpClient implement
         HttpCacheEntry matchedEntry = matchingVariant.getEntry();
         
         if (revalidationResponseIsTooOld(backendResponse, matchedEntry)) {
-        	return retryRequestUnconditionally(target, request, context,
+            return retryRequestUnconditionally(target, request, context,
                     matchedEntry);
         }
         
@@ -740,7 +740,7 @@ public class CachingHttpClient implement
             HttpRequest request, HttpContext context,
             HttpCacheEntry matchedEntry) throws IOException {
         HttpRequest unconditional = conditionalRequestBuilder
-        	.buildUnconditionalRequest(request, matchedEntry);
+            .buildUnconditionalRequest(request, matchedEntry);
         return callBackend(target, unconditional, context);
     }
 
@@ -779,18 +779,18 @@ public class CachingHttpClient implement
             HttpContext context,
             HttpCacheEntry cacheEntry) throws IOException, ProtocolException {
 
-    	HttpRequest conditionalRequest = conditionalRequestBuilder.buildConditionalRequest(request,
cacheEntry);
+        HttpRequest conditionalRequest = conditionalRequestBuilder.buildConditionalRequest(request,
cacheEntry);
 
         Date requestDate = getCurrentDate();
         HttpResponse backendResponse = backend.execute(target, conditionalRequest, context);
         Date responseDate = getCurrentDate();
 
         if (revalidationResponseIsTooOld(backendResponse, cacheEntry)) {
-        	HttpRequest unconditional = conditionalRequestBuilder
-        		.buildUnconditionalRequest(request, cacheEntry);
-        	requestDate = getCurrentDate();
-        	backendResponse = backend.execute(target, unconditional, context);
-        	responseDate = getCurrentDate();
+            HttpRequest unconditional = conditionalRequestBuilder
+                .buildUnconditionalRequest(request, cacheEntry);
+            requestDate = getCurrentDate();
+            backendResponse = backend.execute(target, unconditional, context);
+            responseDate = getCurrentDate();
         }
 
         backendResponse.addHeader("Via", generateViaHeader(backendResponse));
@@ -822,11 +822,11 @@ public class CachingHttpClient implement
                                      backendResponse);
     }
 
-	private boolean staleIfErrorAppliesTo(int statusCode) {
-	    return statusCode == HttpStatus.SC_INTERNAL_SERVER_ERROR  
-        		|| statusCode == HttpStatus.SC_BAD_GATEWAY  
-        		|| statusCode == HttpStatus.SC_SERVICE_UNAVAILABLE  
-        		|| statusCode == HttpStatus.SC_GATEWAY_TIMEOUT;
+    private boolean staleIfErrorAppliesTo(int statusCode) {
+        return statusCode == HttpStatus.SC_INTERNAL_SERVER_ERROR  
+                || statusCode == HttpStatus.SC_BAD_GATEWAY  
+                || statusCode == HttpStatus.SC_SERVICE_UNAVAILABLE  
+                || statusCode == HttpStatus.SC_GATEWAY_TIMEOUT;
     }
 
     HttpResponse handleBackendResponse(

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/Variant.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/Variant.java?rev=1055725&r1=1055724&r2=1055725&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/Variant.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/Variant.java
Thu Jan  6 03:02:16 2011
@@ -31,25 +31,25 @@ import org.apache.http.client.cache.Http
 /** Records a set of information describing a cached variant. */
 class Variant {
 
-	private final String variantKey;
-	private final String cacheKey;
-	private final HttpCacheEntry entry;
+    private final String variantKey;
+    private final String cacheKey;
+    private final HttpCacheEntry entry;
 
-	public Variant(String variantKey, String cacheKey, HttpCacheEntry entry) {
-		this.variantKey = variantKey;
-		this.cacheKey = cacheKey;
-		this.entry = entry;
-	}
+    public Variant(String variantKey, String cacheKey, HttpCacheEntry entry) {
+        this.variantKey = variantKey;
+        this.cacheKey = cacheKey;
+        this.entry = entry;
+    }
 
-	public String getVariantKey() {
-		return variantKey;
-	}
-	
-	public String getCacheKey() {
-		return cacheKey;
-	}
-	
-	public HttpCacheEntry getEntry() {
-		return entry;
-	}
+    public String getVariantKey() {
+        return variantKey;
+    }
+    
+    public String getCacheKey() {
+        return cacheKey;
+    }
+    
+    public HttpCacheEntry getEntry() {
+        return entry;
+    }
 }

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/WarningValue.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/WarningValue.java?rev=1055725&r1=1055724&r2=1055725&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/WarningValue.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/WarningValue.java
Thu Jan  6 03:02:16 2011
@@ -208,7 +208,7 @@ class WarningValue {
             char c = src.charAt(offs);
             if (offs + 1 < src.length() && c == '\\'
                 && isChar(src.charAt(offs+1))) {
-                offs += 2;	// consume quoted-pair
+                offs += 2;    // consume quoted-pair
             } else if (c == '\"') {
                 foundEnd = true;
                 offs++;

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java?rev=1055725&r1=1055724&r2=1055725&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java
Thu Jan  6 03:02:16 2011
@@ -5549,7 +5549,7 @@ public class TestProtocolRequirements ex
 
 
     private void assertValidViaHeader(String via) {
-        //    	Via =  "Via" ":" 1#( received-protocol received-by [ comment ] )
+        //        Via =  "Via" ":" 1#( received-protocol received-by [ comment ] )
         //        received-protocol = [ protocol-name "/" ] protocol-version
         //        protocol-name     = token
         //        protocol-version  = token

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestRFC5861Compliance.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestRFC5861Compliance.java?rev=1055725&r1=1055724&r2=1055725&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestRFC5861Compliance.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestRFC5861Compliance.java
Thu Jan  6 03:02:16 2011
@@ -45,7 +45,7 @@ import org.junit.Test;
  */
 public class TestRFC5861Compliance extends AbstractProtocolTest {
 
-    /*	
+    /*    
      * "The stale-if-error Cache-Control extension indicates that when an
      * error is encountered, a cached stale response MAY be used to satisfy
      * the request, regardless of other freshness information.When used as a 
@@ -62,11 +62,11 @@ public class TestRFC5861Compliance exten
      */
     @Test
     public void testStaleIfErrorInResponseIsTrueReturnsStaleEntryWithWarning()
-    		throws Exception{
+            throws Exception{
         Date tenSecondsAgo = new Date(new Date().getTime() - 10 * 1000L);
         HttpRequest req1 = HttpTestUtils.makeDefaultRequest();
         HttpResponse resp1 = HttpTestUtils.make200Response(tenSecondsAgo,
-        		"public, max-age=5, stale-if-error=60");
+                "public, max-age=5, stale-if-error=60");
         
         backendExpectsAnyRequest().andReturn(resp1);
 
@@ -183,11 +183,11 @@ public class TestRFC5861Compliance exten
     
     @Test
     public void testStaleIfErrorInRequestIsTrueReturnsStaleEntryWithWarning()
-    		throws Exception{
+            throws Exception{
         Date tenSecondsAgo = new Date(new Date().getTime() - 10 * 1000L);
         HttpRequest req1 = HttpTestUtils.makeDefaultRequest();
         HttpResponse resp1 = HttpTestUtils.make200Response(tenSecondsAgo,
-        		"public, max-age=5");
+                "public, max-age=5");
         
         backendExpectsAnyRequest().andReturn(resp1);
 
@@ -207,12 +207,12 @@ public class TestRFC5861Compliance exten
     
     @Test
     public void testStaleIfErrorInResponseIsFalseReturnsError()
-    		throws Exception{
-    	Date now = new Date();
+            throws Exception{
+        Date now = new Date();
         Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
         HttpRequest req1 = HttpTestUtils.makeDefaultRequest();
         HttpResponse resp1 = HttpTestUtils.make200Response(tenSecondsAgo,
-        		"public, max-age=5, stale-if-error=2");
+                "public, max-age=5, stale-if-error=2");
         
         backendExpectsAnyRequest().andReturn(resp1);
 
@@ -232,12 +232,12 @@ public class TestRFC5861Compliance exten
     
     @Test
     public void testStaleIfErrorInRequestIsFalseReturnsError()
-    		throws Exception{
-    	Date now = new Date();
+            throws Exception{
+        Date now = new Date();
         Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
         HttpRequest req1 = HttpTestUtils.makeDefaultRequest();
         HttpResponse resp1 = HttpTestUtils.make200Response(tenSecondsAgo,
-        		"public, max-age=5");
+                "public, max-age=5");
         
         backendExpectsAnyRequest().andReturn(resp1);
 



Mime
View raw message