You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by mi...@apache.org on 2019/12/05 21:06:33 UTC

[httpcomponents-client] branch HTTPCLIENT-2031 created (now 3b0117d)

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch HTTPCLIENT-2031
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git.


      at 3b0117d  [HTTPCLIENT-2031] Don't use plural names for enums

This branch includes the following new commits:

     new 3b0117d  [HTTPCLIENT-2031] Don't use plural names for enums

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[httpcomponents-client] 01/01: [HTTPCLIENT-2031] Don't use plural names for enums

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch HTTPCLIENT-2031
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git

commit 3b0117d0e5c8ef1e8eb6994a779bebae29cb0af5
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Thu Dec 5 22:06:17 2019 +0100

    [HTTPCLIENT-2031] Don't use plural names for enums
---
 .../http/impl/cache/CachingH2AsyncClientBuilder.java |  4 ++--
 .../impl/cache/CachingHttpAsyncClientBuilder.java    |  4 ++--
 .../http/impl/cache/CachingHttpClientBuilder.java    |  4 ++--
 .../impl/{ChainElements.java => ChainElement.java}   |  2 +-
 .../http/impl/async/H2AsyncClientBuilder.java        | 12 ++++++------
 .../http/impl/async/HttpAsyncClientBuilder.java      | 12 ++++++------
 .../client5/http/impl/classic/HttpClientBuilder.java | 20 ++++++++++----------
 .../http/examples/AsyncClientInterceptors.java       |  4 ++--
 .../http/examples/AsyncClientMessageTrailers.java    |  4 ++--
 .../hc/client5/http/examples/ClientInterceptors.java |  4 ++--
 10 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingH2AsyncClientBuilder.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingH2AsyncClientBuilder.java
index 2dc11aa..055246e 100644
--- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingH2AsyncClientBuilder.java
+++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingH2AsyncClientBuilder.java
@@ -38,7 +38,7 @@ import org.apache.hc.client5.http.cache.HttpAsyncCacheStorage;
 import org.apache.hc.client5.http.cache.HttpAsyncCacheStorageAdaptor;
 import org.apache.hc.client5.http.cache.HttpCacheStorage;
 import org.apache.hc.client5.http.cache.ResourceFactory;
-import org.apache.hc.client5.http.impl.ChainElements;
+import org.apache.hc.client5.http.impl.ChainElement;
 import org.apache.hc.client5.http.impl.async.H2AsyncClientBuilder;
 import org.apache.hc.client5.http.impl.schedule.ImmediateSchedulingStrategy;
 import org.apache.hc.client5.http.schedule.SchedulingStrategy;
@@ -168,7 +168,7 @@ public class CachingH2AsyncClientBuilder extends H2AsyncClientBuilder {
                 httpCache,
                 cacheRevalidator,
                 config);
-        execChainDefinition.addBefore(ChainElements.PROTOCOL.name(), cachingExec, ChainElements.CACHING.name());
+        execChainDefinition.addBefore(ChainElement.PROTOCOL.name(), cachingExec, ChainElement.CACHING.name());
     }
 
 }
diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingHttpAsyncClientBuilder.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingHttpAsyncClientBuilder.java
index 7295347..869ac13 100644
--- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingHttpAsyncClientBuilder.java
+++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingHttpAsyncClientBuilder.java
@@ -38,7 +38,7 @@ import org.apache.hc.client5.http.cache.HttpAsyncCacheStorage;
 import org.apache.hc.client5.http.cache.HttpAsyncCacheStorageAdaptor;
 import org.apache.hc.client5.http.cache.HttpCacheStorage;
 import org.apache.hc.client5.http.cache.ResourceFactory;
-import org.apache.hc.client5.http.impl.ChainElements;
+import org.apache.hc.client5.http.impl.ChainElement;
 import org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder;
 import org.apache.hc.client5.http.impl.schedule.ImmediateSchedulingStrategy;
 import org.apache.hc.client5.http.schedule.SchedulingStrategy;
@@ -168,7 +168,7 @@ public class CachingHttpAsyncClientBuilder extends HttpAsyncClientBuilder {
                 httpCache,
                 cacheRevalidator,
                 config);
