hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1433390 [1/3] - in /httpcomponents: contrib/httpcore/trunk/src/main/java/org/apache/http/contrib/sip/ httpasyncclient/trunk/httpasyncclient-cache/src/main/java/org/apache/http/impl/client/cache/ httpasyncclient/trunk/httpasyncclient/src/ma...
Date Tue, 15 Jan 2013 13:12:03 GMT
Author: ggregory
Date: Tue Jan 15 13:12:01 2013
New Revision: 1433390

URL: http://svn.apache.org/viewvc?rev=1433390&view=rev
Log:
Convert control statement bodies to block.

Modified:
    httpcomponents/contrib/httpcore/trunk/src/main/java/org/apache/http/contrib/sip/BasicCompactHeader.java
    httpcomponents/contrib/httpcore/trunk/src/main/java/org/apache/http/contrib/sip/BufferedCompactHeader.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpAsyncClient.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/scheme/AsyncScheme.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/scheme/AsyncSchemeRegistry.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/localserver/EchoHandler.java
    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/CacheInvalidator.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheKeyGenerator.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheValidityPolicy.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedHttpResponseGenerator.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.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/RequestProtocolCompliance.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseCachingPolicy.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseProtocolCompliance.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/WarningValue.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedHttpCacheStorage.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/HttpTestUtils.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/RequestEquivalent.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheEntrySerializers.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/memcached/TestMemcachedHttpCacheStorage.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/BasicUserPrincipal.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/NTCredentials.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/NTUserPrincipal.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/UsernamePasswordCredentials.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/Rfc3492Idn.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/BasicManagedEntity.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/EofSensorInputStream.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/MultihomePlainSocketFactory.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/routing/BasicRouteDirector.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoute.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/routing/RouteTracker.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/scheme/Scheme.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/scheme/SchemeSocketFactoryAdaptor.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/scheme/SocketFactoryAdaptor.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AIMDBackoffManager.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractClientConnAdapter.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ProxySelectorRoutePlanner.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/AbstractConnPool.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThreadAborter.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DateUtils.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/PublicSuffixFilter.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/PublicSuffixListParser.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/BackoffStrategyExec.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/TestScheme.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/routing/TestRouteTracker.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/auth/TestNTLMEngineImpl.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestAIMDBackoffManager.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestDecompressingHttpClient.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestDefaultBackoffStrategy.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestConnectionManagement.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/EchoHandler.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/LocalTestServer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestIdentityDecoder.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestLengthDelimitedDecoder.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/HttpHost.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultConnectionReuseStrategy.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/EnglishReasonPhraseCatalog.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/ChunkedOutputStream.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderElement.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderIterator.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueFormatter.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueParser.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineFormatter.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineParser.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicListHeaderIterator.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicNameValuePair.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicTokenIterator.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/RouteSpecificPool.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/BasicHttpProcessor.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/VersionInfo.java

Modified: httpcomponents/contrib/httpcore/trunk/src/main/java/org/apache/http/contrib/sip/BasicCompactHeader.java
URL: http://svn.apache.org/viewvc/httpcomponents/contrib/httpcore/trunk/src/main/java/org/apache/http/contrib/sip/BasicCompactHeader.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/contrib/httpcore/trunk/src/main/java/org/apache/http/contrib/sip/BasicCompactHeader.java (original)
+++ httpcomponents/contrib/httpcore/trunk/src/main/java/org/apache/http/contrib/sip/BasicCompactHeader.java Tue Jan 15 13:12:01 2013
@@ -80,8 +80,9 @@ public class BasicCompactHeader extends 
         BasicCompactHeader newHeader(final String name, final String value,
                                      CompactHeaderMapper mapper) {
         Args.notNull(name, "Name");
-        if (mapper == null)
-            mapper = BasicCompactHeaderMapper.DEFAULT;
+        if (mapper == null) {
+			mapper = BasicCompactHeaderMapper.DEFAULT;
+		}
 
         final String altname = mapper.getAlternateName(name);
 

Modified: httpcomponents/contrib/httpcore/trunk/src/main/java/org/apache/http/contrib/sip/BufferedCompactHeader.java
URL: http://svn.apache.org/viewvc/httpcomponents/contrib/httpcore/trunk/src/main/java/org/apache/http/contrib/sip/BufferedCompactHeader.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/contrib/httpcore/trunk/src/main/java/org/apache/http/contrib/sip/BufferedCompactHeader.java (original)
+++ httpcomponents/contrib/httpcore/trunk/src/main/java/org/apache/http/contrib/sip/BufferedCompactHeader.java Tue Jan 15 13:12:01 2013
@@ -90,8 +90,9 @@ public class BufferedCompactHeader
                 ("Missing header name.\n" + buffer.toString());
         }
 
-        if (mapper == null)
-            mapper = BasicCompactHeaderMapper.DEFAULT;
+        if (mapper == null) {
+			mapper = BasicCompactHeaderMapper.DEFAULT;
+		}
         final String altname = mapper.getAlternateName(name);
 
         String fname = name;

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpAsyncClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpAsyncClient.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpAsyncClient.java (original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpAsyncClient.java Tue Jan 15 13:12:01 2013
@@ -555,7 +555,9 @@ public class CachingHttpAsyncClient impl
                         int maxstale = Integer.parseInt(elt.getValue());
                         long age = this.validityPolicy.getCurrentAgeSecs(entry, now);
                         long lifetime = this.validityPolicy.getFreshnessLifetimeSecs(entry);
-                        if (age - lifetime > maxstale) return true;
+                        if (age - lifetime > maxstale) {
+							return true;
+						}
                     } catch (NumberFormatException nfe) {
                         return true;
                     }
