hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1491511 [4/4] - in /httpcomponents/httpclient/trunk: ./ httpclient-cache/src/main/java/org/apache/http/client/cache/ httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ httpclient-cache/src/main/java/org/apache/http/impl/clie...
Date Mon, 10 Jun 2013 15:52:52 GMT
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpResponseParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpResponseParser.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpResponseParser.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpResponseParser.java Mon Jun 10 15:52:49 2013
@@ -42,7 +42,6 @@ import org.apache.http.config.MessageCon
 import org.apache.http.impl.DefaultHttpResponseFactory;
 import org.apache.http.impl.io.AbstractMessageParser;
 import org.apache.http.io.SessionInputBuffer;
-import org.apache.http.message.BasicLineParser;
 import org.apache.http.message.LineParser;
 import org.apache.http.message.ParserCursor;
 import org.apache.http.params.HttpParams;
@@ -84,8 +83,8 @@ public class DefaultHttpResponseParser e
      * Creates new instance of DefaultHttpResponseParser.
      *
      * @param buffer the session input buffer.
-     * @param lineParser the line parser. If <code>null</code> {@link BasicLineParser#INSTANCE}
-     *   will be used.
+     * @param lineParser the line parser. If <code>null</code>
+     *   {@link org.apache.http.message.BasicLineParser#INSTANCE} will be used.
      * @param responseFactory HTTP response factory. If <code>null</code>
      *   {@link DefaultHttpResponseFactory#INSTANCE} will be used.
      * @param constraints the message constraints. If <code>null</code>

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultProxyRoutePlanner.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultProxyRoutePlanner.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultProxyRoutePlanner.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultProxyRoutePlanner.java Mon Jun 10 15:52:49 2013
@@ -32,13 +32,12 @@ import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.conn.SchemePortResolver;
-import org.apache.http.conn.routing.HttpRoutePlanner;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.util.Args;
 
 /**
- * Implementation of an {@link HttpRoutePlanner} that routes requests through
- * a default proxy.
+ * Implementation of an {@link org.apache.http.conn.routing.HttpRoutePlanner}
+ * that routes requests through a default proxy.
  *
  * @since 4.3
  */

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultRoutePlanner.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultRoutePlanner.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultRoutePlanner.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultRoutePlanner.java Mon Jun 10 15:52:49 2013
@@ -73,7 +73,7 @@ public class DefaultRoutePlanner impleme
             proxy = determineProxy(host, request, context);
         }
 
-        HttpHost target;
+        final HttpHost target;
         if (host.getPort() <= 0) {
             try {
                 target = new HttpHost(

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java Mon Jun 10 15:52:49 2013
@@ -45,7 +45,7 @@ import org.apache.http.pool.ConnFactory;
 @Deprecated
 class HttpConnPool extends AbstractConnPool<HttpRoute, OperatedClientConnection, HttpPoolEntry> {
 
-    private static AtomicLong COUNTER = new AtomicLong();
+    private static final AtomicLong COUNTER = new AtomicLong();
 
     private final Log log;
     private final long timeToLive;

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedClientConnectionImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedClientConnectionImpl.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedClientConnectionImpl.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ManagedClientConnectionImpl.java Mon Jun 10 15:52:49 2013
@@ -289,7 +289,7 @@ class ManagedClientConnectionImpl implem
             final HttpParams params) throws IOException {
         Args.notNull(route, "Route");
         Args.notNull(params, "HTTP parameters");
-        OperatedClientConnection conn;
+        final OperatedClientConnection conn;
         synchronized (this) {
             if (this.poolEntry == null) {
                 throw new ConnectionShutdownException();
@@ -323,8 +323,8 @@ class ManagedClientConnectionImpl implem
     public void tunnelTarget(
             final boolean secure, final HttpParams params) throws IOException {
         Args.notNull(params, "HTTP parameters");
-        HttpHost target;
-        OperatedClientConnection conn;
+        final HttpHost target;
+        final OperatedClientConnection conn;
         synchronized (this) {
             if (this.poolEntry == null) {
                 throw new ConnectionShutdownException();
@@ -352,7 +352,7 @@ class ManagedClientConnectionImpl implem
             final HttpHost next, final boolean secure, final HttpParams params) throws IOException {
         Args.notNull(next, "Next proxy");
         Args.notNull(params, "HTTP parameters");
-        OperatedClientConnection conn;
+        final OperatedClientConnection conn;
         synchronized (this) {
             if (this.poolEntry == null) {
                 throw new ConnectionShutdownException();
@@ -377,8 +377,8 @@ class ManagedClientConnectionImpl implem
     public void layerProtocol(
             final HttpContext context, final HttpParams params) throws IOException {
         Args.notNull(params, "HTTP parameters");
-        HttpHost target;
-        OperatedClientConnection conn;
+        final HttpHost target;
+        final OperatedClientConnection conn;
         synchronized (this) {
             if (this.poolEntry == null) {
                 throw new ConnectionShutdownException();

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java Mon Jun 10 15:52:49 2013
@@ -41,7 +41,6 @@ import org.apache.http.conn.ClientConnec
 import org.apache.http.conn.ConnectionPoolTimeoutException;
 import org.apache.http.conn.DnsResolver;
 import org.apache.http.conn.ManagedClientConnection;
-import org.apache.http.conn.OperatedClientConnection;
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.conn.scheme.SchemeRegistry;
 import org.apache.http.pool.ConnPoolControl;
@@ -50,8 +49,8 @@ import org.apache.http.util.Args;
 import org.apache.http.util.Asserts;
 
 /**
- * Manages a pool of {@link OperatedClientConnection client connections} and
- * is able to service connection requests from multiple execution threads.
+ * Manages a pool of {@link org.apache.http.conn.OperatedClientConnection}
+ * and is able to service connection requests from multiple execution threads.
  * Connections are pooled on a per route basis. A request for a route which
  * already the manager has persistent connections for available in the pool
  * will be services by leasing a connection from the pool rather than
@@ -204,7 +203,7 @@ public class PoolingClientConnectionMana
             final Future<HttpPoolEntry> future,
             final long timeout,
             final TimeUnit tunit) throws InterruptedException, ConnectionPoolTimeoutException {
-        HttpPoolEntry entry;
+        final HttpPoolEntry entry;
         try {
             entry = future.get(timeout, tunit);
             if (entry == null || future.isCancelled()) {
@@ -254,7 +253,7 @@ public class PoolingClientConnectionMana
                 if (managedConn.isMarkedReusable()) {
                     entry.updateExpiry(keepalive, tunit != null ? tunit : TimeUnit.MILLISECONDS);
                     if (this.log.isDebugEnabled()) {
-                        String s;
+                        final String s;
                         if (keepalive > 0) {
                             s = "for " + keepalive + " " + tunit;
                         } else {

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java Mon Jun 10 15:52:49 2013
@@ -235,7 +235,7 @@ public class PoolingHttpClientConnection
             final Future<CPoolEntry> future,
             final long timeout,
             final TimeUnit tunit) throws InterruptedException, ExecutionException, ConnectionPoolTimeoutException {
-        CPoolEntry entry;
+        final CPoolEntry entry;
         try {
             entry = future.get(timeout, tunit);
             if (entry == null || future.isCancelled()) {
@@ -267,7 +267,7 @@ public class PoolingHttpClientConnection
                     entry.setState(state);
                     entry.updateExpiry(keepalive, tunit != null ? tunit : TimeUnit.MILLISECONDS);
                     if (this.log.isDebugEnabled()) {
-                        String s;
+                        final String s;
                         if (keepalive > 0) {
                             s = "for " + (double) keepalive / 1000 + " seconds";
                         } else {
@@ -292,7 +292,7 @@ public class PoolingHttpClientConnection
             final HttpContext context) throws IOException {
         Args.notNull(managedConn, "Managed Connection");
         Args.notNull(route, "HTTP route");
-        ManagedHttpClientConnection conn;
+        final ManagedHttpClientConnection conn;
         synchronized (managedConn) {
             final CPoolEntry entry = CPoolProxy.getPoolEntry(managedConn);
             conn = entry.getConnection();
@@ -321,7 +321,7 @@ public class PoolingHttpClientConnection
             final HttpContext context) throws IOException {
         Args.notNull(managedConn, "Managed Connection");
         Args.notNull(route, "HTTP route");
-        ManagedHttpClientConnection conn;
+        final ManagedHttpClientConnection conn;
         synchronized (managedConn) {
             final CPoolEntry entry = CPoolProxy.getPoolEntry(managedConn);
             conn = entry.getConnection();

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SchemeRegistryFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SchemeRegistryFactory.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SchemeRegistryFactory.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SchemeRegistryFactory.java Mon Jun 10 15:52:49 2013
@@ -31,12 +31,11 @@ import org.apache.http.conn.scheme.Plain
 import org.apache.http.conn.scheme.Scheme;
 import org.apache.http.conn.scheme.SchemeRegistry;
 import org.apache.http.conn.ssl.SSLSocketFactory;
-import org.apache.http.impl.client.HttpClientBuilder;
 
 /**
  * @since 4.1
  *
- * @deprecated (4.3) use {@link HttpClientBuilder}.
+ * @deprecated (4.3) use {@link org.apache.http.impl.client.HttpClientBuilder}.
  */
 @ThreadSafe
 @Deprecated

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SystemDefaultRoutePlanner.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SystemDefaultRoutePlanner.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SystemDefaultRoutePlanner.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SystemDefaultRoutePlanner.java Mon Jun 10 15:52:49 2013
@@ -39,11 +39,11 @@ import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.conn.SchemePortResolver;
-import org.apache.http.conn.routing.HttpRoutePlanner;
 import org.apache.http.protocol.HttpContext;
 
 /**
- * {@link HttpRoutePlanner} implementation based on {@link ProxySelector}.
+ * {@link org.apache.http.conn.routing.HttpRoutePlanner} implementation
+ * based on {@link ProxySelector}.
  * By default, it will pick up the proxy settings of the JVM, either
  * from system properties or from the browser running the application.
  * Additionally, it interprets some

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntry.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntry.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntry.java Mon Jun 10 15:52:49 2013
@@ -48,7 +48,7 @@ public class BasicPoolEntry extends Abst
     private final long created;
 
     private long updated;
-    private long validUntil;
+    private final long validUntil;
     private long expiry;
 
     public BasicPoolEntry(final ClientConnectionOperator op,
@@ -142,7 +142,7 @@ public class BasicPoolEntry extends Abst
      */
     public void updateExpiry(final long time, final TimeUnit timeunit) {
         this.updated = System.currentTimeMillis();
-        long newExpiry;
+        final long newExpiry;
         if (time > 0) {
             newExpiry = this.updated + timeunit.toMillis(time);
         } else {

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java Mon Jun 10 15:52:49 2013
@@ -446,7 +446,7 @@ public class ConnPoolByRoute extends Abs
 
             if (reusable && rospl.getCapacity() >= 0) {
                 if (log.isDebugEnabled()) {
-                    String s;
+                    final String s;
                     if (validDuration > 0) {
                         s = "for " + validDuration + " " + timeUnit;
                     } else {
@@ -711,16 +711,14 @@ public class ConnPoolByRoute extends Abs
      * @param tunit     the unit for the <code>idletime</code>
      */
     @Override
-    public void closeIdleConnections(long idletime, final TimeUnit tunit) {
+    public void closeIdleConnections(final long idletime, final TimeUnit tunit) {
         Args.notNull(tunit, "Time unit");
-        if (idletime < 0) {
-            idletime = 0;
-        }
+        final long t = idletime > 0 ? idletime : 0;
         if (log.isDebugEnabled()) {
-            log.debug("Closing connections idle longer than "  + idletime + " " + tunit);
+            log.debug("Closing connections idle longer than "  + t + " " + tunit);
         }
         // the latest time for which connections will be closed
-        final long deadline = System.currentTimeMillis() - tunit.toMillis(idletime);
+        final long deadline = System.currentTimeMillis() - tunit.toMillis(t);
         poolLock.lock();
         try {
             final Iterator<BasicPoolEntry>  iter = freeConnections.iterator();

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java Mon Jun 10 15:52:49 2013
@@ -26,7 +26,6 @@
  */
 package org.apache.http.impl.conn.tsccm;
 
-import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.http.conn.ConnectionPoolTimeoutException;
@@ -36,7 +35,7 @@ import org.apache.http.conn.ConnectionPo
  *
  * @since 4.0
  *
- * @deprecated (4.2)  use {@link Future}
+ * @deprecated (4.2)  use {@link java.util.concurrent.Future}
  */
 @Deprecated
 public interface PoolEntryRequest {

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java Mon Jun 10 15:52:49 2013
@@ -37,20 +37,18 @@ import org.apache.http.conn.ClientConnec
 import org.apache.http.conn.ClientConnectionRequest;
 import org.apache.http.conn.ConnectionPoolTimeoutException;
 import org.apache.http.conn.ManagedClientConnection;
-import org.apache.http.conn.OperatedClientConnection;
 import org.apache.http.conn.params.ConnPerRouteBean;
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.conn.scheme.SchemeRegistry;
 import org.apache.http.impl.conn.DefaultClientConnectionOperator;
-import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.impl.conn.SchemeRegistryFactory;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 import org.apache.http.util.Asserts;
 
 /**
- * Manages a pool of {@link OperatedClientConnection client connections} and
- * is able to service connection requests from multiple execution threads.
+ * Manages a pool of {@link org.apache.http.conn.OperatedClientConnection }
+ * and is able to service connection requests from multiple execution threads.
  * Connections are pooled on a per route basis. A request for a route which
  * already the manager has persistent connections for available in the pool
  * will be services by leasing a connection from the pool rather than
@@ -66,7 +64,7 @@ import org.apache.http.util.Asserts;
  *
  * @since 4.0
  *
- * @deprecated (4.2)  use {@link PoolingHttpClientConnectionManager}
+ * @deprecated (4.2)  use {@link org.apache.http.impl.conn.PoolingHttpClientConnectionManager}
  */
 @ThreadSafe
 @Deprecated

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicMaxAgeHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicMaxAgeHandler.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicMaxAgeHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicMaxAgeHandler.java Mon Jun 10 15:52:49 2013
@@ -50,7 +50,7 @@ public class BasicMaxAgeHandler extends 
         if (value == null) {
             throw new MalformedCookieException("Missing value for max-age attribute");
         }
-        int age;
+        final int age;
         try {
             age = Integer.parseInt(value);
         } catch (final NumberFormatException e) {

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicPathHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicPathHandler.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicPathHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicPathHandler.java Mon Jun 10 15:52:49 2013
@@ -34,6 +34,7 @@ import org.apache.http.cookie.CookieRest
 import org.apache.http.cookie.MalformedCookieException;
 import org.apache.http.cookie.SetCookie;
 import org.apache.http.util.Args;
+import org.apache.http.util.TextUtils;
 
 /**
  *
@@ -46,13 +47,10 @@ public class BasicPathHandler implements
         super();
     }
 
-    public void parse(final SetCookie cookie, String value)
-            throws MalformedCookieException {
+    public void parse(
+            final SetCookie cookie, final String value) throws MalformedCookieException {
         Args.notNull(cookie, "Cookie");
-        if (value == null || value.trim().length() == 0) {
-            value = "/";
-        }
-        cookie.setPath(value);
+        cookie.setPath(!TextUtils.isBlank(value) ? value : "/");
     }
 
     public void validate(final Cookie cookie, final CookieOrigin origin)

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java Mon Jun 10 15:52:49 2013
@@ -111,8 +111,8 @@ public class BestMatchSpec implements Co
             // Need to parse the header again, because Netscape style cookies do not correctly
             // support multiple header elements (comma cannot be treated as an element separator)
             final NetscapeDraftHeaderParser parser = NetscapeDraftHeaderParser.DEFAULT;
-            CharArrayBuffer buffer;
-            ParserCursor cursor;
+            final CharArrayBuffer buffer;
+            final ParserCursor cursor;
             if (header instanceof FormattedHeader) {
                 buffer = ((FormattedHeader) header).getBuffer();
                 cursor = new ParserCursor(

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java Mon Jun 10 15:52:49 2013
@@ -94,7 +94,7 @@ public class BrowserCompatSpec extends C
             case SECURITYLEVEL_IE_MEDIUM:
                 registerAttribHandler(ClientCookie.PATH_ATTR, new BasicPathHandler() {
                         @Override
-                        public void validate(Cookie cookie, CookieOrigin origin) throws MalformedCookieException {
+                        public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException {
                             // No validation
                         }
                     }
@@ -147,8 +147,8 @@ public class BrowserCompatSpec extends C
             // Need to parse the header again, because Netscape style cookies do not correctly
             // support multiple header elements (comma cannot be treated as an element separator)
             final NetscapeDraftHeaderParser parser = NetscapeDraftHeaderParser.DEFAULT;
-            CharArrayBuffer buffer;
-            ParserCursor cursor;
+            final CharArrayBuffer buffer;
+            final ParserCursor cursor;
             if (header instanceof FormattedHeader) {
                 buffer = ((FormattedHeader) header).getBuffer();
                 cursor = new ParserCursor(

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpecFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpecFactory.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpecFactory.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpecFactory.java Mon Jun 10 15:52:49 2013
@@ -50,12 +50,12 @@ public class BrowserCompatSpecFactory im
     public enum SecurityLevel {
         SECURITYLEVEL_DEFAULT,
         SECURITYLEVEL_IE_MEDIUM
-    };
+    }
 
     private final String[] datepatterns;
     private final SecurityLevel securityLevel;
 
-    public BrowserCompatSpecFactory(final String[] datepatterns, SecurityLevel securityLevel) {
+    public BrowserCompatSpecFactory(final String[] datepatterns, final SecurityLevel securityLevel) {
         super();
         this.datepatterns = datepatterns;
         this.securityLevel = securityLevel;

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DateUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DateUtils.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DateUtils.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DateUtils.java Mon Jun 10 15:52:49 2013
@@ -27,7 +27,6 @@
 
 package org.apache.http.impl.cookie;
 
-import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.TimeZone;
 
@@ -135,8 +134,8 @@ public final class DateUtils {
 
     /**
      * Formats the given date according to the specified pattern.  The pattern
-     * must conform to that used by the {@link SimpleDateFormat simple date
-     * format} class.
+     * must conform to that used by the {@link java.text.SimpleDateFormat simple
+     * date format} class.
      *
      * @param date The date to format.
      * @param pattern The pattern to use for formatting the date.
@@ -144,7 +143,7 @@ public final class DateUtils {
      *
      * @throws IllegalArgumentException If the given date pattern is invalid.
      *
-     * @see SimpleDateFormat
+     * @see java.text.SimpleDateFormat
      */
     public static String formatDate(final Date date, final String pattern) {
         return org.apache.http.client.utils.DateUtils.formatDate(date, pattern);

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/NetscapeDraftSpec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/NetscapeDraftSpec.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/NetscapeDraftSpec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/NetscapeDraftSpec.java Mon Jun 10 15:52:49 2013
@@ -37,7 +37,6 @@ import org.apache.http.annotation.NotThr
 import org.apache.http.cookie.ClientCookie;
 import org.apache.http.cookie.Cookie;
 import org.apache.http.cookie.CookieOrigin;
-import org.apache.http.cookie.CookieSpec;
 import org.apache.http.cookie.MalformedCookieException;
 import org.apache.http.cookie.SM;
 import org.apache.http.message.BufferedHeader;
@@ -46,9 +45,10 @@ import org.apache.http.util.Args;
 import org.apache.http.util.CharArrayBuffer;
 
 /**
- * This {@link CookieSpec} implementation conforms to the original draft
- * specification published by Netscape Communications. It should be avoided
- * unless absolutely necessary for compatibility with legacy code.
+ * This {@link org.apache.http.cookie.CookieSpec} implementation conforms to
+ * the original draft specification published by Netscape Communications.
+ * It should be avoided unless absolutely necessary for compatibility with
+ * legacy applications.
  *
  * @since 4.0
  */
@@ -114,8 +114,8 @@ public class NetscapeDraftSpec extends C
                     + header.toString() + "'");
         }
         final NetscapeDraftHeaderParser parser = NetscapeDraftHeaderParser.DEFAULT;
-        CharArrayBuffer buffer;
-        ParserCursor cursor;
+        final CharArrayBuffer buffer;
+        final ParserCursor cursor;
         if (header instanceof FormattedHeader) {
             buffer = ((FormattedHeader) header).getBuffer();
             cursor = new ParserCursor(

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2109Spec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2109Spec.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2109Spec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2109Spec.java Mon Jun 10 15:52:49 2013
@@ -40,7 +40,6 @@ import org.apache.http.cookie.Cookie;
 import org.apache.http.cookie.CookieOrigin;
 import org.apache.http.cookie.CookiePathComparator;
 import org.apache.http.cookie.CookieRestrictionViolationException;
-import org.apache.http.cookie.CookieSpec;
 import org.apache.http.cookie.MalformedCookieException;
 import org.apache.http.cookie.SM;
 import org.apache.http.message.BufferedHeader;
@@ -48,9 +47,9 @@ import org.apache.http.util.Args;
 import org.apache.http.util.CharArrayBuffer;
 
 /**
- * RFC 2109 compliant {@link CookieSpec} implementation. This is an older
- * version of the official HTTP state management specification superseded
- * by RFC 2965.
+ * RFC 2109 compliant {@link org.apache.http.cookie.CookieSpec} implementation.
+ * This is an older version of the official HTTP state management specification
+ * superseded by RFC 2965.
  *
  * @see RFC2965Spec
  *
@@ -120,17 +119,20 @@ public class RFC2109Spec extends CookieS
         super.validate(cookie, origin);
     }
 
-    public List<Header> formatCookies(List<Cookie> cookies) {
+    public List<Header> formatCookies(final List<Cookie> cookies) {
         Args.notEmpty(cookies, "List of cookies");
+        List<Cookie> cookieList;
         if (cookies.size() > 1) {
             // Create a mutable copy and sort the copy.
-            cookies = new ArrayList<Cookie>(cookies);
-            Collections.sort(cookies, PATH_COMPARATOR);
+            cookieList = new ArrayList<Cookie>(cookies);
+            Collections.sort(cookieList, PATH_COMPARATOR);
+        } else {
+            cookieList = cookies;
         }
         if (this.oneHeader) {
-            return doFormatOneHeader(cookies);
+            return doFormatOneHeader(cookieList);
         } else {
-            return doFormatManyHeaders(cookies);
+            return doFormatManyHeaders(cookieList);
         }
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2965DomainAttributeHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2965DomainAttributeHandler.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2965DomainAttributeHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2965DomainAttributeHandler.java Mon Jun 10 15:52:49 2013
@@ -55,8 +55,8 @@ public class RFC2965DomainAttributeHandl
     /**
      * Parse cookie domain attribute.
      */
-    public void parse(final SetCookie cookie, String domain)
-            throws MalformedCookieException {
+    public void parse(
+            final SetCookie cookie, final String domain) throws MalformedCookieException {
         Args.notNull(cookie, "Cookie");
         if (domain == null) {
             throw new MalformedCookieException(
@@ -66,16 +66,17 @@ public class RFC2965DomainAttributeHandl
             throw new MalformedCookieException(
                     "Blank value for domain attribute");
         }
-        domain = domain.toLowerCase(Locale.ENGLISH);
+        String s = domain;
+        s = s.toLowerCase(Locale.ENGLISH);
         if (!domain.startsWith(".")) {
             // Per RFC 2965 section 3.2.2
             // "... If an explicitly specified value does not start with
             // a dot, the user agent supplies a leading dot ..."
             // That effectively implies that the domain attribute
             // MAY NOT be an IP address of a host name
-            domain = '.' + domain;
+            s = '.' + s;
         }
-        cookie.setDomain(domain);
+        cookie.setDomain(s);
     }
 
     /**

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2965Spec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2965Spec.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2965Spec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2965Spec.java Mon Jun 10 15:52:49 2013
@@ -40,7 +40,6 @@ import org.apache.http.cookie.ClientCook
 import org.apache.http.cookie.Cookie;
 import org.apache.http.cookie.CookieAttributeHandler;
 import org.apache.http.cookie.CookieOrigin;
-import org.apache.http.cookie.CookieSpec;
 import org.apache.http.cookie.MalformedCookieException;
 import org.apache.http.cookie.SM;
 import org.apache.http.message.BufferedHeader;
@@ -48,7 +47,7 @@ import org.apache.http.util.Args;
 import org.apache.http.util.CharArrayBuffer;
 
 /**
- * RFC 2965 compliant {@link CookieSpec} implementation.
+ * RFC 2965 compliant {@link org.apache.http.cookie.CookieSpec} implementation.
  *
  * @since 4.0
  */
@@ -75,24 +74,22 @@ public class RFC2965Spec extends RFC2109
     @Override
     public List<Cookie> parse(
             final Header header,
-            CookieOrigin origin) throws MalformedCookieException {
+            final CookieOrigin origin) throws MalformedCookieException {
         Args.notNull(header, "Header");
         Args.notNull(origin, "Cookie origin");
         if (!header.getName().equalsIgnoreCase(SM.SET_COOKIE2)) {
             throw new MalformedCookieException("Unrecognized cookie header '"
                     + header.toString() + "'");
         }
-        origin = adjustEffectiveHost(origin);
         final HeaderElement[] elems = header.getElements();
-        return createCookies(elems, origin);
+        return createCookies(elems, adjustEffectiveHost(origin));
     }
 
     @Override
     protected List<Cookie> parse(
             final HeaderElement[] elems,
-            CookieOrigin origin) throws MalformedCookieException {
-        origin = adjustEffectiveHost(origin);
-        return createCookies(elems, origin);
+            final CookieOrigin origin) throws MalformedCookieException {
+        return createCookies(elems, adjustEffectiveHost(origin));
     }
 
     private List<Cookie> createCookies(
@@ -138,20 +135,18 @@ public class RFC2965Spec extends RFC2109
     }
 
     @Override
-    public void validate(final Cookie cookie, CookieOrigin origin)
-            throws MalformedCookieException {
+    public void validate(
+            final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException {
         Args.notNull(cookie, "Cookie");
         Args.notNull(origin, "Cookie origin");
-        origin = adjustEffectiveHost(origin);
-        super.validate(cookie, origin);
+        super.validate(cookie, adjustEffectiveHost(origin));
     }
 
     @Override
-    public boolean match(final Cookie cookie, CookieOrigin origin) {
+    public boolean match(final Cookie cookie, final CookieOrigin origin) {
         Args.notNull(cookie, "Cookie");
         Args.notNull(origin, "Cookie origin");
-        origin = adjustEffectiveHost(origin);
-        return super.match(cookie, origin);
+        return super.match(cookie, adjustEffectiveHost(origin));
     }
 
     /**
@@ -171,7 +166,8 @@ public class RFC2965Spec extends RFC2109
                 if (s.trim().length() > 0) {
                     final int[] ports = cookie.getPorts();
                     if (ports != null) {
-                        for (int i = 0, len = ports.length; i < len; i++) {
+                        final int len = ports.length;
+                        for (int i = 0; i < len; i++) {
                             if (i > 0) {
                                 buffer.append(",");
                             }

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java Mon Jun 10 15:52:49 2013
@@ -162,7 +162,7 @@ public class MainClientExec implements C
 
         final RequestConfig config = context.getRequestConfig();
 
-        HttpClientConnection managedConn;
+        final HttpClientConnection managedConn;
         try {
             final int timeout = config.getConnectionRequestTimeout();
             managedConn = connRequest.get(timeout > 0 ? timeout : 0, TimeUnit.MILLISECONDS);
@@ -258,7 +258,7 @@ public class MainClientExec implements C
                     // Set the idle duration of this connection
                     final long duration = keepAliveStrategy.getKeepAliveDuration(response, context);
                     if (this.log.isDebugEnabled()) {
-                        String s;
+                        final String s;
                         if (duration > 0) {
                             s = "for " + duration + " " + TimeUnit.MILLISECONDS;
                         } else {

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java Mon Jun 10 15:52:49 2013
@@ -122,7 +122,7 @@ public class MinimalClientExec implement
 
         final RequestConfig config = context.getRequestConfig();
 
-        HttpClientConnection managedConn;
+        final HttpClientConnection managedConn;
         try {
             final int timeout = config.getConnectionRequestTimeout();
             managedConn = connRequest.get(timeout > 0 ? timeout : 0, TimeUnit.MILLISECONDS);

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIUtils.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIUtils.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIUtils.java Mon Jun 10 15:52:49 2013
@@ -30,16 +30,6 @@ import java.net.URI;
 import java.util.Arrays;
 
 import org.apache.http.HttpHost;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.HttpVersion;
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.client.protocol.HttpClientContext;
-import org.apache.http.impl.client.DefaultRedirectStrategy;
-import org.apache.http.message.BasicHttpResponse;
-import org.apache.http.protocol.HttpCoreContext;
 import org.junit.Assert;
 import org.junit.Test;
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/routing/TestRouteTracker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/routing/TestRouteTracker.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/routing/TestRouteTracker.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/routing/TestRouteTracker.java Mon Jun 10 15:52:49 2013
@@ -584,12 +584,13 @@ public class TestRouteTracker {
      * @return  <code>true</code> iff the route is complete
      */
     public final static boolean checkVia(final RouteTracker rt, final HttpRoute r,
-                                         final HttpRouteDirector rd, int steps) {
+                                         final HttpRouteDirector rd, final int steps) {
 
         final String msg = r.toString() + " @ " + rt.toString();
 
         boolean complete = false;
-        while (!complete && (steps > 0)) {
+        int n = steps;
+        while (!complete && (n > 0)) {
 
             final int action = rd.nextStep(r, rt.toRoute());
             switch (action) {
@@ -676,7 +677,7 @@ public class TestRouteTracker {
                 break;
 
             } // switch
-            steps--;
+            n--;
         }
 
         return complete;

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/ssl/TestHostnameVerifier.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/ssl/TestHostnameVerifier.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/ssl/TestHostnameVerifier.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/ssl/TestHostnameVerifier.java Mon Jun 10 15:52:49 2013
@@ -310,8 +310,8 @@ public class TestHostnameVerifier {
     @Test
     // Check compressed IPv6 hostname matching
     public void testHTTPCLIENT_1316() throws Exception{
-        String cns[] = {"2001:0db8:aaaa:bbbb:cccc:0:0:0001"};
-        String alt[] = {};
+        final String cns[] = {"2001:0db8:aaaa:bbbb:cccc:0:0:0001"};
+        final String alt[] = {};
         final X509HostnameVerifier bhv = new BrowserCompatHostnameVerifier();
         final X509HostnameVerifier shv = new StrictHostnameVerifier();
         checkMatching(bhv, "2001:0db8:aaaa:bbbb:cccc:0:0:0001", cns, alt, false);

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java Mon Jun 10 15:52:49 2013
@@ -368,17 +368,12 @@ public class TestAbortHandling extends I
                     }
 
                     public HttpClientConnection get(
-                            long timeout, final TimeUnit tunit)
-                            throws InterruptedException,
-                            ConnectionPoolTimeoutException {
+                            final long timeout,
+                            final TimeUnit tunit) throws InterruptedException, ConnectionPoolTimeoutException {
                         connLatch.countDown(); // notify waiter that we're getting a connection
 
                         // zero usually means sleep forever, but CountDownLatch doesn't interpret it that way.
-                        if(timeout == 0) {
-                            timeout = Integer.MAX_VALUE;
-                        }
-
-                        if(!awaitLatch.await(timeout, tunit)) {
+                        if(!awaitLatch.await(timeout > 0 ? timeout : Integer.MAX_VALUE, tunit)) {
                             throw new ConnectionPoolTimeoutException();
                         }
 
@@ -428,17 +423,12 @@ public class TestAbortHandling extends I
                 }
 
                 public HttpClientConnection get(
-                        long timeout, final TimeUnit tunit)
-                        throws InterruptedException,
-                        ConnectionPoolTimeoutException {
+                        final long timeout,
+                        final TimeUnit tunit) throws InterruptedException, ConnectionPoolTimeoutException {
                     connLatch.countDown(); // notify waiter that we're getting a connection
 
                     // zero usually means sleep forever, but CountDownLatch doesn't interpret it that way.
-                    if(timeout == 0) {
-                        timeout = Integer.MAX_VALUE;
-                    }
-
-                    if(!awaitLatch.await(timeout, tunit)) {
+                    if(!awaitLatch.await(timeout > 0 ? timeout : Integer.MAX_VALUE, tunit)) {
                         throw new ConnectionPoolTimeoutException();
                     }
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientRequestExecution.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientRequestExecution.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientRequestExecution.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientRequestExecution.java Mon Jun 10 15:52:49 2013
@@ -52,7 +52,6 @@ import org.apache.http.entity.StringEnti
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.message.BasicHttpRequest;
 import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpCoreContext;
 import org.apache.http.protocol.HttpRequestExecutor;
 import org.apache.http.protocol.HttpRequestHandler;
 import org.apache.http.util.EntityUtils;

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestContentCodings.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestContentCodings.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestContentCodings.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestContentCodings.java Mon Jun 10 15:52:49 2013
@@ -41,13 +41,11 @@ import java.util.zip.GZIPOutputStream;
 
 import org.apache.http.Header;
 import org.apache.http.HeaderElement;
-import org.apache.http.HttpEntity;
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
 import org.apache.http.client.HttpClient;
-import org.apache.http.client.entity.DeflateDecompressingEntity;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.entity.InputStreamEntity;
 import org.apache.http.entity.StringEntity;
@@ -107,7 +105,6 @@ public class TestContentCodings extends 
      * to return RFC1950 streams for <code>deflate</code> content coding.
      *
      * @throws Exception
-     * @see DeflateDecompressingEntity
      */
     @Test
     public void testDeflateSupportForServerReturningRfc1950Stream() throws Exception {
@@ -128,7 +125,6 @@ public class TestContentCodings extends 
      * to return RFC1951 streams for <code>deflate</code> content coding.
      *
      * @throws Exception
-     * @see DeflateDecompressingEntity
      */
     @Test
     public void testDeflateSupportForServerReturningRfc1951Stream() throws Exception {
@@ -216,12 +212,6 @@ public class TestContentCodings extends 
         }
     }
 
-    /**
-     * Test that the returned {@link HttpEntity} in the response correctly overrides
-     * {@link HttpEntity#writeTo(OutputStream)} for gzip-encoding.
-     *
-     * @throws Exception
-     */
     @Test
     public void testHttpEntityWriteToForGzip() throws Exception {
         final String entityText = "Hello, this is some plain text coming back.";
@@ -239,12 +229,6 @@ public class TestContentCodings extends 
         Assert.assertEquals(entityText, out.toString("utf-8"));
     }
 
-    /**
-     * Test that the returned {@link HttpEntity} in the response correctly overrides
-     * {@link HttpEntity#writeTo(OutputStream)} for deflate-encoding.
-     *
-     * @throws Exception
-     */
     @Test
     public void testHttpEntityWriteToForDeflate() throws Exception {
         final String entityText = "Hello, this is some plain text coming back.";
@@ -475,8 +459,7 @@ public class TestContentCodings extends 
                 } finally {
                     endGate.countDown();
                 }
-            } catch (final InterruptedException e) {
-
+            } catch (final InterruptedException ignore) {
             }
         }
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestRedirects.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestRedirects.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestRedirects.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestRedirects.java Mon Jun 10 15:52:49 2013
@@ -248,7 +248,7 @@ public class TestRedirects extends Integ
         Assert.assertEquals(HttpStatus.SC_MULTIPLE_CHOICES, response.getStatusLine().getStatusCode());
         Assert.assertEquals("/oldlocation/", reqWrapper.getRequestLine().getUri());
 
-        URICollection redirects = context.getRedirectLocations();
+        final URICollection redirects = context.getRedirectLocations();
         Assert.assertNull(redirects);
     }
 
@@ -272,11 +272,11 @@ public class TestRedirects extends Integ
         Assert.assertEquals("/newlocation/", reqWrapper.getRequestLine().getUri());
         Assert.assertEquals(target, host);
 
-        URICollection redirects = context.getRedirectLocations();
+        final URICollection redirects = context.getRedirectLocations();
         Assert.assertNotNull(redirects);
         Assert.assertEquals(1, redirects.getCount());
 
-        URI redirect = URIUtils.rewriteURI(new URI("/newlocation/"), target);
+        final URI redirect = URIUtils.rewriteURI(new URI("/newlocation/"), target);
         Assert.assertTrue(redirects.contains(redirect));
     }
 
@@ -641,7 +641,7 @@ public class TestRedirects extends Integ
         try {
             this.httpclient.execute(target, httpget);
         } catch (ClientProtocolException ex) {
-            Throwable cause = ex.getCause();
+            final Throwable cause = ex.getCause();
             Assert.assertTrue(cause instanceof HttpException);
             throw ex;
         }

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestManagedHttpClientConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestManagedHttpClientConnectionFactory.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestManagedHttpClientConnectionFactory.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestManagedHttpClientConnectionFactory.java Mon Jun 10 15:52:49 2013
@@ -39,7 +39,7 @@ public class TestManagedHttpClientConnec
         validateDefault(ManagedHttpClientConnectionFactory.INSTANCE.create(ConnectionConfig.DEFAULT));
     }
 
-    private void validateDefault(ManagedHttpClientConnection managedHttpClientConnection) {
+    private void validateDefault(final ManagedHttpClientConnection managedHttpClientConnection) {
         // Nothing really interesting to check here
         Assert.assertNotNull(managedHttpClientConnection.getId());
     }

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/mockup/SecureSocketFactoryMockup.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/mockup/SecureSocketFactoryMockup.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/mockup/SecureSocketFactoryMockup.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/mockup/SecureSocketFactoryMockup.java Mon Jun 10 15:52:49 2013
@@ -29,12 +29,11 @@ package org.apache.http.mockup;
 
 import java.net.Socket;
 
-import org.apache.http.conn.scheme.LayeredSchemeSocketFactory;
 import org.apache.http.conn.scheme.SchemeLayeredSocketFactory;
 import org.apache.http.params.HttpParams;
 
 /**
- * {@link LayeredSchemeSocketFactory} mockup implementation.
+ * {@link org.apache.http.conn.scheme.LayeredSchemeSocketFactory} mockup implementation.
  */
 @Deprecated
 public class SecureSocketFactoryMockup extends SocketFactoryMockup

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java Mon Jun 10 15:52:49 2013
@@ -67,20 +67,14 @@ public class MultipartEntity implements 
      * @param charset the character set to use, may be {@code null}, in which case {@link MIME#DEFAULT_CHARSET} - i.e. US-ASCII - is used.
      */
     public MultipartEntity(
-            HttpMultipartMode mode,
-            String boundary,
+            final HttpMultipartMode mode,
+            final String boundary,
             final Charset charset) {
         super();
-        if (boundary == null) {
-            boundary = generateBoundary();
-        }
-        if (mode == null) {
-            mode = HttpMultipartMode.STRICT;
-        }
-        this.multipart = new HttpMultipart("form-data", charset, boundary, mode);
-        this.contentType = new BasicHeader(
-                HTTP.CONTENT_TYPE,
-                generateContentType(boundary, charset));
+        final String b = boundary != null ? boundary : generateBoundary();
+        final HttpMultipartMode m = mode != null ? mode : HttpMultipartMode.STRICT;
+        this.multipart = new HttpMultipart("form-data", charset, b, m);
+        this.contentType = new BasicHeader(HTTP.CONTENT_TYPE, generateContentType(b, charset));
         this.dirty = true;
     }
 

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/ByteArrayBody.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/ByteArrayBody.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/ByteArrayBody.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/ByteArrayBody.java Mon Jun 10 15:52:49 2013
@@ -31,13 +31,12 @@ import java.io.OutputStream;
 
 import org.apache.http.entity.ContentType;
 import org.apache.http.entity.mime.MIME;
-import org.apache.http.entity.mime.MultipartEntityBuilder;
 import org.apache.http.util.Args;
 
 /**
  * Binary body part backed by a byte array.
  *
- * @see MultipartEntityBuilder
+ * @see org.apache.http.entity.mime.MultipartEntityBuilder
  *
  * @since 4.1
  */
@@ -61,7 +60,7 @@ public class ByteArrayBody extends Abstr
      * @param filename The name of the file contained in this part.
      *
      * @deprecated (4.3) use {@link ByteArrayBody#ByteArrayBody(byte[], ContentType, String)}
-     *   or {@link MultipartEntityBuilder}
+     *   or {@link org.apache.http.entity.mime.MultipartEntityBuilder}
      */
     @Deprecated
     public ByteArrayBody(final byte[] data, final String mimeType, final String filename) {

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/FileBody.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/FileBody.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/FileBody.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/FileBody.java Mon Jun 10 15:52:49 2013
@@ -35,13 +35,12 @@ import java.io.OutputStream;
 
 import org.apache.http.entity.ContentType;
 import org.apache.http.entity.mime.MIME;
-import org.apache.http.entity.mime.MultipartEntityBuilder;
 import org.apache.http.util.Args;
 
 /**
  * Binary body part backed by a file.
  *
- * @see MultipartEntityBuilder
+ * @see org.apache.http.entity.mime.MultipartEntityBuilder
  *
  * @since 4.0
  */
@@ -54,7 +53,7 @@ public class FileBody extends AbstractCo
      * @since 4.1
      *
      * @deprecated (4.3) use {@link FileBody#FileBody(File, ContentType, String)}
-     *   or {@link MultipartEntityBuilder}
+     *   or {@link org.apache.http.entity.mime.MultipartEntityBuilder}
      */
     @Deprecated
     public FileBody(final File file,
@@ -68,7 +67,7 @@ public class FileBody extends AbstractCo
      * @since 4.1
      *
      * @deprecated (4.3) use {@link FileBody#FileBody(File, ContentType)}
-     *   or {@link MultipartEntityBuilder}
+     *   or {@link org.apache.http.entity.mime.MultipartEntityBuilder}
      */
     @Deprecated
     public FileBody(final File file,
@@ -79,7 +78,7 @@ public class FileBody extends AbstractCo
 
     /**
      * @deprecated (4.3) use {@link FileBody#FileBody(File, ContentType)}
-     *   or {@link MultipartEntityBuilder}
+     *   or {@link org.apache.http.entity.mime.MultipartEntityBuilder}
      */
     @Deprecated
     public FileBody(final File file, final String mimeType) {

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/InputStreamBody.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/InputStreamBody.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/InputStreamBody.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/InputStreamBody.java Mon Jun 10 15:52:49 2013
@@ -33,13 +33,12 @@ import java.io.OutputStream;
 
 import org.apache.http.entity.ContentType;
 import org.apache.http.entity.mime.MIME;
-import org.apache.http.entity.mime.MultipartEntityBuilder;
 import org.apache.http.util.Args;
 
 /**
  * Binary body part backed by an input stream.
  *
- * @see MultipartEntityBuilder
+ * @see org.apache.http.entity.mime.MultipartEntityBuilder
  *
  * @since 4.0
  */
@@ -52,7 +51,7 @@ public class InputStreamBody extends Abs
      * @since 4.1
      *
      * @deprecated (4.3) use {@link InputStreamBody#InputStreamBody(InputStream, ContentType,
-     *  String)} or {@link MultipartEntityBuilder}
+     *  String)} or {@link org.apache.http.entity.mime.MultipartEntityBuilder}
      */
     @Deprecated
     public InputStreamBody(final InputStream in, final String mimeType, final String filename) {

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/StringBody.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/StringBody.java?rev=1491511&r1=1491510&r2=1491511&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/StringBody.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/StringBody.java Mon Jun 10 15:52:49 2013
@@ -40,13 +40,12 @@ import java.nio.charset.UnsupportedChars
 import org.apache.http.Consts;
 import org.apache.http.entity.ContentType;
 import org.apache.http.entity.mime.MIME;
-import org.apache.http.entity.mime.MultipartEntityBuilder;
 import org.apache.http.util.Args;
 
 /**
  * Text body part backed by a byte array.
  *
- * @see MultipartEntityBuilder
+ * @see org.apache.http.entity.mime.MultipartEntityBuilder
  *
  * @since 4.0
  */
@@ -58,7 +57,7 @@ public class StringBody extends Abstract
      * @since 4.1
      *
      * @deprecated (4.3) use {@link StringBody#StringBody(String, ContentType)}
-     *   or {@link MultipartEntityBuilder}
+     *   or {@link org.apache.http.entity.mime.MultipartEntityBuilder}
      */
     @Deprecated
     public static StringBody create(
@@ -76,7 +75,7 @@ public class StringBody extends Abstract
      * @since 4.1
      *
      * @deprecated (4.3) use {@link StringBody#StringBody(String, ContentType)}
-     *   or {@link MultipartEntityBuilder}
+     *   or {@link org.apache.http.entity.mime.MultipartEntityBuilder}
      */
     @Deprecated
     public static StringBody create(
@@ -88,7 +87,7 @@ public class StringBody extends Abstract
      * @since 4.1
      *
      * @deprecated (4.3) use {@link StringBody#StringBody(String, ContentType)}
-     *   or {@link MultipartEntityBuilder}
+     *   or {@link org.apache.http.entity.mime.MultipartEntityBuilder}
      */
     @Deprecated
     public static StringBody create(final String text) throws IllegalArgumentException {
@@ -105,7 +104,7 @@ public class StringBody extends Abstract
      * @throws IllegalArgumentException if the {@code text} parameter is null
      *
      * @deprecated (4.3) use {@link StringBody#StringBody(String, ContentType)}
-     *   or {@link MultipartEntityBuilder}
+     *   or {@link org.apache.http.entity.mime.MultipartEntityBuilder}
      */
     @Deprecated
     public StringBody(
@@ -125,7 +124,7 @@ public class StringBody extends Abstract
      * @throws IllegalArgumentException if the {@code text} parameter is null
      *
      * @deprecated (4.3) use {@link StringBody#StringBody(String, ContentType)}
-     *   or {@link MultipartEntityBuilder}
+     *   or {@link org.apache.http.entity.mime.MultipartEntityBuilder}
      */
     @Deprecated
     public StringBody(final String text, final Charset charset) throws UnsupportedEncodingException {
@@ -142,7 +141,7 @@ public class StringBody extends Abstract
      * @throws IllegalArgumentException if the {@code text} parameter is null
      *
      * @deprecated (4.3) use {@link StringBody#StringBody(String, ContentType)}
-     *   or {@link MultipartEntityBuilder}
+     *   or {@link org.apache.http.entity.mime.MultipartEntityBuilder}
      */
     @Deprecated
     public StringBody(final String text) throws UnsupportedEncodingException {



Mime
View raw message