-        execChainDefinition.addBefore(ChainElements.PROTOCOL.name(), cachingExec, ChainElements.CACHING.name());
+        execChainDefinition.addBefore(ChainElement.PROTOCOL.name(), cachingExec, ChainElement.CACHING.name());
     }
 
 }
diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingHttpClientBuilder.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingHttpClientBuilder.java
index 714b34c..5d6bf91 100644
--- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingHttpClientBuilder.java
+++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingHttpClientBuilder.java
@@ -36,7 +36,7 @@ import org.apache.hc.client5.http.cache.HttpCacheInvalidator;
 import org.apache.hc.client5.http.cache.HttpCacheStorage;
 import org.apache.hc.client5.http.cache.ResourceFactory;
 import org.apache.hc.client5.http.classic.ExecChainHandler;
-import org.apache.hc.client5.http.impl.ChainElements;
+import org.apache.hc.client5.http.impl.ChainElement;
 import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
 import org.apache.hc.client5.http.impl.schedule.ImmediateSchedulingStrategy;
 import org.apache.hc.client5.http.schedule.SchedulingStrategy;
@@ -161,7 +161,7 @@ public class CachingHttpClientBuilder extends HttpClientBuilder {
                 httpCache,
                 cacheRevalidator,
                 config);
-        execChainDefinition.addBefore(ChainElements.PROTOCOL.name(), cachingExec, ChainElements.CACHING.name());
+        execChainDefinition.addBefore(ChainElement.PROTOCOL.name(), cachingExec, ChainElement.CACHING.name());
     }
 
 }
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/ChainElements.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/ChainElement.java
similarity index 97%
rename from httpclient5/src/main/java/org/apache/hc/client5/http/impl/ChainElements.java
rename to httpclient5/src/main/java/org/apache/hc/client5/http/impl/ChainElement.java
index 9dd95cd..edf8ab2 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/ChainElements.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/ChainElement.java
@@ -32,7 +32,7 @@ package org.apache.hc.client5.http.impl;
  *
  * @since 5.0
  */
-public enum ChainElements {
+public enum ChainElement {
 
     REDIRECT, BACK_OFF, RETRY_SERVICE_UNAVAILABLE, RETRY_IO_ERROR, CACHING, PROTOCOL, CONNECT, MAIN_TRANSPORT
 
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java
index 6bd7c48..637fdac 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java
@@ -52,7 +52,7 @@ import org.apache.hc.client5.http.config.RequestConfig;
 import org.apache.hc.client5.http.cookie.BasicCookieStore;
 import org.apache.hc.client5.http.cookie.CookieSpecProvider;
 import org.apache.hc.client5.http.cookie.CookieStore;
-import org.apache.hc.client5.http.impl.ChainElements;
+import org.apache.hc.client5.http.impl.ChainElement;
 import org.apache.hc.client5.http.impl.CookieSpecSupport;
 import org.apache.hc.client5.http.impl.DefaultAuthenticationStrategy;
 import org.apache.hc.client5.http.impl.DefaultHttpRequestRetryHandler;
@@ -596,7 +596,7 @@ public class H2AsyncClientBuilder {
         final NamedElementChain<AsyncExecChainHandler> execChainDefinition = new NamedElementChain<>();
         execChainDefinition.addLast(
                 new H2AsyncMainClientExec(),
-                ChainElements.MAIN_TRANSPORT.name());
+                ChainElement.MAIN_TRANSPORT.name());
 
         AuthenticationStrategy targetAuthStrategyCopy = this.targetAuthStrategy;
         if (targetAuthStrategyCopy == null) {
@@ -622,7 +622,7 @@ public class H2AsyncClientBuilder {
                 new AsyncConnectExec(
                         new DefaultHttpProcessor(new RequestTargetHost(), new RequestUserAgent(userAgentCopy)),
                         proxyAuthStrategyCopy),
-                ChainElements.CONNECT.name());
+                ChainElement.CONNECT.name());
 
         final HttpProcessorBuilder b = HttpProcessorBuilder.create();
         if (requestInterceptors != null) {
@@ -670,7 +670,7 @@ public class H2AsyncClientBuilder {
         final HttpProcessor httpProcessor = b.build();
         execChainDefinition.addFirst(
                 new AsyncProtocolExec(httpProcessor, targetAuthStrategyCopy, proxyAuthStrategyCopy),
-                ChainElements.PROTOCOL.name());
+                ChainElement.PROTOCOL.name());
 
         // Add request retry executor, if not disabled
         if (!automaticRetriesDisabled) {
@@ -680,7 +680,7 @@ public class H2AsyncClientBuilder {
             }
             execChainDefinition.addFirst(
                     new AsyncRetryExec(retryHandlerCopy),
-                    ChainElements.RETRY_IO_ERROR.name());
+                    ChainElement.RETRY_IO_ERROR.name());
         }
 
         HttpRoutePlanner routePlannerCopy = this.routePlanner;
@@ -700,7 +700,7 @@ public class H2AsyncClientBuilder {
             }
             execChainDefinition.addFirst(
                     new AsyncRedirectExec(routePlannerCopy, redirectStrategyCopy),
-                    ChainElements.REDIRECT.name());
+                    ChainElement.REDIRECT.name());
         }
 
         final AsyncPushConsumerRegistry pushConsumerRegistry = new AsyncPushConsumerRegistry();
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java
index 67c0f32..c010559 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java
@@ -53,7 +53,7 @@ import org.apache.hc.client5.http.config.RequestConfig;
 import org.apache.hc.client5.http.cookie.BasicCookieStore;
 import org.apache.hc.client5.http.cookie.CookieSpecProvider;
 import org.apache.hc.client5.http.cookie.CookieStore;