@@ -614,14 +616,17 @@ public class CachingHttpAsyncClient impl
     boolean clientRequestsOurOptions(HttpRequest request) {
         RequestLine line = request.getRequestLine();
 
-        if (!HeaderConstants.OPTIONS_METHOD.equals(line.getMethod()))
-            return false;
-
-        if (!"*".equals(line.getUri()))
-            return false;
-
-        if (!"0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue()))
-            return false;
+        if (!HeaderConstants.OPTIONS_METHOD.equals(line.getMethod())) {
+			return false;
+		}
+
+        if (!"*".equals(line.getUri())) {
+			return false;
+		}
+
+        if (!"0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue())) {
+			return false;
+		}
 
         return true;
     }
@@ -662,7 +667,9 @@ public class CachingHttpAsyncClient impl
             try {
                 Date entryDate = DateUtils.parseDate(entryDateHeader.getValue());
                 Date respDate = DateUtils.parseDate(responseDateHeader.getValue());
-                if (respDate.before(entryDate)) return true;
+                if (respDate.before(entryDate)) {
+					return true;
+				}
             } catch (DateParseException e) {
                 // either backend response or cached entry did not have a valid
                 // Date header, so we can't tell if they are out of order
@@ -972,11 +979,17 @@ public class CachingHttpAsyncClient impl
         } catch (IOException ioe) {
             // nop
         }
-        if (existing == null) return false;
+        if (existing == null) {
+			return false;
+		}
         Header entryDateHeader = existing.getFirstHeader("Date");
-        if (entryDateHeader == null) return false;
+        if (entryDateHeader == null) {
+			return false;
+		}
         Header responseDateHeader = backendResponse.getFirstHeader("Date");
-        if (responseDateHeader == null) return false;
+        if (responseDateHeader == null) {
+			return false;
+		}
         try {
             Date entryDate = DateUtils.parseDate(entryDateHeader.getValue());
             Date responseDate = DateUtils.parseDate(responseDateHeader.getValue());

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/scheme/AsyncScheme.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/scheme/AsyncScheme.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/scheme/AsyncScheme.java (original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/scheme/AsyncScheme.java Tue Jan 15 13:12:01 2013
@@ -91,7 +91,9 @@ public final class AsyncScheme {
 
     @Override
     public final boolean equals(Object obj) {
-        if (this == obj) return true;
+        if (this == obj) {
+			return true;
+		}
         if (obj instanceof AsyncScheme) {
             AsyncScheme that = (AsyncScheme) obj;
             return this.name.equals(that.name)

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/scheme/AsyncSchemeRegistry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/scheme/AsyncSchemeRegistry.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/scheme/AsyncSchemeRegistry.java (original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/scheme/AsyncSchemeRegistry.java Tue Jan 15 13:12:01 2013
@@ -97,8 +97,9 @@ public final class AsyncSchemeRegistry {
      *          <code>null</code> if there is none by this name
      */
     public final AsyncScheme get(String name) {
-        if (name == null)
-            throw new IllegalArgumentException("Name must not be null.");
+        if (name == null) {
+			throw new IllegalArgumentException("Name must not be null.");
+		}
 
         // leave it to the caller to use the correct name - all lowercase
         //name = name.toLowerCase();
@@ -117,8 +118,9 @@ public final class AsyncSchemeRegistry {
      *          <code>null</code> if none was registered
      */
     public final AsyncScheme register(AsyncScheme sch) {
-        if (sch == null)
-            throw new IllegalArgumentException("Scheme must not be null.");
+        if (sch == null) {
+			throw new IllegalArgumentException("Scheme must not be null.");
+		}
 
         AsyncScheme old = registeredSchemes.put(sch.getName(), sch);
         return old;
@@ -133,8 +135,9 @@ public final class AsyncSchemeRegistry {
      *          <code>null</code> if there was none
      */
     public final AsyncScheme unregister(String name) {
-        if (name == null)
-            throw new IllegalArgumentException("Name must not be null.");
+        if (name == null) {
+			throw new IllegalArgumentException("Name must not be null.");
+		}
 
         // leave it to the caller to use the correct name - all lowercase
         //name = name.toLowerCase();

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/localserver/EchoHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/localserver/EchoHandler.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/localserver/EchoHandler.java (original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/localserver/EchoHandler.java Tue Jan 15 13:12:01 2013
@@ -75,8 +75,9 @@ public class EchoHandler
         }
 
         HttpEntity entity = null;
-        if (request instanceof HttpEntityEnclosingRequest)
-            entity = ((HttpEntityEnclosingRequest)request).getEntity();
+        if (request instanceof HttpEntityEnclosingRequest) {
+			entity = ((HttpEntityEnclosingRequest)request).getEntity();
+		}
 
         // For some reason, just putting the incoming entity into
         // the response will not work. We have to buffer the message.

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=1433390&r1=1433389&r2=1433390&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 Tue Jan 15 13:12:01 2013
@@ -161,7 +161,9 @@ class BasicHttpCache implements HttpCach
             return false;
         }
         Header hdr = resp.getFirstHeader(HTTP.CONTENT_LEN);
-        if (hdr == null) return false;
+        if (hdr == null) {
+			return false;
+		}
         int contentLength;
         try {
             contentLength = Integer.parseInt(hdr.getValue());
@@ -281,10 +283,16 @@ class BasicHttpCache implements HttpCach
 
     public HttpCacheEntry getCacheEntry(HttpHost host, HttpRequest request) throws IOException {
         HttpCacheEntry root = storage.getEntry(uriExtractor.getURI(host, request));
-        if (root == null) return null;
-        if (!root.hasVariants()) return root;
+        if (root == null) {
+			return null;
+		}
+        if (!root.hasVariants()) {
+			return root;
+		}
         String variantCacheKey = root.getVariantMap().get(uriExtractor.getVariantKey(request, root));
-        if (variantCacheKey == null) return null;
+        if (variantCacheKey == null) {
+			return null;
+		}
         return storage.getEntry(variantCacheKey);
     }
 
@@ -297,7 +305,9 @@ class BasicHttpCache implements HttpCach
             throws IOException {
         Map<String,Variant> variants = new HashMap<String,Variant>();
         HttpCacheEntry root = storage.getEntry(uriExtractor.getURI(host, request));
-        if (root == null || !root.hasVariants()) return variants;
+        if (root == null || !root.hasVariants()) {
+			return variants;
+		}
         for(Map.Entry<String, String> variant : root.getVariantMap().entrySet()) {
             String variantKey = variant.getKey();
             String variantCacheKey = variant.getValue();
@@ -310,9 +320,13 @@ class BasicHttpCache implements HttpCach
             String variantCacheKey, Map<String, Variant> variants)
             throws IOException {
         HttpCacheEntry entry = storage.getEntry(variantCacheKey);
-        if (entry == null) return;
+        if (entry == null) {
+			return;
+		}
         Header etagHeader = entry.getFirstHeader(HeaderConstants.ETAG);
-        if (etagHeader == null) return;
+        if (etagHeader == null) {
+			return;
+		}
         variants.put(etagHeader.getValue(), new Variant(variantKey, variantCacheKey, entry));
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheInvalidator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheInvalidator.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheInvalidator.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheInvalidator.java Tue Jan 15 13:12:01 2013
@@ -134,7 +134,9 @@ class CacheInvalidator {
 
     protected void flushUriIfSameHost(URL requestURL, URL targetURL) {
         URL canonicalTarget = getAbsoluteURL(cacheKeyGenerator.canonicalizeUri(targetURL.toString()));
-        if (canonicalTarget == null) return;
+        if (canonicalTarget == null) {
+			return;
+		}
         if (canonicalTarget.getAuthority().equalsIgnoreCase(requestURL.getAuthority())) {
             flushEntry(canonicalTarget.toString());
         }
@@ -142,14 +144,18 @@ class CacheInvalidator {
 
     protected void flushRelativeUriFromSameHost(URL reqURL, String relUri) {
         URL relURL = getRelativeURL(reqURL, relUri);
-        if (relURL == null) return;
+        if (relURL == null) {
+			return;
+		}
         flushUriIfSameHost(reqURL, relURL);
     }
 
 
     protected boolean flushAbsoluteUriFromSameHost(URL reqURL, String uri) {
         URL absURL = getAbsoluteURL(uri);
-        if (absURL == null) return false;
+        if (absURL == null) {
+			return false;
+		}
         flushUriIfSameHost(reqURL,absURL);
         return true;
     }
@@ -190,30 +196,46 @@ class CacheInvalidator {
     public void flushInvalidatedCacheEntries(HttpHost host,
             HttpRequest request, HttpResponse response) {
         int status = response.getStatusLine().getStatusCode();
-        if (status < 200 || status > 299) return;
+        if (status < 200 || status > 299) {
+			return;
+		}
         URL reqURL = getAbsoluteURL(cacheKeyGenerator.getURI(host, request));
-        if (reqURL == null) return;
+        if (reqURL == null) {
+			return;
+		}
         URL canonURL = getContentLocationURL(reqURL, response);
-        if (canonURL == null) return;
+        if (canonURL == null) {
+			return;
+		}
         String cacheKey = cacheKeyGenerator.canonicalizeUri(canonURL.toString());
         HttpCacheEntry entry = getEntry(cacheKey);
-        if (entry == null) return;
+        if (entry == null) {
+			return;
+		}
 
         // do not invalidate if response is strictly older than entry
         // or if the etags match
 
-        if (responseDateOlderThanEntryDate(response, entry)) return;
-        if (!responseAndEntryEtagsDiffer(response, entry)) return;
+        if (responseDateOlderThanEntryDate(response, entry)) {
+			return;
+		}
+        if (!responseAndEntryEtagsDiffer(response, entry)) {
+			return;
+		}
 
         flushUriIfSameHost(reqURL, canonURL);
     }
 
     private URL getContentLocationURL(URL reqURL, HttpResponse response) {
         Header clHeader = response.getFirstHeader("Content-Location");
-        if (clHeader == null) return null;
+        if (clHeader == null) {
+			return null;
+		}
         String contentLocation = clHeader.getValue();
         URL canonURL = getAbsoluteURL(contentLocation);
-        if (canonURL != null) return canonURL;
+        if (canonURL != null) {
+			return canonURL;
+		}
         return getRelativeURL(reqURL, contentLocation);
     }
 
@@ -221,7 +243,9 @@ class CacheInvalidator {
             HttpCacheEntry entry) {
         Header entryEtag = entry.getFirstHeader(HeaderConstants.ETAG);
         Header responseEtag = response.getFirstHeader(HeaderConstants.ETAG);
-        if (entryEtag == null || responseEtag == null) return false;
+        if (entryEtag == null || responseEtag == null) {
+			return false;
+		}
         return (!entryEtag.getValue().equals(responseEtag.getValue()));
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheKeyGenerator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheKeyGenerator.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheKeyGenerator.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheKeyGenerator.java Tue Jan 15 13:12:01 2013
@@ -74,7 +74,9 @@ class CacheKeyGenerator {
             String hostname = u.getHost().toLowerCase();
             int port = canonicalizePort(u.getPort(), protocol);
             String path = canonicalizePath(u.getPath());
-            if ("".equals(path)) path = "/";
+            if ("".equals(path)) {
+				path = "/";
+			}
             String query = u.getQuery();
             String file = (query != null) ? (path + "?" + query) : path;
             URL out = new URL(protocol, hostname, port, file);
@@ -109,8 +111,9 @@ class CacheKeyGenerator {
     }
 
     protected String getFullHeaderValue(Header[] headers) {
-        if (headers == null)
-            return "";
+        if (headers == null) {
+			return "";
+		}
 
         StringBuilder buf = new StringBuilder("");
         boolean first = true;
@@ -136,7 +139,9 @@ class CacheKeyGenerator {
      * @return String the extracted variant URI
      */
     public String getVariantURI(HttpHost host, HttpRequest req, HttpCacheEntry entry) {
-        if (!entry.hasVariants()) return getURI(host, req);
+        if (!entry.hasVariants()) {
+			return getURI(host, req);
+		}
         return getVariantKey(req, entry) + getURI(host, req);
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheValidityPolicy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheValidityPolicy.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheValidityPolicy.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheValidityPolicy.java Tue Jan 15 13:12:01 2013
@@ -56,16 +56,19 @@ class CacheValidityPolicy {
 
     public long getFreshnessLifetimeSecs(final HttpCacheEntry entry) {
         long maxage = getMaxAge(entry);
-        if (maxage > -1)
-            return maxage;
+        if (maxage > -1) {
+			return maxage;
+		}
 
         Date dateValue = getDateValue(entry);
-        if (dateValue == null)
-            return 0L;
+        if (dateValue == null) {
+			return 0L;
+		}
 
         Date expiry = getExpirationDate(entry);
-        if (expiry == null)
-            return 0;
+        if (expiry == null) {
+			return 0;
+		}
         long diff = expiry.getTime() - dateValue.getTime();
         return (diff / 1000);
     }
@@ -99,8 +102,9 @@ class CacheValidityPolicy {
 
         if (dateValue != null && lastModifiedValue != null) {
             long diff = dateValue.getTime() - lastModifiedValue.getTime();
-            if (diff < 0)
-                return 0;
+            if (diff < 0) {
+				return 0;
+			}
             return (long)(coefficient * (diff / 1000));
         }
 
@@ -170,8 +174,9 @@ class CacheValidityPolicy {
 
     protected Date getDateValue(final HttpCacheEntry entry) {
         Header dateHdr = entry.getFirstHeader(HTTP.DATE_HEADER);
-        if (dateHdr == null)
-            return null;
+        if (dateHdr == null) {
+			return null;
+		}
         try {
             return DateUtils.parseDate(dateHdr.getValue());
         } catch (DateParseException dpe) {
@@ -182,8 +187,9 @@ class CacheValidityPolicy {
 
     protected Date getLastModifiedValue(final HttpCacheEntry entry) {
         Header dateHdr = entry.getFirstHeader(HeaderConstants.LAST_MODIFIED);
-        if (dateHdr == null)
-            return null;
+        if (dateHdr == null) {
+			return null;
+		}
         try {
             return DateUtils.parseDate(dateHdr.getValue());
         } catch (DateParseException dpe) {
@@ -194,8 +200,9 @@ class CacheValidityPolicy {
 
     protected long getContentLengthValue(final HttpCacheEntry entry) {
         Header cl = entry.getFirstHeader(HTTP.CONTENT_LEN);
-        if (cl == null)
-            return -1;
+        if (cl == null) {
+			return -1;
+		}
 
         try {
             return Long.parseLong(cl.getValue());
@@ -221,11 +228,13 @@ class CacheValidityPolicy {
 
     protected long getApparentAgeSecs(final HttpCacheEntry entry) {
         Date dateValue = getDateValue(entry);
-        if (dateValue == null)
-            return MAX_AGE;
+        if (dateValue == null) {
+			return MAX_AGE;
+		}
         long diff = entry.getResponseDate().getTime() - dateValue.getTime();
-        if (diff < 0L)
-            return 0;
+        if (diff < 0L) {
+			return 0;
+		}
         return (diff / 1000);
     }
 
@@ -289,8 +298,9 @@ class CacheValidityPolicy {
 
     protected Date getExpirationDate(final HttpCacheEntry entry) {
         Header expiresHeader = entry.getFirstHeader(HeaderConstants.EXPIRES);
-        if (expiresHeader == null)
-            return null;
+        if (expiresHeader == null) {
+			return null;
+		}
         try {
             return DateUtils.parseDate(expiresHeader.getValue());
         } catch (DateParseException dpe) {
@@ -314,7 +324,9 @@ class CacheValidityPolicy {
     public long getStalenessSecs(HttpCacheEntry entry, Date now) {
         long age = getCurrentAgeSecs(entry, now);
         long freshness = getFreshnessLifetimeSecs(entry);
-        if (age <= freshness) return 0L;
+        if (age <= freshness) {
+			return 0L;
+		}
         return (age - freshness);
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedHttpResponseGenerator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedHttpResponseGenerator.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedHttpResponseGenerator.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedHttpResponseGenerator.java Tue Jan 15 13:12:01 2013
@@ -151,8 +151,9 @@ class CachedHttpResponseGenerator {
     }
 
     private void addMissingContentLengthHeader(HttpResponse response, HttpEntity entity) {
-        if (transferEncodingIsPresent(response))
-            return;
+        if (transferEncodingIsPresent(response)) {
+			return;
+		}
 
         Header contentLength = response.getFirstHeader(HTTP.CONTENT_LEN);
         if (contentLength == null) {

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java Tue Jan 15 13:12:01 2013
@@ -73,19 +73,30 @@ class CachedResponseSuitabilityChecker {
     }
 
     private boolean isFreshEnough(HttpCacheEntry entry, HttpRequest request, Date now) {
-        if (validityStrategy.isResponseFresh(entry, now)) return true;
+        if (validityStrategy.isResponseFresh(entry, now)) {
+			return true;
+		}
         if (useHeuristicCaching &&
-                validityStrategy.isResponseHeuristicallyFresh(entry, now, heuristicCoefficient, heuristicDefaultLifetime))
-            return true;
-        if (originInsistsOnFreshness(entry)) return false;
+                validityStrategy.isResponseHeuristicallyFresh(entry, now, heuristicCoefficient, heuristicDefaultLifetime)) {
+			return true;
+		}
+        if (originInsistsOnFreshness(entry)) {
+			return false;
+		}
         long maxstale = getMaxStale(request);
-        if (maxstale == -1) return false;
+        if (maxstale == -1) {
+			return false;
+		}
         return (maxstale > validityStrategy.getStalenessSecs(entry, now));
     }
 
     private boolean originInsistsOnFreshness(HttpCacheEntry entry) {
-        if (validityStrategy.mustRevalidate(entry)) return true;
-        if (!sharedCache) return false;
+        if (validityStrategy.mustRevalidate(entry)) {
+			return true;
+		}
+        if (!sharedCache) {
+			return false;
+		}
         return validityStrategy.proxyRevalidate(entry) ||
             validityStrategy.hasCacheControlDirective(entry, "s-maxage");
     }
@@ -101,7 +112,9 @@ class CachedResponseSuitabilityChecker {
                     } else {
                         try {
                             long val = Long.parseLong(elt.getValue());
-                            if (val < 0) val = 0;
+                            if (val < 0) {
+								val = 0;
+							}
                             if (maxstale == -1 || val < maxstale) {
                                 maxstale = val;
                             }
@@ -198,7 +211,9 @@ class CachedResponseSuitabilityChecker {
                 if (HeaderConstants.CACHE_CONTROL_MIN_FRESH.equals(elt.getName())) {
                     try {
                         long minfresh = Long.parseLong(elt.getValue());
-                        if (minfresh < 0L) return false;
+                        if (minfresh < 0L) {
+							return false;
+						}
                         long age = validityStrategy.getCurrentAgeSecs(entry, now);
                         long freshness = validityStrategy.getFreshnessLifetimeSecs(entry);
                         if (freshness - age < minfresh) {

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java Tue Jan 15 13:12:01 2013
@@ -486,7 +486,9 @@ public class CachingExec implements Clie
                         int maxstale = Integer.parseInt(elt.getValue());
                         long age = validityPolicy.getCurrentAgeSecs(entry, now);
                         long lifetime = validityPolicy.getFreshnessLifetimeSecs(entry);
-                        if (age - lifetime > maxstale) return true;
+                        if (age - lifetime > maxstale) {
+							return true;
+						}
                     } catch (NumberFormatException nfe) {
                         return true;
                     }
@@ -503,7 +505,9 @@ public class CachingExec implements Clie
 
         final ProtocolVersion pv = msg.getProtocolVersion();
         String existingEntry = viaHeaders.get(pv);
-        if (existingEntry != null) return existingEntry;
+        if (existingEntry != null) {
+			return existingEntry;
+		}
 
         final VersionInfo vi = VersionInfo.loadVersionInfo("org.apache.http.client", getClass().getClassLoader());
         final String release = (vi != null) ? vi.getRelease() : VersionInfo.UNAVAILABLE;
@@ -544,14 +548,17 @@ public class CachingExec implements Clie
     boolean clientRequestsOurOptions(final HttpRequest request) {
         RequestLine line = request.getRequestLine();
 
-        if (!HeaderConstants.OPTIONS_METHOD.equals(line.getMethod()))
-            return false;
-
-        if (!"*".equals(line.getUri()))
-            return false;
-
-        if (!"0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue()))
-            return false;
+        if (!HeaderConstants.OPTIONS_METHOD.equals(line.getMethod())) {
+			return false;
+		}
+
+        if (!"*".equals(line.getUri())) {
+			return false;
+		}
+
+        if (!"0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue())) {
+			return false;
+		}
 
         return true;
     }
@@ -587,7 +594,9 @@ public class CachingExec implements Clie
             try {
                 Date entryDate = DateUtils.parseDate(entryDateHeader.getValue());
                 Date respDate = DateUtils.parseDate(responseDateHeader.getValue());
-                if (respDate.before(entryDate)) return true;
+                if (respDate.before(entryDate)) {
+					return true;
+				}
             } catch (DateParseException e) {
                 // either backend response or cached entry did not have a valid
                 // Date header, so we can't tell if they are out of order
@@ -843,11 +852,17 @@ public class CachingExec implements Clie
         } catch (IOException ioe) {
             // nop
         }
-        if (existing == null) return false;
+        if (existing == null) {
+			return false;
+		}
         Header entryDateHeader = existing.getFirstHeader(HTTP.DATE_HEADER);
-        if (entryDateHeader == null) return false;
+        if (entryDateHeader == null) {
+			return false;
+		}
         Header responseDateHeader = backendResponse.getFirstHeader(HTTP.DATE_HEADER);
-        if (responseDateHeader == null) return false;
+        if (responseDateHeader == null) {
+			return false;
+		}
         try {
             Date entryDate = DateUtils.parseDate(entryDateHeader.getValue());
             Date responseDate = DateUtils.parseDate(responseDateHeader.getValue());

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=1433390&r1=1433389&r2=1433390&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 Tue Jan 15 13:12:01 2013
@@ -432,7 +432,9 @@ public class CachingHttpClient implement
 
         HttpResponse fatalErrorResponse = getFatallyNoncompliantResponse(
                 request, context);
-        if (fatalErrorResponse != null) return fatalErrorResponse;
+        if (fatalErrorResponse != null) {
+			return fatalErrorResponse;
+		}
 
         requestCompliance.makeRequestCompliant(request);
         request.addHeader("Via",via);
@@ -651,7 +653,9 @@ public class CachingHttpClient implement
                         int maxstale = Integer.parseInt(elt.getValue());
                         long age = validityPolicy.getCurrentAgeSecs(entry, now);
                         long lifetime = validityPolicy.getFreshnessLifetimeSecs(entry);
-                        if (age - lifetime > maxstale) return true;
+                        if (age - lifetime > maxstale) {
+							return true;
+						}
                     } catch (NumberFormatException nfe) {
                         return true;
                     }
@@ -668,7 +672,9 @@ public class CachingHttpClient implement
 
         final ProtocolVersion pv = msg.getProtocolVersion();
         String existingEntry = viaHeaders.get(pv);
-        if (existingEntry != null) return existingEntry;
+        if (existingEntry != null) {
+			return existingEntry;
+		}
 
         final VersionInfo vi = VersionInfo.loadVersionInfo("org.apache.http.client", getClass().getClassLoader());
         final String release = (vi != null) ? vi.getRelease() : VersionInfo.UNAVAILABLE;
@@ -720,14 +726,17 @@ public class CachingHttpClient implement
     boolean clientRequestsOurOptions(HttpRequest request) {
         RequestLine line = request.getRequestLine();
 
-        if (!HeaderConstants.OPTIONS_METHOD.equals(line.getMethod()))
-            return false;
-
-        if (!"*".equals(line.getUri()))
-            return false;
-
-        if (!"0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue()))
-            return false;
+        if (!HeaderConstants.OPTIONS_METHOD.equals(line.getMethod())) {
+			return false;
+		}
+
+        if (!"*".equals(line.getUri())) {
+			return false;
+		}
+
+        if (!"0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue())) {
+			return false;
+		}
 
         return true;
     }
@@ -753,7 +762,9 @@ public class CachingHttpClient implement
             try {
                 Date entryDate = DateUtils.parseDate(entryDateHeader.getValue());
                 Date respDate = DateUtils.parseDate(responseDateHeader.getValue());
-                if (respDate.before(entryDate)) return true;
+                if (respDate.before(entryDate)) {
+					return true;
+				}
             } catch (DateParseException e) {
                 // either backend response or cached entry did not have a valid
                 // Date header, so we can't tell if they are out of order
@@ -898,7 +909,9 @@ public class CachingHttpClient implement
             final HttpResponse cachedResponse = responseGenerator.generateResponse(cacheEntry);
             cachedResponse.addHeader(HeaderConstants.WARNING, "110 localhost \"Response is stale\"");
             HttpEntity errorBody = backendResponse.getEntity();
-            if (errorBody != null) EntityUtils.consume(errorBody);
+            if (errorBody != null) {
+				EntityUtils.consume(errorBody);
+			}
             return cachedResponse;
         }
 
@@ -971,11 +984,17 @@ public class CachingHttpClient implement
         } catch (IOException ioe) {
             // nop
         }
-        if (existing == null) return false;
+        if (existing == null) {
+			return false;
+		}
         Header entryDateHeader = existing.getFirstHeader(HTTP.DATE_HEADER);
-        if (entryDateHeader == null) return false;
+        if (entryDateHeader == null) {
+			return false;
+		}
         Header responseDateHeader = backendResponse.getFirstHeader(HTTP.DATE_HEADER);
-        if (responseDateHeader == null) return false;
+        if (responseDateHeader == null) {
+			return false;
+		}
         try {
             Date entryDate = DateUtils.parseDate(entryDateHeader.getValue());
             Date responseDate = DateUtils.parseDate(responseDateHeader.getValue());

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/RequestProtocolCompliance.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/RequestProtocolCompliance.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/RequestProtocolCompliance.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/RequestProtocolCompliance.java Tue Jan 15 13:12:01 2013
@@ -125,7 +125,9 @@ class RequestProtocolCompliance {
                 }
             }
         }
-        if (!shouldStrip) return;
+        if (!shouldStrip) {
+			return;
+		}
         request.removeHeaders(HeaderConstants.CACHE_CONTROL);
         request.setHeader(HeaderConstants.CACHE_CONTROL, buildHeaderFromElements(outElts));
     }
@@ -301,12 +303,14 @@ class RequestProtocolCompliance {
         }
 
         Header range = request.getFirstHeader(HeaderConstants.RANGE);
-        if (range == null)
-            return null;
+        if (range == null) {
+			return null;
+		}
 
         Header ifRange = request.getFirstHeader(HeaderConstants.IF_RANGE);
-        if (ifRange == null)
-            return null;
+        if (ifRange == null) {
+			return null;
+		}
 
         String val = ifRange.getValue();
         if (val.startsWith("W/")) {
@@ -333,8 +337,9 @@ class RequestProtocolCompliance {
             }
         } else {
             Header ifNoneMatch = request.getFirstHeader(HeaderConstants.IF_NONE_MATCH);
-            if (ifNoneMatch == null)
-                return null;
+            if (ifNoneMatch == null) {
+				return null;
+			}
 
             String val2 = ifNoneMatch.getValue();
             if (val2.startsWith("W/")) {

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseCachingPolicy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseCachingPolicy.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseCachingPolicy.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseCachingPolicy.java Tue Jan 15 13:12:01 2013
@@ -115,24 +115,28 @@ class ResponseCachingPolicy {
         Header contentLength = response.getFirstHeader(HTTP.CONTENT_LEN);
         if (contentLength != null) {
             int contentLengthValue = Integer.parseInt(contentLength.getValue());
-            if (contentLengthValue > this.maxObjectSizeBytes)
-                return false;
+            if (contentLengthValue > this.maxObjectSizeBytes) {
+				return false;
+			}
         }
 
         Header[] ageHeaders = response.getHeaders(HeaderConstants.AGE);
 
-        if (ageHeaders.length > 1)
-            return false;
+        if (ageHeaders.length > 1) {
+			return false;
+		}
 
         Header[] expiresHeaders = response.getHeaders(HeaderConstants.EXPIRES);
 
-        if (expiresHeaders.length > 1)
-            return false;
+        if (expiresHeaders.length > 1) {
+			return false;
+		}
 
         Header[] dateHeaders = response.getHeaders(HTTP.DATE_HEADER);
 
-        if (dateHeaders.length != 1)
-            return false;
+        if (dateHeaders.length != 1) {
+			return false;
+		}
 
         try {
             DateUtils.parseDate(dateHeaders[0].getValue());
@@ -148,18 +152,29 @@ class ResponseCachingPolicy {
             }
         }
 
-        if (isExplicitlyNonCacheable(response))
-            return false;
+        if (isExplicitlyNonCacheable(response)) {
+			return false;
+		}
 
         return (cacheable || isExplicitlyCacheable(response));
     }
 
     private boolean unknownStatusCode(int status) {
-        if (status >= 100 && status <= 101) return false;
-        if (status >= 200 && status <= 206) return false;
-        if (status >= 300 && status <= 307) return false;
-        if (status >= 400 && status <= 417) return false;
-        if (status >= 500 && status <= 505) return false;
+        if (status >= 100 && status <= 101) {
+			return false;
+		}
+        if (status >= 200 && status <= 206) {
+			return false;
+		}
+        if (status >= 300 && status <= 307) {
+			return false;
+		}
+        if (status >= 400 && status <= 417) {
+			return false;
+		}
+        if (status >= 500 && status <= 505) {
+			return false;
+		}
         return true;
     }
 
@@ -192,8 +207,9 @@ class ResponseCachingPolicy {
     }
 
     protected boolean isExplicitlyCacheable(HttpResponse response) {
-        if (response.getFirstHeader(HeaderConstants.EXPIRES) != null)
-            return true;
+        if (response.getFirstHeader(HeaderConstants.EXPIRES) != null) {
+			return true;
+		}
         String[] cacheableParams = { HeaderConstants.CACHE_CONTROL_MAX_AGE, "s-maxage",
                 HeaderConstants.CACHE_CONTROL_MUST_REVALIDATE,
                 HeaderConstants.CACHE_CONTROL_PROXY_REVALIDATE,
@@ -251,10 +267,14 @@ class ResponseCachingPolicy {
 
     private boolean expiresHeaderLessOrEqualToDateHeaderAndNoCacheControl(
             HttpResponse response) {
-        if (response.getFirstHeader(HeaderConstants.CACHE_CONTROL) != null) return false;
+        if (response.getFirstHeader(HeaderConstants.CACHE_CONTROL) != null) {
+			return false;
+		}
         Header expiresHdr = response.getFirstHeader(HeaderConstants.EXPIRES);
         Header dateHdr = response.getFirstHeader(HTTP.DATE_HEADER);
-        if (expiresHdr == null || dateHdr == null) return false;
+        if (expiresHdr == null || dateHdr == null) {
+			return false;
+		}
         try {
             Date expires = DateUtils.parseDate(expiresHdr.getValue());
             Date date = DateUtils.parseDate(dateHdr.getValue());

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseProtocolCompliance.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseProtocolCompliance.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseProtocolCompliance.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseProtocolCompliance.java Tue Jan 15 13:12:01 2013
@@ -94,7 +94,9 @@ class ResponseProtocolCompliance {
 
     private void consumeBody(HttpResponse response) throws IOException {
         HttpEntity body = response.getEntity();
-        if (body != null) EntityUtils.consume(body);
+        if (body != null) {
+			EntityUtils.consume(body);
+		}
     }
 
     private void warningsWithNonMatchingWarnDatesAreRemoved(
@@ -106,11 +108,15 @@ class ResponseProtocolCompliance {
             //Empty On Purpose
         }
 
-        if (responseDate == null) return;
+        if (responseDate == null) {
+			return;
+		}
 
         Header[] warningHeaders = response.getHeaders(HeaderConstants.WARNING);
 
-        if (warningHeaders == null || warningHeaders.length == 0) return;
+        if (warningHeaders == null || warningHeaders.length == 0) {
+			return;
+		}
 
         List<Header> newWarningHeaders = new ArrayList<Header>();
         boolean modified = false;
@@ -134,7 +140,9 @@ class ResponseProtocolCompliance {
 
     private void identityIsNotUsedInContentEncoding(HttpResponse response) {
         Header[] hdrs = response.getHeaders(HTTP.CONTENT_ENCODING);
-        if (hdrs == null || hdrs.length == 0) return;
+        if (hdrs == null || hdrs.length == 0) {
+			return;
+		}
         List<Header> newHeaders = new ArrayList<Header>();
         boolean modified = false;
         for (Header h : hdrs) {
@@ -144,7 +152,9 @@ class ResponseProtocolCompliance {
                 if ("identity".equalsIgnoreCase(elt.getName())) {
                     modified = true;
                 } else {
-                    if (!first) buf.append(",");
+                    if (!first) {
+						buf.append(",");
+					}
                     buf.append(elt.toString());
                     first = false;
                 }
@@ -154,7 +164,9 @@ class ResponseProtocolCompliance {
                 newHeaders.add(new BasicHeader(HTTP.CONTENT_ENCODING, newHeaderValue));
             }
         }
-        if (!modified) return;
+        if (!modified) {
+			return;
+		}
         response.removeHeaders(HTTP.CONTENT_ENCODING);
         for (Header h : newHeaders) {
             response.addHeader(h);
@@ -171,8 +183,9 @@ class ResponseProtocolCompliance {
     private void ensurePartialContentIsNotSentToAClientThatDidNotRequestIt(HttpRequest request,
             HttpResponse response) throws IOException {
         if (request.getFirstHeader(HeaderConstants.RANGE) != null
-                || response.getStatusLine().getStatusCode() != HttpStatus.SC_PARTIAL_CONTENT)
-            return;
+                || response.getStatusLine().getStatusCode() != HttpStatus.SC_PARTIAL_CONTENT) {
+			return;
+		}
 
         consumeBody(response);
         throw new ClientProtocolException(UNEXPECTED_PARTIAL_CONTENT);
@@ -220,7 +233,9 @@ class ResponseProtocolCompliance {
 
         HttpRequest originalRequest = request.getOriginal();
         if (originalRequest instanceof HttpEntityEnclosingRequest) {
-            if (((HttpEntityEnclosingRequest)originalRequest).expectContinue()) return;
+            if (((HttpEntityEnclosingRequest)originalRequest).expectContinue()) {
+				return;
+			}
         }
         consumeBody(response);
         throw new ClientProtocolException(UNEXPECTED_100_CONTINUE);

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=1433390&r1=1433389&r2=1433390&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 Tue Jan 15 13:12:01 2013
@@ -80,7 +80,9 @@ class WarningValue {
                 offs = wv.offs;
             } catch (IllegalArgumentException e) {
                 final int nextComma = src.indexOf(',', offs);
-                if (nextComma == -1) break;
+                if (nextComma == -1) {
+					break;
+				}
                 offs = nextComma + 1;
             }
         }
@@ -149,9 +151,13 @@ class WarningValue {
      * token          = 1*<any CHAR except CTLs or separators>
      */
     protected void consumeToken() {
-        if (!isTokenChar(src.charAt(offs))) parseError();
+        if (!isTokenChar(src.charAt(offs))) {
+			parseError();
+		}
         while(offs < src.length()) {
-            if (!isTokenChar(src.charAt(offs))) break;
+            if (!isTokenChar(src.charAt(offs))) {
+				break;
+			}
             offs++;
         }
     }
@@ -171,8 +177,12 @@ class WarningValue {
 
     protected void consumeHostPort() {
         Matcher m = HOSTPORT_PATTERN.matcher(src.substring(offs));
-        if (!m.find()) parseError();
-        if (m.start() != 0) parseError();
+        if (!m.find()) {
+			parseError();
+		}
+        if (m.start() != 0) {
+			parseError();
+		}
         offs += m.end();
     }
 
@@ -201,7 +211,9 @@ class WarningValue {
      * qdtext         = <any TEXT except <">>
      */
     protected void consumeQuotedString() {
-        if (src.charAt(offs) != '\"') parseError();
+        if (src.charAt(offs) != '\"') {
+			parseError();
+		}
         offs++;
         boolean foundEnd = false;
         while(offs < src.length() && !foundEnd) {
@@ -218,7 +230,9 @@ class WarningValue {
                 parseError();
             }
         }
-        if (!foundEnd) parseError();
+        if (!foundEnd) {
+			parseError();
+		}
     }
 
     /*
@@ -250,7 +264,9 @@ class WarningValue {
     protected void consumeWarnDate() {
         int curr = offs;
         Matcher m = WARN_DATE_PATTERN.matcher(src.substring(offs));
-        if (!m.lookingAt()) parseError();
+        if (!m.lookingAt()) {
+			parseError();
+		}
         offs += m.end();
         try {
             warnDate = DateUtils.parseDate(src.substring(curr+1,offs-1));

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedHttpCacheStorage.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedHttpCacheStorage.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedHttpCacheStorage.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedHttpCacheStorage.java Tue Jan 15 13:12:01 2013
@@ -161,7 +161,9 @@ public class MemcachedHttpCacheStorage i
     public void putEntry(String url, HttpCacheEntry entry) throws IOException  {
         byte[] bytes = serializeEntry(url, entry);
         String key = getCacheKey(url);
-        if (key == null) return;
+        if (key == null) {
+			return;
+		}
         try {
             client.set(key, 0, bytes);
         } catch (OperationTimeoutException ex) {
@@ -189,7 +191,9 @@ public class MemcachedHttpCacheStorage i
     }
 
     private byte[] convertToByteArray(Object o) {
-        if (o == null) return null;
+        if (o == null) {
+			return null;
+		}
         if (!(o instanceof byte[])) {
             log.warn("got a non-bytearray back from memcached: " + o);
             return null;
@@ -199,7 +203,9 @@ public class MemcachedHttpCacheStorage i
 
     private MemcachedCacheEntry reconstituteEntry(Object o) throws IOException {
         byte[] bytes = convertToByteArray(o);
-        if (bytes == null) return null;
+        if (bytes == null) {
+			return null;
+		}
         MemcachedCacheEntry mce = memcachedCacheEntryFactory.getUnsetCacheEntry();
         try {
             mce.set(bytes);
@@ -211,10 +217,14 @@ public class MemcachedHttpCacheStorage i
 
     public HttpCacheEntry getEntry(String url) throws IOException {
         String key = getCacheKey(url);
-        if (key == null) return null;
+        if (key == null) {
+			return null;
+		}
         try {
             MemcachedCacheEntry mce = reconstituteEntry(client.get(key));
-            if (mce == null || !url.equals(mce.getStorageKey())) return null;
+            if (mce == null || !url.equals(mce.getStorageKey())) {
+				return null;
+			}
             return mce.getHttpCacheEntry();
         } catch (OperationTimeoutException ex) {
             throw new MemcachedOperationTimeoutException(ex);
@@ -223,7 +233,9 @@ public class MemcachedHttpCacheStorage i
 
     public void removeEntry(String url) throws IOException {
         String key = getCacheKey(url);
-        if (key == null) return;
+        if (key == null) {
+			return;
+		}
         try {
             client.delete(key);
         } catch (OperationTimeoutException ex) {
@@ -260,7 +272,9 @@ public class MemcachedHttpCacheStorage i
                             updatedBytes);
                     if (casResult != CASResponse.OK) {
                         numRetries++;
-                    } else return;
+                    } else {
+						return;
+					}
                 }
             } catch (OperationTimeoutException ex) {
                 throw new MemcachedOperationTimeoutException(ex);

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/HttpTestUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/HttpTestUtils.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/HttpTestUtils.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/HttpTestUtils.java Tue Jan 15 13:12:01 2013
@@ -96,8 +96,9 @@ public class HttpTestUtils {
      */
     public static boolean isHopByHopHeader(String name) {
         for (String s : HOP_BY_HOP_HEADERS) {
-            if (s.equalsIgnoreCase(name))
-                return true;
+            if (s.equalsIgnoreCase(name)) {
+				return true;
+			}
         }
         return false;
     }
@@ -107,8 +108,9 @@ public class HttpTestUtils {
      */
     public static boolean isMultiHeader(String name) {
         for (String s : MULTI_HEADERS) {
-            if (s.equalsIgnoreCase(name))
-                return true;
+            if (s.equalsIgnoreCase(name)) {
+				return true;
+			}
         }
         return false;
     }
@@ -118,8 +120,9 @@ public class HttpTestUtils {
      */
     public static boolean isSingleHeader(String name) {
         for (String s : SINGLE_HEADERS) {
-            if (s.equalsIgnoreCase(name))
-                return true;
+            if (s.equalsIgnoreCase(name)) {
+				return true;
+			}
         }
         return false;
     }
@@ -129,14 +132,18 @@ public class HttpTestUtils {
     public static boolean equivalent(HttpEntity e1, HttpEntity e2) throws Exception {
         InputStream i1 = e1.getContent();
         InputStream i2 = e2.getContent();
-        if (i1 == null && i2 == null)
-            return true;
+        if (i1 == null && i2 == null) {
+			return true;
+		}
         if (i1 == null || i2 == null)
-            return false; // avoid possible NPEs below
+		 {
+			return false; // avoid possible NPEs below
+		}
         int b1 = -1;
         while ((b1 = i1.read()) != -1) {
-            if (b1 != i2.read())
-                return false;
+            if (b1 != i2.read()) {
+				return false;
+			}
         }
         return (-1 == i2.read());
     }
@@ -199,8 +206,9 @@ public class HttpTestUtils {
             if (!isHopByHopHeader(h.getName())) {
                 String r1val = getCanonicalHeaderValue(r1, h.getName());
                 String r2val = getCanonicalHeaderValue(r2, h.getName());
-                if (!r1val.equals(r2val))
-                    return false;
+                if (!r1val.equals(r2val)) {
+					return false;
+				}
             }
         }
         return true;
@@ -218,9 +226,13 @@ public class HttpTestUtils {
     public static boolean semanticallyTransparent(HttpResponse r1, HttpResponse r2)
     throws Exception {
         final boolean entitiesEquivalent = equivalent(r1.getEntity(), r2.getEntity());
-        if (!entitiesEquivalent) return false;
+        if (!entitiesEquivalent) {
+			return false;
+		}
         final boolean statusLinesEquivalent = semanticallyTransparent(r1.getStatusLine(), r2.getStatusLine());
-        if (!statusLinesEquivalent) return false;
+        if (!statusLinesEquivalent) {
+			return false;
+		}
         final boolean e2eHeadersEquivalentSubset = isEndToEndHeaderSubset(
                 r1, r2);
         return e2eHeadersEquivalentSubset;

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/RequestEquivalent.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/RequestEquivalent.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/RequestEquivalent.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/RequestEquivalent.java Tue Jan 15 13:12:01 2013
@@ -38,8 +38,9 @@ public class RequestEquivalent implement
     }
 
     public boolean matches(Object actual) {
-        if (!(actual instanceof HttpRequest))
-            return false;
+        if (!(actual instanceof HttpRequest)) {
+			return false;
+		}
         HttpRequest other = (HttpRequest) actual;
         return HttpTestUtils.equivalent(expected, other);
     }

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java Tue Jan 15 13:12:01 2013
@@ -1413,8 +1413,9 @@ public class TestCachingExec {
 
             @Override
             public int read() throws IOException {
-                if (closed)
-                    throw new SocketException("Socket closed");
+                if (closed) {
+					throw new SocketException("Socket closed");
+				}
                 throw new SocketTimeoutException("Read timed out");
             }
         }, 128));

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheEntrySerializers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheEntrySerializers.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheEntrySerializers.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheEntrySerializers.java Tue Jan 15 13:12:01 2013
@@ -102,29 +102,36 @@ public class TestHttpCacheEntrySerialize
     private boolean areEqual(HttpCacheEntry one, HttpCacheEntry two) throws IOException {
         // dates are only stored with second precision, so scrub milliseconds
         if (!((one.getRequestDate().getTime() / 1000) == (two.getRequestDate()
-                .getTime() / 1000)))
-            return false;
+                .getTime() / 1000))) {
+			return false;
+		}
         if (!((one.getResponseDate().getTime() / 1000) == (two
-                .getResponseDate().getTime() / 1000)))
-            return false;
-        if (!one.getProtocolVersion().equals(two.getProtocolVersion()))
-            return false;
+                .getResponseDate().getTime() / 1000))) {
+			return false;
+		}
+        if (!one.getProtocolVersion().equals(two.getProtocolVersion())) {
+			return false;
+		}
 
         byte[] onesByteArray = resourceToBytes(one.getResource());
         byte[] twosByteArray = resourceToBytes(two.getResource());
 
-        if (!Arrays.equals(onesByteArray,twosByteArray))
-            return false;
+        if (!Arrays.equals(onesByteArray,twosByteArray)) {
+			return false;
+		}
 
         Header[] oneHeaders = one.getAllHeaders();
         Header[] twoHeaders = two.getAllHeaders();
-        if (!(oneHeaders.length == twoHeaders.length))
-            return false;
+        if (!(oneHeaders.length == twoHeaders.length)) {
+			return false;
+		}
         for (int i = 0; i < oneHeaders.length; i++) {
-            if (!oneHeaders[i].getName().equals(twoHeaders[i].getName()))
-                return false;
-            if (!oneHeaders[i].getValue().equals(twoHeaders[i].getValue()))
-                return false;
+            if (!oneHeaders[i].getName().equals(twoHeaders[i].getName())) {
+				return false;
+			}
+            if (!oneHeaders[i].getValue().equals(twoHeaders[i].getValue())) {
+				return false;
+			}
         }
 
         return true;

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=1433390&r1=1433389&r2=1433390&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 Tue Jan 15 13:12:01 2013
@@ -1651,10 +1651,12 @@ public class TestProtocolRequirements ex
         boolean found1 = false;
         boolean found2 = false;
         while ((b = i.read()) != -1) {
-            if (b == 1)
-                found1 = true;
-            if (b == 2)
-                found2 = true;
+            if (b == 1) {
+				found1 = true;
+			}
+            if (b == 2) {
+				found2 = true;
+			}
         }
         i.close();
         Assert.assertFalse(found1 && found2); // mixture of content
@@ -1743,10 +1745,12 @@ public class TestProtocolRequirements ex
         boolean found1 = false;
         boolean found2 = false;
         while ((b = i.read()) != -1) {
-            if (b == 1)
-                found1 = true;
-            if (b == 2)
-                found2 = true;
+            if (b == 1) {
+				found1 = true;
+			}
+            if (b == 2) {
+				found2 = true;
+			}
         }
         i.close();
         Assert.assertFalse(found1 && found2); // mixture of content
@@ -2609,8 +2613,9 @@ public class TestProtocolRequirements ex
         if (status == 200) {
             boolean foundWarning = false;
             for (Header h : result.getHeaders("Warning")) {
-                if (h.getValue().split(" ")[0].equals("111"))
-                    foundWarning = true;
+                if (h.getValue().split(" ")[0].equals("111")) {
+					foundWarning = true;
+				}
             }
             Assert.assertTrue(foundWarning);
         } else {
@@ -2686,14 +2691,16 @@ public class TestProtocolRequirements ex
         boolean found1xxWarning = false;
         for (Header h : result1.getHeaders("Warning")) {
             for (HeaderElement elt : h.getElements()) {
-                if (elt.getName().startsWith("1"))
-                    found1xxWarning = true;
+                if (elt.getName().startsWith("1")) {
+					found1xxWarning = true;
+				}
             }
         }
         for (Header h : result2.getHeaders("Warning")) {
             for (HeaderElement elt : h.getElements()) {
-                if (elt.getName().startsWith("1"))
-                    found1xxWarning = true;
+                if (elt.getName().startsWith("1")) {
+					found1xxWarning = true;
+				}
             }
         }
         Assert.assertFalse(found1xxWarning);
@@ -2757,8 +2764,9 @@ public class TestProtocolRequirements ex
         for (Header h : result1.getHeaders("Warning")) {
             for (HeaderElement elt : h.getElements()) {
                 String[] parts = elt.getName().split(" ");
-                if ("214".equals(parts[0]))
-                    found214Warning = true;
+                if ("214".equals(parts[0])) {
+					found214Warning = true;
+				}
             }
         }
         Assert.assertTrue(found214Warning);
@@ -2767,8 +2775,9 @@ public class TestProtocolRequirements ex
         for (Header h : result2.getHeaders("Warning")) {
             for (HeaderElement elt : h.getElements()) {
                 String[] parts = elt.getName().split(" ");
-                if ("214".equals(parts[0]))
-                    found214Warning = true;
+                if ("214".equals(parts[0])) {
+					found214Warning = true;
+				}
             }
         }
         Assert.assertTrue(found214Warning);
@@ -3160,14 +3169,16 @@ public class TestProtocolRequirements ex
             boolean foundETag = false;
             for (Header h : validation.getHeaders("If-Match")) {
                 for (HeaderElement elt : h.getElements()) {
-                    if ("W/\"etag\"".equals(elt.getName()))
-                        foundETag = true;
+                    if ("W/\"etag\"".equals(elt.getName())) {
+						foundETag = true;
+					}
                 }
             }
             for (Header h : validation.getHeaders("If-None-Match")) {
                 for (HeaderElement elt : h.getElements()) {
-                    if ("W/\"etag\"".equals(elt.getName()))
-                        foundETag = true;
+                    if ("W/\"etag\"".equals(elt.getName())) {
+						foundETag = true;
+					}
                 }
             }
             Assert.assertTrue(foundETag);
@@ -6050,11 +6061,17 @@ public class TestProtocolRequirements ex
         final String nestedPrefix = "^\\(([^\\p{Cntrl}()]|\\\\\\p{ASCII})*\\(";
         final String nestedSuffix = "\\)([^\\p{Cntrl}()]|\\\\\\p{ASCII})*\\)$";
 
-        if (Pattern.matches(leafComment,s)) return true;
+        if (Pattern.matches(leafComment,s)) {
+			return true;
+		}
         Matcher pref = Pattern.compile(nestedPrefix).matcher(s);
         Matcher suff = Pattern.compile(nestedSuffix).matcher(s);
-        if (!pref.find()) return false;
-        if (!suff.find()) return false;
+        if (!pref.find()) {
+			return false;
+		}
+        if (!suff.find()) {
+			return false;
+		}
         return isValidComment(s.substring(pref.end() - 1, suff.start() + 1));
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java Tue Jan 15 13:12:01 2013
@@ -486,7 +486,9 @@ public class TestMemcachedHttpCacheStora
 
         HttpCacheUpdateCallback callback = new HttpCacheUpdateCallback() {
             public HttpCacheEntry update(HttpCacheEntry old) {
-                if (old == existingValue) return updatedValue;
+                if (old == existingValue) {
+					return updatedValue;
+				}
                 assertSame(existingValue2, old);
                 return updatedValue2;
             }

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/BasicUserPrincipal.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/BasicUserPrincipal.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/BasicUserPrincipal.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/BasicUserPrincipal.java Tue Jan 15 13:12:01 2013
@@ -64,7 +64,9 @@ public final class BasicUserPrincipal im
 
     @Override
     public boolean equals(Object o) {
-        if (this == o) return true;
+        if (this == o) {
+			return true;
+		}
         if (o instanceof BasicUserPrincipal) {
             BasicUserPrincipal that = (BasicUserPrincipal) o;
             if (LangUtils.equals(this.username, that.username)) {

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/NTCredentials.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/NTCredentials.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/NTCredentials.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/NTCredentials.java Tue Jan 15 13:12:01 2013
@@ -150,7 +150,9 @@ public class NTCredentials implements Cr
 
     @Override
     public boolean equals(Object o) {
-        if (this == o) return true;
+        if (this == o) {
+			return true;
+		}
         if (o instanceof NTCredentials) {
             NTCredentials that = (NTCredentials) o;
             if (LangUtils.equals(this.principal, that.principal)

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/NTUserPrincipal.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/NTUserPrincipal.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/NTUserPrincipal.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/NTUserPrincipal.java Tue Jan 15 13:12:01 2013
@@ -92,7 +92,9 @@ public class NTUserPrincipal implements 
 
     @Override
     public boolean equals(Object o) {
-        if (this == o) return true;
+        if (this == o) {
+			return true;
+		}
         if (o instanceof NTUserPrincipal) {
             NTUserPrincipal that = (NTUserPrincipal) o;
             if (LangUtils.equals(this.username, that.username)

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/UsernamePasswordCredentials.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/UsernamePasswordCredentials.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/UsernamePasswordCredentials.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/UsernamePasswordCredentials.java Tue Jan 15 13:12:01 2013
@@ -99,7 +99,9 @@ public class UsernamePasswordCredentials
 
     @Override
     public boolean equals(Object o) {
-        if (this == o) return true;
+        if (this == o) {
+			return true;
+		}
         if (o instanceof UsernamePasswordCredentials) {
             UsernamePasswordCredentials that = (UsernamePasswordCredentials) o;
             if (LangUtils.equals(this.principal, that.principal)) {

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/Rfc3492Idn.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/Rfc3492Idn.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/Rfc3492Idn.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/Rfc3492Idn.java Tue Jan 15 13:12:01 2013
@@ -48,8 +48,11 @@ public class Rfc3492Idn implements Idn {
     private static final String ACE_PREFIX = "xn--";
 
     private int adapt(int delta, int numpoints, boolean firsttime) {
-        if (firsttime) delta = delta / damp;
-        else delta = delta / 2;
+        if (firsttime) {
+			delta = delta / damp;
+		} else {
+			delta = delta / 2;
+		}
         delta = delta + (delta / numpoints);
         int k = 0;
         while (delta > ((base - tmin) * tmax) / 2) {
@@ -60,9 +63,15 @@ public class Rfc3492Idn implements Idn {
     }
 
     private int digit(char c) {
-        if ((c >= 'A') && (c <= 'Z')) return (c - 'A');
-        if ((c >= 'a') && (c <= 'z')) return (c - 'a');
-        if ((c >= '0') && (c <= '9')) return (c - '0') + 26;
+        if ((c >= 'A') && (c <= 'Z')) {
+			return (c - 'A');
+		}
+        if ((c >= 'a') && (c <= 'z')) {
+			return (c - 'a');
+		}
+        if ((c >= '0') && (c <= '9')) {
+			return (c - '0') + 26;
+		}
         throw new IllegalArgumentException("illegal digit: "+ c);
     }
 
@@ -71,8 +80,12 @@ public class Rfc3492Idn implements Idn {
         StringTokenizer tok = new StringTokenizer(punycode, ".");
         while (tok.hasMoreTokens()) {
             String t = tok.nextToken();
-            if (unicode.length() > 0) unicode.append('.');
-            if (t.startsWith(ACE_PREFIX)) t = decode(t.substring(4));
+            if (unicode.length() > 0) {
+				unicode.append('.');
+			}
+            if (t.startsWith(ACE_PREFIX)) {
+				t = decode(t.substring(4));
+			}
             unicode.append(t);
         }
         return unicode.toString();
@@ -93,7 +106,9 @@ public class Rfc3492Idn implements Idn {
             int oldi = i;
             int w = 1;
             for (int k = base;; k += base) {
-                if (input.length() == 0) break;
+                if (input.length() == 0) {
+					break;
+				}
                 char c = input.charAt(0);
                 input = input.substring(1);
                 int digit = digit(c);
@@ -106,7 +121,9 @@ public class Rfc3492Idn implements Idn {
                 } else {
                     t = k - bias;
                 }
-                if (digit < t) break;
+                if (digit < t) {
+					break;
+				}
                 w = w * (base - t); // FIXME fail on overflow
             }
             bias = adapt(i - oldi, output.length() + 1, (oldi == 0));

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/BasicManagedEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/BasicManagedEntity.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/BasicManagedEntity.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/BasicManagedEntity.java Tue Jan 15 13:12:01 2013
@@ -88,8 +88,9 @@ public class BasicManagedEntity extends 
     }
 
     private void ensureConsumed() throws IOException {
-        if (managedConn == null)
-            return;
+        if (managedConn == null) {
+			return;
+		}
 
         try {
             if (attemptReuse) {

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/EofSensorInputStream.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/EofSensorInputStream.java?rev=1433390&r1=1433389&r2=1433390&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/EofSensorInputStream.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/EofSensorInputStream.java Tue Jan 15 13:12:01 2013
@@ -195,10 +195,12 @@ public class EofSensorInputStream extend
         if ((wrappedStream != null) && (eof < 0)) {
             try {
                 boolean scws = true; // should close wrapped stream?
-                if (eofWatcher != null)
-                    scws = eofWatcher.eofDetected(wrappedStream);
-                if (scws)
-                    wrappedStream.close();
+                if (eofWatcher != null) {
+					scws = eofWatcher.eofDetected(wrappedStream);
+				}
+                if (scws) {
+					wrappedStream.close();
+				}
             } finally {
                 wrappedStream = null;
             }
@@ -221,10 +223,12 @@ public class EofSensorInputStream extend
         if (wrappedStream != null) {
             try {
                 boolean scws = true; // should close wrapped stream?
-                if (eofWatcher != null)
-                    scws = eofWatcher.streamClosed(wrappedStream);
-                if (scws)
-                    wrappedStream.close();
+                if (eofWatcher != null) {
+					scws = eofWatcher.streamClosed(wrappedStream);
+				}
+                if (scws) {
+					wrappedStream.close();
+				}
             } finally {
                 wrappedStream = null;
             }
@@ -249,10 +253,12 @@ public class EofSensorInputStream extend
         if (wrappedStream != null) {
             try {
                 boolean scws = true; // should close wrapped stream?
-                if (eofWatcher != null)
-                    scws = eofWatcher.streamAbort(wrappedStream);
-                if (scws)
-                    wrappedStream.close();
+                if (eofWatcher != null) {
+					scws = eofWatcher.streamAbort(wrappedStream);
+				}
+                if (scws) {
+					wrappedStream.close();
+				}
             } finally {
                 wrappedStream = null;
             }



Mime
View raw message