hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1523228 - in /httpcomponents/httpasyncclient/trunk: httpasyncclient-cache/src/main/java/org/apache/http/impl/client/cache/ httpasyncclient/src/main/java/org/apache/http/impl/nio/client/ httpasyncclient/src/main/java/org/apache/http/impl/ni...
Date Sat, 14 Sep 2013 12:53:11 GMT
Author: olegk
Date: Sat Sep 14 12:53:10 2013
New Revision: 1523228

URL: http://svn.apache.org/r1523228
Log:
Code cleanups

Modified:
    httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/main/java/org/apache/http/impl/client/cache/AsynchronousAsyncValidator.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/impl/nio/client/CloseableHttpAsyncClient.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MinimalClientExchangeHandlerImpl.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/ManagedNHttpClientConnectionFactory.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/BaseZeroCopyRequestProducer.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/ZeroCopyConsumer.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/util/HttpAsyncClientUtils.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/HttpAsyncTestBase.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/localserver/EchoHandler.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientAuthentication.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientAuthenticationFallBack.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientReauthentication.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsync.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncClientUtils.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncMinimal.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPrematureTermination.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestRedirects.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestStatefulConnManagement.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestAsyncConsumers.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestZeroCopy.java

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/main/java/org/apache/http/impl/client/cache/AsynchronousAsyncValidator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/main/java/org/apache/http/impl/client/cache/AsynchronousAsyncValidator.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/main/java/org/apache/http/impl/client/cache/AsynchronousAsyncValidator.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/main/java/org/apache/http/impl/client/cache/AsynchronousAsyncValidator.java
Sat Sep 14 12:53:10 2013
@@ -56,7 +56,7 @@ class AsynchronousAsyncValidator {
 
     /**
      * Create AsynchronousValidator which will make revalidation requests using
-     * the supplied {@link CachingHttpClient}, and a {@link ThreadPoolExecutor}
+     * the supplied {@link CachingHttpAsyncClient}, and a {@link ThreadPoolExecutor}
      * generated according to the thread pool settings provided in the given
      * {@link CacheConfig}.
      *
@@ -78,7 +78,7 @@ class AsynchronousAsyncValidator {
 
     /**
      * Create AsynchronousValidator which will make revalidation requests using
-     * the supplied {@link CachingHttpClient} and {@link ExecutorService}.
+     * the supplied {@link CachingHttpAsyncClient} and {@link ExecutorService}.
      *
      * @param cachingClient
      *            used to execute asynchronous requests
@@ -94,11 +94,6 @@ class AsynchronousAsyncValidator {
 
     /**
      * Schedules an asynchronous revalidation
-     *
-     * @param target
-     * @param request
-     * @param context
-     * @param entry
      */
     public synchronized void revalidateCacheEntry(final HttpHost target, final HttpRequestWrapper
request,
             final HttpContext context, final HttpCacheEntry entry) {
@@ -123,8 +118,6 @@ class AsynchronousAsyncValidator {
      * progress. This is meant to be called by
      * {@link AsynchronousValidationRequest#run()} once the revalidation is
      * complete, using the identifier passed in during constructions.
-     *
-     * @param identifier
      */
     synchronized void markComplete(final String identifier) {
         this.queued.remove(identifier);

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=1523228&r1=1523227&r2=1523228&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
Sat Sep 14 12:53:10 2013
@@ -340,7 +340,7 @@ public class CachingHttpAsyncClient impl
             final FutureCallback<HttpResponse> futureCallback)
             throws ClientProtocolException, IOException {
         recordCacheHit(target, request);
-        HttpResponse out = null;
+        final HttpResponse out;
         final Date now = getCurrentDate();
         if (this.suitabilityChecker.canCachedResponseBeUsed(target, request, entry, now))
{
             log.debug("Cache hit");
@@ -574,7 +574,7 @@ public class CachingHttpAsyncClient impl
         final VersionInfo vi = VersionInfo.loadVersionInfo("org.apache.http.client", getClass().getClassLoader());
         final String release = (vi != null) ? vi.getRelease() : VersionInfo.UNAVAILABLE;
 
-        String value;
+        final String value;
         if ("http".equalsIgnoreCase(pv.getProtocol())) {
             value = String.format("%d.%d localhost (Apache-HttpClient/%s (cache))", pv.getMajor(),
pv.getMinor(),
                     release);
@@ -628,12 +628,7 @@ public class CachingHttpAsyncClient impl
         if (!"*".equals(line.getUri())) {
             return false;
         }
-
-        if (!"0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue()))
{
-            return false;
-        }
-
-        return true;
+        return "0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue());
     }
 
     Future<HttpResponse> callBackend(
@@ -679,7 +674,7 @@ public class CachingHttpAsyncClient impl
 
         final Date requestDate = getCurrentDate();
         final FutureHttpResponse future = new FutureHttpResponse(futureCallback);
-        Future<HttpResponse> backendFuture = this.backend.execute(target, conditionalRequest,
context, new FutureCallback<HttpResponse> () {
+        final Future<HttpResponse> backendFuture = this.backend.execute(target, conditionalRequest,
context, new FutureCallback<HttpResponse> () {
 
             public void cancelled() {
                 future.cancelled();
@@ -737,7 +732,6 @@ public class CachingHttpAsyncClient impl
                 }
 
                 future.completed(resp);
-                return;
             }
 
             public void failed(final Exception ex) {
@@ -861,7 +855,7 @@ public class CachingHttpAsyncClient impl
         }
 
         if (statusCode == HttpStatus.SC_NOT_MODIFIED) {
-            HttpCacheEntry updatedEntry = null;
+            final HttpCacheEntry updatedEntry;
             try {
                 updatedEntry = CachingHttpAsyncClient.this.responseCache.updateCacheEntry(target,
request, cacheEntry,
                         httpResponse, requestDate, responseDate);
@@ -893,7 +887,6 @@ public class CachingHttpAsyncClient impl
                 futureCallback.completed(backendResponse);
         } catch (final IOException e) {
             futureCallback.failed(e);
-            return;
         }
     }
 

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/CloseableHttpAsyncClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/CloseableHttpAsyncClient.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/CloseableHttpAsyncClient.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/CloseableHttpAsyncClient.java
Sat Sep 14 12:53:10 2013
@@ -84,7 +84,7 @@ public abstract class CloseableHttpAsync
             final HttpUriRequest request,
             final HttpContext context,
             final FutureCallback<HttpResponse> callback) {
-        HttpHost target;
+        final HttpHost target;
         try {
             target = determineTarget(request);
         } catch (final ClientProtocolException ex) {

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MinimalClientExchangeHandlerImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MinimalClientExchangeHandlerImpl.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MinimalClientExchangeHandlerImpl.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MinimalClientExchangeHandlerImpl.java
Sat Sep 14 12:53:10 2013
@@ -215,7 +215,7 @@ public class MinimalClientExchangeHandle
             this.validDuration = this.keepaliveStrategy.getKeepAliveDuration(this.response,
                     this.localContext);
             if (this.log.isDebugEnabled()) {
-                String s;
+                final String s;
                 if (this.validDuration > 0) {
                     s = "for " + this.validDuration + " " + TimeUnit.MILLISECONDS;
                 } else {

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/ManagedNHttpClientConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/ManagedNHttpClientConnectionFactory.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/ManagedNHttpClientConnectionFactory.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/ManagedNHttpClientConnectionFactory.java
Sat Sep 14 12:53:10 2013
@@ -54,7 +54,7 @@ public class ManagedNHttpClientConnectio
     private final Log wirelog = LogFactory.getLog("org.apache.http.wire");
     private final Log log = LogFactory.getLog(ManagedNHttpClientConnectionImpl.class);
 
-    private static AtomicLong COUNTER = new AtomicLong();
+    private static final AtomicLong COUNTER = new AtomicLong();
 
     public static final ManagedNHttpClientConnectionFactory INSTANCE = new ManagedNHttpClientConnectionFactory();
 

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/BaseZeroCopyRequestProducer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/BaseZeroCopyRequestProducer.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/BaseZeroCopyRequestProducer.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/BaseZeroCopyRequestProducer.java
Sat Sep 14 12:53:10 2013
@@ -100,7 +100,7 @@ abstract class BaseZeroCopyRequestProduc
             this.fileChannel = this.accessfile.getChannel();
             this.idx = 0;
         }
-        long transferred;
+        final long transferred;
         if (encoder instanceof FileContentEncoder) {
             transferred = ((FileContentEncoder)encoder).transfer(
                     this.fileChannel, this.idx, Integer.MAX_VALUE);

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/ZeroCopyConsumer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/ZeroCopyConsumer.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/ZeroCopyConsumer.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/ZeroCopyConsumer.java
Sat Sep 14 12:53:10 2013
@@ -81,7 +81,7 @@ public abstract class ZeroCopyConsumer<T
     protected void onContentReceived(
             final ContentDecoder decoder, final IOControl ioctrl) throws IOException {
         Asserts.notNull(this.fileChannel, "File channel");
-        long transferred;
+        final long transferred;
         if (decoder instanceof FileContentDecoder) {
             transferred = ((FileContentDecoder)decoder).transfer(
                     this.fileChannel, this.idx, Integer.MAX_VALUE);

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/util/HttpAsyncClientUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/util/HttpAsyncClientUtils.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/util/HttpAsyncClientUtils.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/util/HttpAsyncClientUtils.java
Sat Sep 14 12:53:10 2013
@@ -31,7 +31,7 @@ import java.io.IOException;
 import org.apache.http.impl.nio.client.CloseableHttpAsyncClient;
 
 /**
- * Static helpers for dealing with {@link HttpAsyncClient}.
+ * Static helpers for dealing with {@link org.apache.http.nio.client.HttpAsyncClient}.
  */
 public class HttpAsyncClientUtils {
 
@@ -62,7 +62,7 @@ public class HttpAsyncClientUtils {
         if (httpAsyncClient != null) {
             try {
                 httpAsyncClient.close();
-            } catch (final IOException e) {
+            } catch (final IOException ignore) {
             }
         }
     }

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/HttpAsyncTestBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/HttpAsyncTestBase.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/HttpAsyncTestBase.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/HttpAsyncTestBase.java
Sat Sep 14 12:53:10 2013
@@ -46,6 +46,7 @@ import org.apache.http.protocol.Response
 import org.apache.http.protocol.ResponseServer;
 import org.junit.After;
 
+@SuppressWarnings("RedundantArrayCreation")
 public abstract class HttpAsyncTestBase {
 
     protected HttpServerNio server;
@@ -81,12 +82,10 @@ public abstract class HttpAsyncTestBase 
         this.server = new HttpServerNio(
                 this.serverReactorConfig, createServerConnectionFactory(this.serverConnectionConfig));
         this.server.setExceptionHandler(new SimpleIOReactorExceptionHandler());
-        this.serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
-                new ResponseDate(),
+        this.serverHttpProc = new ImmutableHttpProcessor(new ResponseDate(),
                 new ResponseServer("TEST-SERVER/1.1"),
                 new ResponseContent(),
-                new ResponseConnControl()
-        });
+                new ResponseConnControl());
     }
 
     public void initConnectionManager() throws Exception {

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=1523228&r1=1523227&r2=1523228&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
Sat Sep 14 12:53:10 2013
@@ -81,7 +81,7 @@ public class EchoHandler
 
         // For some reason, just putting the incoming entity into
         // the response will not work. We have to buffer the message.
-        byte[] data;
+        final byte[] data;
         if (entity == null) {
             data = new byte [0];
         } else {

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientAuthentication.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientAuthentication.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientAuthentication.java
Sat Sep 14 12:53:10 2013
@@ -151,8 +151,7 @@ public class TestClientAuthentication ex
 
         Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());
         final InetSocketAddress address = (InetSocketAddress) endpoint.getAddress();
-        final HttpHost target = new HttpHost("localhost", address.getPort(), getSchemeName());
-        return target;
+        return new HttpHost("localhost", address.getPort(), getSchemeName());
     }
 
     static class AuthHandler implements HttpRequestHandler {
@@ -201,7 +200,7 @@ public class TestClientAuthentication ex
                 final HttpResponse response,
                 final HttpContext context) {
             final boolean res = super.isAuthenticationRequested(authhost, response, context);
-            if (res == true) {
+            if (res) {
                 synchronized (this) {
                     this.count++;
                 }

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientAuthenticationFallBack.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientAuthenticationFallBack.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientAuthenticationFallBack.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientAuthenticationFallBack.java
Sat Sep 14 12:53:10 2013
@@ -134,8 +134,7 @@ public class TestClientAuthenticationFal
 
         Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());
         final InetSocketAddress address = (InetSocketAddress) endpoint.getAddress();
-        final HttpHost target = new HttpHost("localhost", address.getPort(), getSchemeName());
-        return target;
+        return new HttpHost("localhost", address.getPort(), getSchemeName());
     }
 
     public class ResponseBasicUnauthorized implements HttpResponseInterceptor {

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientReauthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientReauthentication.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientReauthentication.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestClientReauthentication.java
Sat Sep 14 12:53:10 2013
@@ -145,8 +145,7 @@ public class TestClientReauthentication 
 
         Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());
         final InetSocketAddress address = (InetSocketAddress) endpoint.getAddress();
-        final HttpHost target = new HttpHost("localhost", address.getPort(), getSchemeName());
-        return target;
+        return new HttpHost("localhost", address.getPort(), getSchemeName());
     }
 
     public class ResponseBasicUnauthorized implements HttpResponseInterceptor {

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsync.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsync.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsync.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsync.java
Sat Sep 14 12:53:10 2013
@@ -113,8 +113,7 @@ public class TestHttpAsync extends HttpA
 
         Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());
         final InetSocketAddress address = (InetSocketAddress) endpoint.getAddress();
-        final HttpHost target = new HttpHost("localhost", address.getPort(), getSchemeName());
-        return target;
+        return new HttpHost("localhost", address.getPort(), getSchemeName());
     }
 
     private HttpHost start() throws Exception {

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncClientUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncClientUtils.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncClientUtils.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncClientUtils.java
Sat Sep 14 12:53:10 2013
@@ -122,8 +122,7 @@ public class TestHttpAsyncClientUtils ex
 
         Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());
         final InetSocketAddress address = (InetSocketAddress) endpoint.getAddress();
-        final HttpHost target = new HttpHost("localhost", address.getPort(), getSchemeName());
-        return target;
+        return new HttpHost("localhost", address.getPort(), getSchemeName());
     }
 
 }

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncMinimal.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncMinimal.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncMinimal.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncMinimal.java
Sat Sep 14 12:53:10 2013
@@ -104,8 +104,7 @@ public class TestHttpAsyncMinimal extend
 
         Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());
         final InetSocketAddress address = (InetSocketAddress) endpoint.getAddress();
-        final HttpHost target = new HttpHost("localhost", address.getPort(), getSchemeName());
-        return target;
+        return new HttpHost("localhost", address.getPort(), getSchemeName());
     }
 
     private HttpHost start() throws Exception {

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPrematureTermination.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPrematureTermination.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPrematureTermination.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPrematureTermination.java
Sat Sep 14 12:53:10 2013
@@ -115,8 +115,7 @@ public class TestHttpAsyncPrematureTermi
 
         Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());
         final InetSocketAddress address = (InetSocketAddress) endpoint.getAddress();
-        final HttpHost target = new HttpHost("localhost", address.getPort(), getSchemeName());
-        return target;
+        return new HttpHost("localhost", address.getPort(), getSchemeName());
     }
 
     @Test

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestRedirects.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestRedirects.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestRedirects.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestRedirects.java
Sat Sep 14 12:53:10 2013
@@ -133,8 +133,7 @@ public class TestRedirects extends HttpA
 
         Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());
         final InetSocketAddress address = (InetSocketAddress) endpoint.getAddress();
-        final HttpHost target = new HttpHost("localhost", address.getPort(), getSchemeName());
-        return target;
+        return new HttpHost("localhost", address.getPort(), getSchemeName());
     }
 
     static class BasicRedirectService implements HttpRequestHandler {

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestStatefulConnManagement.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestStatefulConnManagement.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestStatefulConnManagement.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestStatefulConnManagement.java
Sat Sep 14 12:53:10 2013
@@ -115,8 +115,7 @@ public class TestStatefulConnManagement 
 
         Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());
         final InetSocketAddress address = (InetSocketAddress) endpoint.getAddress();
-        final HttpHost target = new HttpHost("localhost", address.getPort(), getSchemeName());
-        return target;
+        return new HttpHost("localhost", address.getPort(), getSchemeName());
     }
 
     static class SimpleService implements HttpRequestHandler {
@@ -143,8 +142,7 @@ public class TestStatefulConnManagement 
         final UserTokenHandler userTokenHandler = new UserTokenHandler() {
 
             public Object getUserToken(final HttpContext context) {
-                final Integer id = (Integer) context.getAttribute("user");
-                return id;
+                return context.getAttribute("user");
             }
 
         };

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestAsyncConsumers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestAsyncConsumers.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestAsyncConsumers.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestAsyncConsumers.java
Sat Sep 14 12:53:10 2013
@@ -110,8 +110,7 @@ public class TestAsyncConsumers extends 
 
         Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());
         final InetSocketAddress address = (InetSocketAddress) endpoint.getAddress();
-        final HttpHost target = new HttpHost("localhost", address.getPort(), getSchemeName());
-        return target;
+        return new HttpHost("localhost", address.getPort(), getSchemeName());
     }
 
     private HttpHost start() throws Exception {

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestZeroCopy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestZeroCopy.java?rev=1523228&r1=1523227&r2=1523228&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestZeroCopy.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestZeroCopy.java
Sat Sep 14 12:53:10 2013
@@ -122,8 +122,7 @@ public class TestZeroCopy extends HttpAs
 
         Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());
         final InetSocketAddress address = (InetSocketAddress) endpoint.getAddress();
-        final HttpHost target = new HttpHost("localhost", address.getPort(), getSchemeName());
-        return target;
+        return new HttpHost("localhost", address.getPort(), getSchemeName());
     }
 
     private static final String[] TEXT = {
@@ -133,7 +132,7 @@ public class TestZeroCopy extends HttpAs
         "nyet nyet nyet nyet nyet nyet nyet nyet nyet nyet nyet nyet nyet nyet"
     };
 
-    private static Charset ASCII = Charset.forName("ascii");
+    private static final Charset ASCII = Charset.forName("ascii");
     private static File TEST_FILE;
     private File tmpfile;
 



Mime
View raw message