-import org.apache.hc.client5.http.impl.ChainElements;
+import org.apache.hc.client5.http.impl.ChainElement;
 import org.apache.hc.client5.http.impl.CookieSpecSupport;
 import org.apache.hc.client5.http.impl.DefaultAuthenticationStrategy;
 import org.apache.hc.client5.http.impl.DefaultConnectionKeepAliveStrategy;
@@ -746,7 +746,7 @@ public class HttpAsyncClientBuilder {
         final NamedElementChain<AsyncExecChainHandler> execChainDefinition = new NamedElementChain<>();
         execChainDefinition.addLast(
                 new HttpAsyncMainClientExec(keepAliveStrategyCopy, userTokenHandlerCopy),
-                ChainElements.MAIN_TRANSPORT.name());
+                ChainElement.MAIN_TRANSPORT.name());
 
         AuthenticationStrategy targetAuthStrategyCopy = this.targetAuthStrategy;
         if (targetAuthStrategyCopy == null) {
@@ -772,7 +772,7 @@ public class HttpAsyncClientBuilder {
                 new AsyncConnectExec(
                         new DefaultHttpProcessor(new RequestTargetHost(), new RequestUserAgent(userAgentCopy)),
                         proxyAuthStrategyCopy),
-                ChainElements.CONNECT.name());
+                ChainElement.CONNECT.name());
 
         final HttpProcessorBuilder b = HttpProcessorBuilder.create();
         if (requestInterceptors != null) {
@@ -820,7 +820,7 @@ public class HttpAsyncClientBuilder {
         final HttpProcessor httpProcessor = b.build();
         execChainDefinition.addFirst(
                 new AsyncProtocolExec(httpProcessor, targetAuthStrategyCopy, proxyAuthStrategyCopy),
-                ChainElements.PROTOCOL.name());
+                ChainElement.PROTOCOL.name());
 
         // Add request retry executor, if not disabled
         if (!automaticRetriesDisabled) {
@@ -830,7 +830,7 @@ public class HttpAsyncClientBuilder {
             }
             execChainDefinition.addFirst(
                     new AsyncRetryExec(retryHandlerCopy),
-                    ChainElements.RETRY_IO_ERROR.name());
+                    ChainElement.RETRY_IO_ERROR.name());
         }
 
         HttpRoutePlanner routePlannerCopy = this.routePlanner;
@@ -863,7 +863,7 @@ public class HttpAsyncClientBuilder {
             }
             execChainDefinition.addFirst(
                     new AsyncRedirectExec(routePlannerCopy, redirectStrategyCopy),
-                    ChainElements.REDIRECT.name());
+                    ChainElement.REDIRECT.name());
         }
 
         List<Closeable> closeablesCopy = closeables != null ? new ArrayList<>(closeables) : null;
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/HttpClientBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/HttpClientBuilder.java
index cae1e0f..7007fd7 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/HttpClientBuilder.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/HttpClientBuilder.java
@@ -56,7 +56,7 @@ import org.apache.hc.client5.http.cookie.BasicCookieStore;
 import org.apache.hc.client5.http.cookie.CookieSpecProvider;
 import org.apache.hc.client5.http.cookie.CookieStore;
 import org.apache.hc.client5.http.entity.InputStreamFactory;
-import org.apache.hc.client5.http.impl.ChainElements;
+import org.apache.hc.client5.http.impl.ChainElement;
 import org.apache.hc.client5.http.impl.CookieSpecSupport;
 import org.apache.hc.client5.http.impl.DefaultAuthenticationStrategy;
 import org.apache.hc.client5.http.impl.DefaultConnectionKeepAliveStrategy;
@@ -799,13 +799,13 @@ public class HttpClientBuilder {
         final NamedElementChain<ExecChainHandler> execChainDefinition = new NamedElementChain<>();
         execChainDefinition.addLast(
                 new MainClientExec(connManagerCopy, reuseStrategyCopy, keepAliveStrategyCopy, userTokenHandlerCopy),
-                ChainElements.MAIN_TRANSPORT.name());
+                ChainElement.MAIN_TRANSPORT.name());
         execChainDefinition.addFirst(
                 new ConnectExec(
                         reuseStrategyCopy,
                         new DefaultHttpProcessor(new RequestTargetHost(), new RequestUserAgent(userAgentCopy)),
                         proxyAuthStrategyCopy),
-                ChainElements.CONNECT.name());
+                ChainElement.CONNECT.name());
 
         final HttpProcessorBuilder b = HttpProcessorBuilder.create();
         if (requestInterceptors != null) {
@@ -855,7 +855,7 @@ public class HttpClientBuilder {
         final HttpProcessor httpProcessor = b.build();
         execChainDefinition.addFirst(
                 new ProtocolExec(httpProcessor, targetAuthStrategyCopy, proxyAuthStrategyCopy),
-                ChainElements.PROTOCOL.name());
+                ChainElement.PROTOCOL.name());
 
         // Add request retry executor, if not disabled
         if (!automaticRetriesDisabled) {
@@ -865,7 +865,7 @@ public class HttpClientBuilder {
             }
             execChainDefinition.addFirst(
                     new RetryExec(retryHandlerCopy),
-                    ChainElements.RETRY_IO_ERROR.name());
+                    ChainElement.RETRY_IO_ERROR.name());
         }
 
         HttpRoutePlanner routePlannerCopy = this.routePlanner;
@@ -889,7 +889,7 @@ public class HttpClientBuilder {
         if (serviceUnavailStrategyCopy != null) {
             execChainDefinition.addFirst(
                     new ServiceUnavailableRetryExec(serviceUnavailStrategyCopy),
-                    ChainElements.RETRY_SERVICE_UNAVAILABLE.name());
+                    ChainElement.RETRY_SERVICE_UNAVAILABLE.name());
         }
 
         // Add redirect executor, if not disabled
@@ -900,7 +900,7 @@ public class HttpClientBuilder {
             }
             execChainDefinition.addFirst(
                     new RedirectExec(routePlannerCopy, redirectStrategyCopy),
-                    ChainElements.REDIRECT.name());
+                    ChainElement.REDIRECT.name());
         }
 
         if (!contentCompressionDisabled) {
@@ -913,18 +913,18 @@ public class HttpClientBuilder {
                 final Registry<InputStreamFactory> decoderRegistry = b2.build();
                 execChainDefinition.addFirst(
                         new ContentCompressionExec(encodings, decoderRegistry, true),
-                        ChainElements.REDIRECT.name());
+                        ChainElement.REDIRECT.name());
             } else {
                 execChainDefinition.addFirst(
                         new ContentCompressionExec(true),
-                        ChainElements.REDIRECT.name());
+                        ChainElement.REDIRECT.name());
             }
         }
 
         // Optionally, add connection back-off executor
         if (this.backoffManager != null && this.connectionBackoffStrategy != null) {
             execChainDefinition.addFirst(new BackoffStrategyExec(this.connectionBackoffStrategy, this.backoffManager),
-                    ChainElements.BACK_OFF.name());
+                    ChainElement.BACK_OFF.name());
         }
 
         if (execInterceptors != null) {
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientInterceptors.java b/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientInterceptors.java
index 82b5ff2..3f2255c 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientInterceptors.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientInterceptors.java
@@ -39,7 +39,7 @@ import org.apache.hc.client5.http.async.AsyncExecChainHandler;
 import org.apache.hc.client5.http.async.methods.SimpleHttpRequest;
 import org.apache.hc.client5.http.async.methods.SimpleHttpRequests;
 import org.apache.hc.client5.http.async.methods.SimpleHttpResponse;
-import org.apache.hc.client5.http.impl.ChainElements;
+import org.apache.hc.client5.http.impl.ChainElement;
 import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient;
 import org.apache.hc.client5.http.impl.async.HttpAsyncClients;
 import org.apache.hc.core5.concurrent.FutureCallback;
@@ -92,7 +92,7 @@ public class AsyncClientInterceptors {
 
                 // Simulate a 404 response for some requests without passing the message down to the backend
 
-                .addExecInterceptorAfter(ChainElements.PROTOCOL.name(), "custom", new AsyncExecChainHandler() {
+                .addExecInterceptorAfter(ChainElement.PROTOCOL.name(), "custom", new AsyncExecChainHandler() {
 
                     @Override
                     public void execute(
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientMessageTrailers.java b/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientMessageTrailers.java
index d9201ce..bbf247a 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientMessageTrailers.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientMessageTrailers.java
@@ -35,7 +35,7 @@ import org.apache.hc.client5.http.async.AsyncExecChain;
 import org.apache.hc.client5.http.async.AsyncExecChainHandler;
 import org.apache.hc.client5.http.async.methods.SimpleHttpResponse;
 import org.apache.hc.client5.http.async.methods.SimpleResponseConsumer;
-import org.apache.hc.client5.http.impl.ChainElements;
+import org.apache.hc.client5.http.impl.ChainElement;
 import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient;
 import org.apache.hc.client5.http.impl.async.HttpAsyncClients;
 import org.apache.hc.core5.concurrent.FutureCallback;
@@ -65,7 +65,7 @@ public class AsyncClientMessageTrailers {
 
         final CloseableHttpAsyncClient client = HttpAsyncClients.custom()
                 .setIOReactorConfig(ioReactorConfig)
-                .addExecInterceptorAfter(ChainElements.PROTOCOL.name(), "custom", new AsyncExecChainHandler() {
+                .addExecInterceptorAfter(ChainElement.PROTOCOL.name(), "custom", new AsyncExecChainHandler() {
 
                     @Override
                     public void execute(
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/examples/ClientInterceptors.java b/httpclient5/src/test/java/org/apache/hc/client5/http/examples/ClientInterceptors.java
index 72dce94..340aa93 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/examples/ClientInterceptors.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/examples/ClientInterceptors.java
@@ -33,7 +33,7 @@ import java.util.concurrent.atomic.AtomicLong;
 import org.apache.hc.client5.http.classic.ExecChain;
 import org.apache.hc.client5.http.classic.ExecChainHandler;
 import org.apache.hc.client5.http.classic.methods.HttpGet;
-import org.apache.hc.client5.http.impl.ChainElements;
+import org.apache.hc.client5.http.impl.ChainElement;
 import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
 import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
 import org.apache.hc.client5.http.impl.classic.HttpClients;
@@ -77,7 +77,7 @@ public class ClientInterceptors {
 
                 // Simulate a 404 response for some requests without passing the message down to the backend
 
-                .addExecInterceptorAfter(ChainElements.PROTOCOL.name(), "custom", new ExecChainHandler() {
+                .addExecInterceptorAfter(ChainElement.PROTOCOL.name(), "custom", new ExecChainHandler() {
 
                     @Override
                     public ClassicHttpResponse execute(