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/14 16:28:25 UTC

[httpcomponents-client] branch consistency created (now 7c1c30e)

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

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


      at 7c1c30e  Align names for consistency and fix typos

This branch includes the following new commits:

     new 7c1c30e  Align names for consistency and fix typos

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.



Re: [httpcomponents-client] 01/01: Align names for consistency and fix typos

Posted by Michael Osipov <mi...@apache.org>.
Am 2019-12-15 um 13:56 schrieb Gary Gregory:
> Michael:
> 
> Also todo:  maxstale ->  maxStale

I think I have caught all of them in the subsequent commits:

mosipov@mikaw10 MINGW64 /d/Entwicklung/Projekte/httpcomponents-client5 
(master)
$ grep -r maxstale --include='*.java' .



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: [httpcomponents-client] 01/01: Align names for consistency and fix typos

Posted by Gary Gregory <ga...@gmail.com>.
Michael:

Also todo:  maxstale ->  maxStale

Gary

On Sat, Dec 14, 2019 at 11:28 AM <mi...@apache.org> wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> michaelo pushed a commit to branch consistency
> in repository
> https://gitbox.apache.org/repos/asf/httpcomponents-client.git
>
> commit 7c1c30e4494b6654533a77ee6d02697b78a872d1
> Author: Michael Osipov <mi...@apache.org>
> AuthorDate: Sat Dec 14 17:28:16 2019 +0100
>
>     Align names for consistency and fix typos
> ---
>  .../hc/client5/http/cache/HttpCacheEntry.java      |  4 +--
>  .../client5/http/impl/cache/BasicIdGenerator.java  |  2 +-
>  .../http/impl/cache/CacheValidityPolicy.java       | 16 ++++-----
>  .../cache/CachedResponseSuitabilityChecker.java    |  6 ++--
>  .../http/impl/cache/ManagedHttpCacheStorage.java   |  2 +-
>  .../apache/hc/client5/http/fluent/Executor.java    | 12 +++----
>  .../org/apache/hc/client5/http/auth/AuthScope.java | 14 ++++----
>  .../hc/client5/http/auth/CredentialsProvider.java  |  4 +--
>  .../hc/client5/http/auth/CredentialsStore.java     |  4 +--
>  .../http/classic/ConnectionBackoffStrategy.java    |  4 +--
>  .../hc/client5/http/entity/EntityBuilder.java      | 12 +++----
>  .../http/entity/mime/AbstractMultipartFormat.java  |  8 ++---
>  .../client5/http/impl/IdleConnectionEvictor.java   |  2 +-
>  .../client5/http/impl/TunnelRefusedException.java  |  8 ++---
>  .../java/org/apache/hc/client5/http/impl/Wire.java |  8 ++---
>  .../async/AbstractMinimalHttpAsyncClientBase.java  |  2 +-
>  .../http/impl/async/H2AsyncClientBuilder.java      |  6 ++--
>  .../http/impl/async/HttpAsyncMainClientExec.java   |  2 +-
>  .../http/impl/async/InternalHttpAsyncClient.java   |  8 ++---
>  .../http/impl/async/MinimalH2AsyncClient.java      |  4 +--
>  .../http/impl/async/MinimalHttpAsyncClient.java    | 14 ++++----
>  .../http/impl/auth/BasicCredentialsProvider.java   | 20 ++++++------
>  .../auth/SystemDefaultCredentialsProvider.java     | 38
> +++++++++++-----------
>  .../http/impl/classic/AIMDBackoffManager.java      |  6 ++--
>  .../http/impl/classic/DefaultBackoffStrategy.java  |  6 ++--
>  .../http/impl/classic/NullBackoffStrategy.java     |  2 +-
>  ...ator.java => MultihomeConnectionInitiator.java} |  4 +--
>  .../client5/http/psl/PublicSuffixListParser.java   |  1 -
>  .../http/socket/ConnectionSocketFactory.java       |  4 +--
>  .../http/ssl/SSLConnectionSocketFactory.java       | 16 ++++-----
>  .../ssl/SSLConnectionSocketFactoryBuilder.java     | 10 +++---
>  .../org/apache/hc/client5/http/utils/URIUtils.java |  2 +-
>  .../hc/client5/http/entity/TestEntityBuilder.java  |  2 +-
>  33 files changed, 125 insertions(+), 128 deletions(-)
>
> diff --git
> a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheEntry.java
> b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheEntry.java
> index 47ed671..ff53120 100644
> ---
> a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheEntry.java
> +++
> b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheEntry.java
> @@ -64,7 +64,7 @@ public class HttpCacheEntry implements MessageHeaders,
> Serializable {
>      private final int status;
>      private final HeaderGroup responseHeaders;
>      private final Resource resource;
> -    private final Map<String,String> variantMap;
> +    private final Map<String, String> variantMap;
>      private final Date date;
>
>      /**
> @@ -91,7 +91,7 @@ public class HttpCacheEntry implements MessageHeaders,
> Serializable {
>              final int status,
>              final Header[] responseHeaders,
>              final Resource resource,
> -            final Map<String,String> variantMap) {
> +            final Map<String, String> variantMap) {
>          super();
>          Args.notNull(requestDate, "Request date");
>          Args.notNull(responseDate, "Response date");
> diff --git
> a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/BasicIdGenerator.java
> b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/BasicIdGenerator.java
> index cfa28ac..80fdb6b 100644
> ---
> a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/BasicIdGenerator.java
> +++
> b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/BasicIdGenerator.java
> @@ -65,7 +65,7 @@ class BasicIdGenerator {
>          final int rndnum = this.rnd.nextInt();
>          buffer.append(System.currentTimeMillis());
>          buffer.append('.');
> -        final Formatter formatter = new Formatter(buffer, Locale.US);
> +        final Formatter formatter = new Formatter(buffer, Locale.ROOT);
>          formatter.format("%1$016x-%2$08x", Long.valueOf(this.count),
> Integer.valueOf(rndnum));
>          formatter.close();
>          buffer.append('.');
> diff --git
> a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheValidityPolicy.java
> b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheValidityPolicy.java
> index 2d469ca..7f7a674 100644
> ---
> a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheValidityPolicy.java
> +++
> b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheValidityPolicy.java
> @@ -53,9 +53,9 @@ class CacheValidityPolicy {
>      }
>
>      public long getFreshnessLifetimeSecs(final HttpCacheEntry entry) {
> -        final long maxage = getMaxAge(entry);
> -        if (maxage > -1) {
> -            return maxage;
> +        final long maxAge = getMaxAge(entry);
> +        if (maxAge > -1) {
> +            return maxAge;
>          }
>
>          final Date dateValue = entry.getDate();
> @@ -242,23 +242,23 @@ class CacheValidityPolicy {
>      }
>
>      protected long getMaxAge(final HttpCacheEntry entry) {
> -        long maxage = -1;
> +        long maxAge = -1;
>          final Iterator<HeaderElement> it = MessageSupport.iterate(entry,
> HeaderConstants.CACHE_CONTROL);
>          while (it.hasNext()) {
>              final HeaderElement elt = it.next();
>              if
> (HeaderConstants.CACHE_CONTROL_MAX_AGE.equals(elt.getName()) ||
> "s-maxage".equals(elt.getName())) {
>                  try {
>                      final long currMaxAge =
> Long.parseLong(elt.getValue());
> -                    if (maxage == -1 || currMaxAge < maxage) {
> -                        maxage = currMaxAge;
> +                    if (maxAge == -1 || currMaxAge < maxAge) {
> +                        maxAge = currMaxAge;
>                      }
>                  } catch (final NumberFormatException nfe) {
>                      // be conservative if can't parse
> -                    maxage = 0;
> +                    maxAge = 0;
>                  }
>              }
>          }
> -        return maxage;
> +        return maxAge;
>      }
>
>      public boolean hasCacheControlDirective(final HttpCacheEntry entry,
> final String directive) {
> diff --git
> a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedResponseSuitabilityChecker.java
> b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedResponseSuitabilityChecker.java
> index dc6b4d1..6142556 100644
> ---
> a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedResponseSuitabilityChecker.java
> +++
> b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedResponseSuitabilityChecker.java
> @@ -104,7 +104,7 @@ class CachedResponseSuitabilityChecker {
>          while (it.hasNext()) {
>              final HeaderElement elt = it.next();
>              if
> (HeaderConstants.CACHE_CONTROL_MAX_STALE.equals(elt.getName())) {
> -                if ((elt.getValue() == null ||
> "".equals(elt.getValue().trim())) && maxstale == -1) {
> +                if ((elt.getValue() == null ||
> elt.getValue().trim().isEmpty()) && maxstale == -1) {
>                      maxstale = Long.MAX_VALUE;
>                  } else {
>                      try {
> @@ -185,8 +185,8 @@ class CachedResponseSuitabilityChecker {
>
>              if
> (HeaderConstants.CACHE_CONTROL_MAX_AGE.equals(elt.getName())) {
>                  try {
> -                    final int maxage = Integer.parseInt(elt.getValue());
> -                    if (validityStrategy.getCurrentAgeSecs(entry, now) >
> maxage) {
> +                    final int maxAge = Integer.parseInt(elt.getValue());
> +                    if (validityStrategy.getCurrentAgeSecs(entry, now) >
> maxAge) {
>                          log.debug("Response from cache was NOT suitable
> due to max age");
>                          return false;
>                      }
> diff --git
> a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ManagedHttpCacheStorage.java
> b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ManagedHttpCacheStorage.java
> index 0623171..4582edc 100644
> ---
> a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ManagedHttpCacheStorage.java
> +++
> b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ManagedHttpCacheStorage.java
> @@ -90,7 +90,7 @@ public class ManagedHttpCacheStorage implements
> HttpCacheStorage, Closeable {
>          this.active = new AtomicBoolean(true);
>      }
>
> -    private void ensureValidState() throws IllegalStateException {
> +    private void ensureValidState() {
>          if (!this.active.get()) {
>              throw new IllegalStateException("Cache has been shut down");
>          }
> diff --git
> a/httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/Executor.java
> b/httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/Executor.java
> index 28fef86..97ffaf3 100644
> ---
> a/httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/Executor.java
> +++
> b/httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/Executor.java
> @@ -99,29 +99,29 @@ public class Executor {
>          return this;
>      }
>
> -    public Executor auth(final AuthScope authScope, final Credentials
> creds) {
> +    public Executor auth(final AuthScope authScope, final Credentials
> crededentials) {
>          if (this.credentialsStore == null) {
>              this.credentialsStore = new BasicCredentialsProvider();
>          }
> -        this.credentialsStore.setCredentials(authScope, creds);
> +        this.credentialsStore.setCredentials(authScope, crededentials);
>          return this;
>      }
>
> -    public Executor auth(final HttpHost host, final Credentials creds) {
> -        return auth(new AuthScope(host), creds);
> +    public Executor auth(final HttpHost host, final Credentials
> credentials) {
> +        return auth(new AuthScope(host), credentials);
>      }
>
>      /**
>       * @since 4.4
>       */
> -    public Executor auth(final String host, final Credentials creds) {
> +    public Executor auth(final String host, final Credentials
> credentials) {
>          final HttpHost httpHost;
>          try {
>              httpHost = HttpHost.create(host);
>          } catch (final URISyntaxException ex) {
>              throw new IllegalArgumentException("Invalid host: " + host);
>          }
> -        return auth(httpHost, creds);
> +        return auth(httpHost, credentials);
>      }
>
>      public Executor authPreemptive(final HttpHost host) {
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/AuthScope.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/AuthScope.java
> index 46fb787..74fe68c 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/AuthScope.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/AuthScope.java
> @@ -127,14 +127,14 @@ public class AuthScope {
>      /**
>       * Creates a copy of the given credentials scope.
>       */
> -    public AuthScope(final AuthScope authscope) {
> +    public AuthScope(final AuthScope authScope) {
>          super();
> -        Args.notNull(authscope, "Scope");
> -        this.protocol = authscope.getProtocol();
> -        this.host = authscope.getHost();
> -        this.port = authscope.getPort();
> -        this.realm = authscope.getRealm();
> -        this.authScheme = authscope.getAuthScheme();
> +        Args.notNull(authScope, "Scope");
> +        this.protocol = authScope.getProtocol();
> +        this.host = authScope.getHost();
> +        this.port = authScope.getPort();
> +        this.realm = authScope.getRealm();
> +        this.authScheme = authScope.getAuthScheme();
>      }
>
>      public String getProtocol() {
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsProvider.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsProvider.java
> index 103fc06..39be2aa 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsProvider.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsProvider.java
> @@ -44,11 +44,11 @@ public interface CredentialsProvider {
>       * Returns {@link Credentials credentials} for the given
> authentication scope,
>       * if available.
>       *
> -     * @param authscope the {@link AuthScope authentication scope}
> +     * @param authScope the {@link AuthScope authentication scope}
>       * @param context the {@link HttpContext http context}
>       * @return the credentials
>       * @since 5.0
>       */
> -    Credentials getCredentials(AuthScope authscope, HttpContext context);
> +    Credentials getCredentials(AuthScope authScope, HttpContext context);
>
>  }
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsStore.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsStore.java
> index a757883..a36c59d 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsStore.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsStore.java
> @@ -42,13 +42,13 @@ public interface CredentialsStore extends
> CredentialsProvider {
>       * Sets the {@link Credentials credentials} for the given
> authentication
>       * scope. Any previous credentials for the given scope will be
> overwritten.
>       *
> -     * @param authscope the {@link AuthScope authentication scope}
> +     * @param authScope the {@link AuthScope authentication scope}
>       * @param credentials the authentication {@link Credentials
> credentials}
>       * for the given scope.
>       *
>       * @see #getCredentials(AuthScope,
> org.apache.hc.core5.http.protocol.HttpContext)
>       */
> -    void setCredentials(AuthScope authscope, Credentials credentials);
> +    void setCredentials(AuthScope authScope, Credentials credentials);
>
>      /**
>       * Clears all credentials.
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/classic/ConnectionBackoffStrategy.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/classic/ConnectionBackoffStrategy.java
> index 059ac26..1ae39c8 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/classic/ConnectionBackoffStrategy.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/classic/ConnectionBackoffStrategy.java
> @@ -56,9 +56,9 @@ public interface ConnectionBackoffStrategy {
>       * signal. Implementations MUST restrict themselves to examining
>       * the response header and MUST NOT consume any of the response
>       * body, if any.
> -     * @param resp the {@code HttpResponse} that was received
> +     * @param response the {@code HttpResponse} that was received
>       * @return {@code true} if a backoff signal should be
>       *   given
>       */
> -    boolean shouldBackoff(HttpResponse resp);
> +    boolean shouldBackoff(HttpResponse response);
>  }
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/EntityBuilder.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/EntityBuilder.java
> index 83557b0..e8768a5 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/EntityBuilder.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/EntityBuilder.java
> @@ -72,7 +72,7 @@ public class EntityBuilder {
>      private ContentType contentType;
>      private String contentEncoding;
>      private boolean chunked;
> -    private boolean gzipCompress;
> +    private boolean gzipCompressed;
>
>      EntityBuilder() {
>          super();
> @@ -288,15 +288,15 @@ public class EntityBuilder {
>      /**
>       * Returns {@code true} if entity is to be GZIP compressed, {@code
> false} otherwise.
>       */
> -    public boolean isGzipCompress() {
> -        return gzipCompress;
> +    public boolean isGzipCompressed() {
> +        return gzipCompressed;
>      }
>
>      /**
>       * Makes entity GZIP compressed.
>       */
> -    public EntityBuilder gzipCompress() {
> -        this.gzipCompress = true;
> +    public EntityBuilder gzipCompressed() {
> +        this.gzipCompressed = true;
>          return this;
>      }
>
> @@ -328,7 +328,7 @@ public class EntityBuilder {
>          } else {
>              throw new IllegalStateException("No entity set");
>          }
> -        if (this.gzipCompress) {
> +        if (this.gzipCompressed) {
>              return new GzipCompressingEntity(e);
>          }
>          return e;
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/AbstractMultipartFormat.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/AbstractMultipartFormat.java
> index 93befa6..416bccb 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/AbstractMultipartFormat.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/AbstractMultipartFormat.java
> @@ -91,7 +91,7 @@ abstract class AbstractMultipartFormat {
>
>      static final ByteArrayBuffer FIELD_SEP =
> encode(StandardCharsets.ISO_8859_1, ": ");
>      static final ByteArrayBuffer CR_LF =
> encode(StandardCharsets.ISO_8859_1, "\r\n");
> -    static final ByteArrayBuffer TWO_DASHES =
> encode(StandardCharsets.ISO_8859_1, "--");
> +    static final ByteArrayBuffer TWO_HYPHENS =
> encode(StandardCharsets.ISO_8859_1, "--");
>
>      final Charset charset;
>      final String boundary;
> @@ -122,7 +122,7 @@ abstract class AbstractMultipartFormat {
>
>          final ByteArrayBuffer boundaryEncoded = encode(this.charset,
> this.boundary);
>          for (final MultipartPart part: getParts()) {
> -            writeBytes(TWO_DASHES, out);
> +            writeBytes(TWO_HYPHENS, out);
>              writeBytes(boundaryEncoded, out);
>              writeBytes(CR_LF, out);
>
> @@ -135,9 +135,9 @@ abstract class AbstractMultipartFormat {
>              }
>              writeBytes(CR_LF, out);
>          }
> -        writeBytes(TWO_DASHES, out);
> +        writeBytes(TWO_HYPHENS, out);
>          writeBytes(boundaryEncoded, out);
> -        writeBytes(TWO_DASHES, out);
> +        writeBytes(TWO_HYPHENS, out);
>          writeBytes(CR_LF, out);
>      }
>
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/IdleConnectionEvictor.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/IdleConnectionEvictor.java
> index 79d9068..1e7258e 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/IdleConnectionEvictor.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/IdleConnectionEvictor.java
> @@ -59,7 +59,7 @@ public final class IdleConnectionEvictor {
>              public void run() {
>                  try {
>                      while (!Thread.currentThread().isInterrupted()) {
> -                        Thread.sleep(localSleepTime.toMillis());
> +                        localSleepTime.sleep();
>                          connectionManager.closeExpired();
>                          if (maxIdleTime != null) {
>                              connectionManager.closeIdle(maxIdleTime);
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/TunnelRefusedException.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/TunnelRefusedException.java
> index 188dbfc..8d032fb 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/TunnelRefusedException.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/TunnelRefusedException.java
> @@ -38,15 +38,15 @@ public class TunnelRefusedException extends
> HttpException {
>
>      private static final long serialVersionUID = -8646722842745617323L;
>
> -    private final String responseMesage;
> +    private final String responseMessage;
>
> -    public TunnelRefusedException(final String message, final String
> responseMesage) {
> +    public TunnelRefusedException(final String message, final String
> responseMessage) {
>          super(message);
> -        this.responseMesage = responseMesage;
> +        this.responseMessage = responseMessage;
>      }
>
>      public String getResponseMessage() {
> -        return this.responseMesage;
> +        return this.responseMessage;
>      }
>
>  }
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/Wire.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/Wire.java
> index 97d0392..29f6a55 100644
> --- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/Wire.java
> +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/Wire.java
> @@ -38,7 +38,7 @@ public class Wire {
>
>      private static final int MAX_STRING_BUILDER_SIZE = 2048;
>
> -    private static final ThreadLocal<StringBuilder> threadLocal = new
> ThreadLocal<>();
> +    private static final ThreadLocal<StringBuilder> THREAD_LOCAL = new
> ThreadLocal<>();
>
>      /**
>       * Returns a {@code StringBuilder} that this Layout implementation
> can use to write the formatted log event to.
> @@ -46,12 +46,11 @@ public class Wire {
>       * @return a {@code StringBuilder}
>       */
>      private static StringBuilder getStringBuilder() {
> -        StringBuilder result = threadLocal.get();
> +        StringBuilder result = THREAD_LOCAL.get();
>          if (result == null) {
>              result = new StringBuilder(MAX_STRING_BUILDER_SIZE);
> -            threadLocal.set(result);
> +            THREAD_LOCAL.set(result);
>          }
> -        // TODO Delegate to Log4j's 2.9 StringBuilds.trimToMaxSize() when
> it is released.
>          trimToMaxSize(result, MAX_STRING_BUILDER_SIZE);
>          result.setLength(0);
>          return result;
> @@ -64,7 +63,6 @@ public class Wire {
>       * @param stringBuilder the StringBuilder to check
>       * @param maxSize the maximum number of characters the StringBuilder
> is allowed to have
>       */
> -    // TODO Delete wheb Log4j's 2.9 (see #trimToMaxSize(StringBuild))
>      private static void trimToMaxSize(final StringBuilder stringBuilder,
> final int maxSize) {
>          if (stringBuilder != null && stringBuilder.capacity() > maxSize) {
>              stringBuilder.setLength(maxSize);
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AbstractMinimalHttpAsyncClientBase.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AbstractMinimalHttpAsyncClientBase.java
> index 4b927ab..9058a96 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AbstractMinimalHttpAsyncClientBase.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AbstractMinimalHttpAsyncClientBase.java
> @@ -54,7 +54,7 @@ abstract class AbstractMinimalHttpAsyncClientBase
> extends AbstractHttpAsyncClien
>
>      @Override
>      protected <T> Future<T> doExecute(
> -            final HttpHost httphost,
> +            final HttpHost httpHost,
>              final AsyncRequestProducer requestProducer,
>              final AsyncResponseConsumer<T> responseConsumer,
>              final HandlerFactory<AsyncPushConsumer> pushHandlerFactory,
> 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 13ddb63..250f44a 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
> @@ -65,7 +65,7 @@ import
> org.apache.hc.client5.http.impl.auth.KerberosSchemeFactory;
>  import org.apache.hc.client5.http.impl.auth.NTLMSchemeFactory;
>  import org.apache.hc.client5.http.impl.auth.SPNegoSchemeFactory;
>  import
> org.apache.hc.client5.http.impl.auth.SystemDefaultCredentialsProvider;
> -import org.apache.hc.client5.http.impl.nio.MultuhomeConnectionInitiator;
> +import org.apache.hc.client5.http.impl.nio.MultihomeConnectionInitiator;
>  import org.apache.hc.client5.http.impl.routing.DefaultRoutePlanner;
>  import org.apache.hc.client5.http.protocol.RedirectStrategy;
>  import org.apache.hc.client5.http.protocol.RequestAddCookies;
> @@ -800,7 +800,7 @@ public class H2AsyncClientBuilder {
>              }
>          }
>
> -        final MultuhomeConnectionInitiator connectionInitiator = new
> MultuhomeConnectionInitiator(ioReactor, dnsResolver);
> +        final MultihomeConnectionInitiator connectionInitiator = new
> MultihomeConnectionInitiator(ioReactor, dnsResolver);
>          final H2ConnPool connPool = new H2ConnPool(connectionInitiator,
> new Resolver<HttpHost, InetSocketAddress>() {
>
>              @Override
> @@ -863,7 +863,7 @@ public class H2AsyncClientBuilder {
>                  public void run() {
>                      try {
>                          while (!Thread.currentThread().isInterrupted()) {
> -                            Thread.sleep(maxIdleTime.toMillis());
> +                            maxIdleTime.sleep();
>                              connPool.closeIdle(maxIdleTime);
>                          }
>                      } catch (final InterruptedException ex) {
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncMainClientExec.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncMainClientExec.java
> index f09b51f..9299a8a 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncMainClientExec.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncMainClientExec.java
> @@ -66,7 +66,7 @@ import org.slf4j.LoggerFactory;
>  /**
>   * Usually the last HTTP/1.1 request execution handler in the asynchronous
>   * request execution chain that is responsible for execution of
> - * request / response exchanges with the opposite endpoint.
> + * request/response exchanges with the opposite endpoint.
>   *
>   * @since 5.0
>   */
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalHttpAsyncClient.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalHttpAsyncClient.java
> index 07882c1..48289b9 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalHttpAsyncClient.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalHttpAsyncClient.java
> @@ -68,7 +68,7 @@ import
> org.apache.hc.core5.reactor.DefaultConnectingIOReactor;
>  @Internal
>  public final class InternalHttpAsyncClient extends
> InternalAbstractHttpAsyncClient {
>
> -    private final AsyncClientConnectionManager connmgr;
> +    private final AsyncClientConnectionManager manager;
>      private final HttpRoutePlanner routePlanner;
>      private final HttpVersionPolicy versionPolicy;
>
> @@ -77,7 +77,7 @@ public final class InternalHttpAsyncClient extends
> InternalAbstractHttpAsyncClie
>              final AsyncExecChainElement execChain,
>              final AsyncPushConsumerRegistry pushConsumerRegistry,
>              final ThreadFactory threadFactory,
> -            final AsyncClientConnectionManager connmgr,
> +            final AsyncClientConnectionManager manager,
>              final HttpRoutePlanner routePlanner,
>              final HttpVersionPolicy versionPolicy,
>              final Lookup<CookieSpecProvider> cookieSpecRegistry,
> @@ -88,14 +88,14 @@ public final class InternalHttpAsyncClient extends
> InternalAbstractHttpAsyncClie
>              final List<Closeable> closeables) {
>          super(ioReactor, pushConsumerRegistry, threadFactory, execChain,
>                  cookieSpecRegistry, authSchemeRegistry, cookieStore,
> credentialsProvider, defaultConfig, closeables);
> -        this.connmgr = connmgr;
> +        this.manager = manager;
>          this.routePlanner = routePlanner;
>          this.versionPolicy = versionPolicy;
>      }
>
>      @Override
>      AsyncExecRuntime createAsyncExecRuntime(final
> HandlerFactory<AsyncPushConsumer> pushHandlerFactory) {
> -        return new InternalHttpAsyncExecRuntime(log, connmgr,
> getConnectionInitiator(), pushHandlerFactory, versionPolicy);
> +        return new InternalHttpAsyncExecRuntime(log, manager,
> getConnectionInitiator(), pushHandlerFactory, versionPolicy);
>      }
>
>      @Override
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalH2AsyncClient.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalH2AsyncClient.java
> index 5147426..bd4a35d 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalH2AsyncClient.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalH2AsyncClient.java
> @@ -39,7 +39,7 @@ import org.apache.hc.client5.http.config.RequestConfig;
>  import org.apache.hc.client5.http.impl.ConnPoolSupport;
>  import org.apache.hc.client5.http.impl.ExecSupport;
>  import org.apache.hc.client5.http.impl.classic.RequestFailedException;
> -import org.apache.hc.client5.http.impl.nio.MultuhomeConnectionInitiator;
> +import org.apache.hc.client5.http.impl.nio.MultihomeConnectionInitiator;
>  import org.apache.hc.client5.http.protocol.HttpClientContext;
>  import org.apache.hc.core5.annotation.Contract;
>  import org.apache.hc.core5.annotation.ThreadingBehavior;
> @@ -118,7 +118,7 @@ public final class MinimalH2AsyncClient extends
> AbstractMinimalHttpAsyncClientBa
>                  }),
>                  pushConsumerRegistry,
>                  threadFactory);
> -        this.connectionInitiator = new
> MultuhomeConnectionInitiator(getConnectionInitiator(), dnsResolver);
> +        this.connectionInitiator = new
> MultihomeConnectionInitiator(getConnectionInitiator(), dnsResolver);
>          this.connPool = new H2ConnPool(this.connectionInitiator, new
> Resolver<HttpHost, InetSocketAddress>() {
>
>              @Override
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalHttpAsyncClient.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalHttpAsyncClient.java
> index fc93999..e74cf3d 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalHttpAsyncClient.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalHttpAsyncClient.java
> @@ -98,7 +98,7 @@ import org.apache.hc.core5.util.Timeout;
>  @Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
>  public final class MinimalHttpAsyncClient extends
> AbstractMinimalHttpAsyncClientBase {
>
> -    private final AsyncClientConnectionManager connmgr;
> +    private final AsyncClientConnectionManager manager;
>      private final SchemePortResolver schemePortResolver;
>      private final HttpVersionPolicy versionPolicy;
>
> @@ -109,7 +109,7 @@ public final class MinimalHttpAsyncClient extends
> AbstractMinimalHttpAsyncClient
>              final IOReactorConfig reactorConfig,
>              final ThreadFactory threadFactory,
>              final ThreadFactory workerThreadFactory,
> -            final AsyncClientConnectionManager connmgr,
> +            final AsyncClientConnectionManager manager,
>              final SchemePortResolver schemePortResolver) {
>          super(new DefaultConnectingIOReactor(
>                  eventHandlerFactory,
> @@ -128,7 +128,7 @@ public final class MinimalHttpAsyncClient extends
> AbstractMinimalHttpAsyncClient
>                  }),
>                  pushConsumerRegistry,
>                  threadFactory);
> -        this.connmgr = connmgr;
> +        this.manager = manager;
>          this.schemePortResolver = schemePortResolver != null ?
> schemePortResolver : DefaultSchemePortResolver.INSTANCE;
>          this.versionPolicy = versionPolicy != null ? versionPolicy :
> HttpVersionPolicy.NEGOTIATE;
>      }
> @@ -142,7 +142,7 @@ public final class MinimalHttpAsyncClient extends
> AbstractMinimalHttpAsyncClient
>          final HttpRoute route = new
> HttpRoute(RoutingSupport.normalize(host, schemePortResolver));
>          final ComplexFuture<AsyncConnectionEndpoint> resultFuture = new
> ComplexFuture<>(callback);
>          final String exchangeId = ExecSupport.getNextExchangeId();
> -        final Future<AsyncConnectionEndpoint> leaseFuture = connmgr.lease(
> +        final Future<AsyncConnectionEndpoint> leaseFuture = manager.lease(
>                  exchangeId,
>                  route,
>                  null,
> @@ -154,7 +154,7 @@ public final class MinimalHttpAsyncClient extends
> AbstractMinimalHttpAsyncClient
>                          if (connectionEndpoint.isConnected()) {
>                              resultFuture.completed(connectionEndpoint);
>                          } else {
> -                            final Future<AsyncConnectionEndpoint>
> connectFuture = connmgr.connect(
> +                            final Future<AsyncConnectionEndpoint>
> connectFuture = manager.connect(
>                                      connectionEndpoint,
>                                      getConnectionInitiator(),
>                                      connectTimeout,
> @@ -478,7 +478,7 @@ public final class MinimalHttpAsyncClient extends
> AbstractMinimalHttpAsyncClient
>          @Override
>          public void releaseAndReuse() {
>              if (released.compareAndSet(false, true)) {
> -                connmgr.release(connectionEndpoint, null,
> TimeValue.NEG_ONE_MILLISECONDS);
> +                manager.release(connectionEndpoint, null,
> TimeValue.NEG_ONE_MILLISECONDS);
>              }
>          }
>
> @@ -486,7 +486,7 @@ public final class MinimalHttpAsyncClient extends
> AbstractMinimalHttpAsyncClient
>          public void releaseAndDiscard() {
>              if (released.compareAndSet(false, true)) {
>                  Closer.closeQuietly(connectionEndpoint);
> -                connmgr.release(connectionEndpoint, null,
> TimeValue.ZERO_MILLISECONDS);
> +                manager.release(connectionEndpoint, null,
> TimeValue.ZERO_MILLISECONDS);
>              }
>          }
>
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/BasicCredentialsProvider.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/BasicCredentialsProvider.java
> index 26465ca..579d8b2 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/BasicCredentialsProvider.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/BasicCredentialsProvider.java
> @@ -57,32 +57,32 @@ public class BasicCredentialsProvider implements
> CredentialsStore {
>
>      @Override
>      public void setCredentials(
> -            final AuthScope authscope,
> +            final AuthScope authScope,
>              final Credentials credentials) {
> -        Args.notNull(authscope, "Authentication scope");
> -        credMap.put(authscope, credentials);
> +        Args.notNull(authScope, "Authentication scope");
> +        credMap.put(authScope, credentials);
>      }
>
>      /**
>       * Find matching {@link Credentials credentials} for the given
> authentication scope.
>       *
>       * @param map the credentials hash map
> -     * @param authscope the {@link AuthScope authentication scope}
> +     * @param authScope the {@link AuthScope authentication scope}
>       * @return the credentials
>       *
>       */
>      private static Credentials matchCredentials(
>              final Map<AuthScope, Credentials> map,
> -            final AuthScope authscope) {
> +            final AuthScope authScope) {
>          // see if we get a direct hit
> -        Credentials creds = map.get(authscope);
> +        Credentials creds = map.get(authScope);
>          if (creds == null) {
>              // Nope.
>              // Do a full scan
>              int bestMatchFactor  = -1;
>              AuthScope bestMatch  = null;
>              for (final AuthScope current: map.keySet()) {
> -                final int factor = authscope.match(current);
> +                final int factor = authScope.match(current);
>                  if (factor > bestMatchFactor) {
>                      bestMatchFactor = factor;
>                      bestMatch = current;
> @@ -96,10 +96,10 @@ public class BasicCredentialsProvider implements
> CredentialsStore {
>      }
>
>      @Override
> -    public Credentials getCredentials(final AuthScope authscope,
> +    public Credentials getCredentials(final AuthScope authScope,
>                                        final HttpContext httpContext) {
> -        Args.notNull(authscope, "Authentication scope");
> -        return matchCredentials(this.credMap, authscope);
> +        Args.notNull(authScope, "Authentication scope");
> +        return matchCredentials(this.credMap, authScope);
>      }
>
>      @Override
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/SystemDefaultCredentialsProvider.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/SystemDefaultCredentialsProvider.java
> index a4c0b0e..b338c2d 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/SystemDefaultCredentialsProvider.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/SystemDefaultCredentialsProvider.java
> @@ -88,13 +88,13 @@ public class SystemDefaultCredentialsProvider
> implements CredentialsStore {
>      }
>
>      @Override
> -    public void setCredentials(final AuthScope authscope, final
> Credentials credentials) {
> -        internal.setCredentials(authscope, credentials);
> +    public void setCredentials(final AuthScope authScope, final
> Credentials credentials) {
> +        internal.setCredentials(authScope, credentials);
>      }
>
>      private static PasswordAuthentication getSystemCreds(
>              final String protocol,
> -            final AuthScope authscope,
> +            final AuthScope authScope,
>              final Authenticator.RequestorType requestorType,
>              final HttpClientContext context) {
>          final HttpRequest request = context != null ?
> context.getRequest() : null;
> @@ -107,41 +107,41 @@ public class SystemDefaultCredentialsProvider
> implements CredentialsStore {
>          }
>          // use null addr, because the authentication fails if it does not
> exactly match the expected realm's host
>          return Authenticator.requestPasswordAuthentication(
> -                authscope.getHost(),
> +                authScope.getHost(),
>                  null,
> -                authscope.getPort(),
> +                authScope.getPort(),
>                  protocol,
> -                authscope.getRealm(),
> -                translateAuthScheme(authscope.getAuthScheme()),
> +                authScope.getRealm(),
> +                translateAuthScheme(authScope.getAuthScheme()),
>                  targetHostURL,
>                  requestorType);
>      }
>
>      @Override
> -    public Credentials getCredentials(final AuthScope authscope, final
> HttpContext context) {
> -        Args.notNull(authscope, "Auth scope");
> -        final Credentials localcreds = internal.getCredentials(authscope,
> context);
> +    public Credentials getCredentials(final AuthScope authScope, final
> HttpContext context) {
> +        Args.notNull(authScope, "Auth scope");
> +        final Credentials localcreds = internal.getCredentials(authScope,
> context);
>          if (localcreds != null) {
>              return localcreds;
>          }
> -        final String host = authscope.getHost();
> +        final String host = authScope.getHost();
>          if (host != null) {
>              final HttpClientContext clientContext = context != null ?
> HttpClientContext.adapt(context) : null;
> -            final String protocol = authscope.getProtocol() != null ?
> authscope.getProtocol() : (authscope.getPort() == 443 ? URIScheme.HTTPS.id
> : URIScheme.HTTP.id);
> +            final String protocol = authScope.getProtocol() != null ?
> authScope.getProtocol() : (authScope.getPort() == 443 ? URIScheme.HTTPS.id
> : URIScheme.HTTP.id);
>              PasswordAuthentication systemcreds = getSystemCreds(
> -                    protocol, authscope,
> Authenticator.RequestorType.SERVER, clientContext);
> +                    protocol, authScope,
> Authenticator.RequestorType.SERVER, clientContext);
>              if (systemcreds == null) {
>                  systemcreds = getSystemCreds(
> -                        protocol, authscope,
> Authenticator.RequestorType.PROXY, clientContext);
> +                        protocol, authScope,
> Authenticator.RequestorType.PROXY, clientContext);
>              }
>              if (systemcreds == null) {
>                  // Look for values given using
> http.proxyUser/http.proxyPassword or
>                  // https.proxyUser/https.proxyPassword. We cannot simply
> use the protocol from
>                  // the origin since a proxy retrieved from
> https.proxyHost/https.proxyPort will
>                  // still use http as protocol
> -                systemcreds = getProxyCredentials("http", authscope);
> +                systemcreds = getProxyCredentials("http", authScope);
>                  if (systemcreds == null) {
> -                    systemcreds = getProxyCredentials("https", authscope);
> +                    systemcreds = getProxyCredentials("https", authScope);
>                  }
>              }
>              if (systemcreds != null) {
> @@ -149,7 +149,7 @@ public class SystemDefaultCredentialsProvider
> implements CredentialsStore {
>                  if (domain != null) {
>                      return new NTCredentials(systemcreds.getUserName(),
> systemcreds.getPassword(), null, domain);
>                  }
> -                if
> (AuthSchemes.NTLM.ident.equalsIgnoreCase(authscope.getAuthScheme())) {
> +                if
> (AuthSchemes.NTLM.ident.equalsIgnoreCase(authScope.getAuthScheme())) {
>                      // Domain may be specified in a fully qualified user
> name
>                      return new NTCredentials(
>                              systemcreds.getUserName(),
> systemcreds.getPassword(), null, null);
> @@ -160,7 +160,7 @@ public class SystemDefaultCredentialsProvider
> implements CredentialsStore {
>          return null;
>      }
>
> -    private static PasswordAuthentication getProxyCredentials(final
> String protocol, final AuthScope authscope) {
> +    private static PasswordAuthentication getProxyCredentials(final
> String protocol, final AuthScope authScope) {
>          final String proxyHost = System.getProperty(protocol +
> ".proxyHost");
>          if (proxyHost == null) {
>              return null;
> @@ -172,7 +172,7 @@ public class SystemDefaultCredentialsProvider
> implements CredentialsStore {
>
>          try {
>              final AuthScope systemScope = new AuthScope(proxyHost,
> Integer.parseInt(proxyPort));
> -            if (authscope.match(systemScope) >= 0) {
> +            if (authScope.match(systemScope) >= 0) {
>                  final String proxyUser = System.getProperty(protocol +
> ".proxyUser");
>                  if (proxyUser == null) {
>                      return null;
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/AIMDBackoffManager.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/AIMDBackoffManager.java
> index c662e13..5341826 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/AIMDBackoffManager.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/AIMDBackoffManager.java
> @@ -60,8 +60,8 @@ public class AIMDBackoffManager implements
> BackoffManager {
>
>      private final ConnPoolControl<HttpRoute> connPerRoute;
>      private final Clock clock;
> -    private final Map<HttpRoute,Long> lastRouteProbes;
> -    private final Map<HttpRoute,Long> lastRouteBackoffs;
> +    private final Map<HttpRoute, Long> lastRouteProbes;
> +    private final Map<HttpRoute, Long> lastRouteBackoffs;
>      private long coolDown = 5 * 1000L;
>      private double backoffFactor = 0.5;
>      private int cap = 2; // Per RFC 2616 sec 8.1.4
> @@ -121,7 +121,7 @@ public class AIMDBackoffManager implements
> BackoffManager {
>          }
>      }
>
> -    private Long getLastUpdate(final Map<HttpRoute,Long> updates, final
> HttpRoute route) {
> +    private Long getLastUpdate(final Map<HttpRoute, Long> updates, final
> HttpRoute route) {
>          Long lastUpdate = updates.get(route);
>          if (lastUpdate == null) {
>              lastUpdate = Long.valueOf(0L);
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/DefaultBackoffStrategy.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/DefaultBackoffStrategy.java
> index 86c7af3..9ade7ea 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/DefaultBackoffStrategy.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/DefaultBackoffStrategy.java
> @@ -50,9 +50,9 @@ public class DefaultBackoffStrategy implements
> ConnectionBackoffStrategy {
>      }
>
>      @Override
> -    public boolean shouldBackoff(final HttpResponse resp) {
> -        return resp.getCode() == HttpStatus.SC_TOO_MANY_REQUESTS ||
> -            resp.getCode() == HttpStatus.SC_SERVICE_UNAVAILABLE;
> +    public boolean shouldBackoff(final HttpResponse response) {
> +        return response.getCode() == HttpStatus.SC_TOO_MANY_REQUESTS ||
> +            response.getCode() == HttpStatus.SC_SERVICE_UNAVAILABLE;
>      }
>
>  }
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/NullBackoffStrategy.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/NullBackoffStrategy.java
> index 36440aa..402af48 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/NullBackoffStrategy.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/NullBackoffStrategy.java
> @@ -43,7 +43,7 @@ public class NullBackoffStrategy implements
> ConnectionBackoffStrategy {
>      }
>
>      @Override
> -    public boolean shouldBackoff(final HttpResponse resp) {
> +    public boolean shouldBackoff(final HttpResponse response) {
>          return false;
>      }
>  }
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/MultuhomeConnectionInitiator.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/MultihomeConnectionInitiator.java
> similarity index 96%
> rename from
> httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/MultuhomeConnectionInitiator.java
> rename to
> httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/MultihomeConnectionInitiator.java
> index 3ea9718..2e8e00b 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/MultuhomeConnectionInitiator.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/MultihomeConnectionInitiator.java
> @@ -46,12 +46,12 @@ import org.apache.hc.core5.util.Timeout;
>   * @since 5.0
>   */
>  @Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
> -public final class MultuhomeConnectionInitiator implements
> ConnectionInitiator {
> +public final class MultihomeConnectionInitiator implements
> ConnectionInitiator {
>
>      private final ConnectionInitiator connectionInitiator;
>      private final MultihomeIOSessionRequester sessionRequester;
>
> -    public MultuhomeConnectionInitiator(
> +    public MultihomeConnectionInitiator(
>              final ConnectionInitiator connectionInitiator,
>              final DnsResolver dnsResolver) {
>          this.connectionInitiator = Args.notNull(connectionInitiator,
> "Connection initiator");
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixListParser.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixListParser.java
> index 9619d5d..e943f1f 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixListParser.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixListParser.java
> @@ -102,7 +102,6 @@ public final class PublicSuffixListParser {
>          final List<PublicSuffixList> result = new ArrayList<>(2);
>
>          final BufferedReader r = new BufferedReader(reader);
> -        final StringBuilder sb = new StringBuilder(256);
>
>          DomainType domainType = null;
>          List<String> rules = null;
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/socket/ConnectionSocketFactory.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/socket/ConnectionSocketFactory.java
> index edb510b..88cafd0 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/socket/ConnectionSocketFactory.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/socket/ConnectionSocketFactory.java
> @@ -60,7 +60,7 @@ public interface ConnectionSocketFactory {
>       * Connects the socket to the target host with the given resolved
> remote address.
>       *
>       * @param connectTimeout connect timeout.
> -     * @param sock the socket to connect, as obtained from {@link
> #createSocket(HttpContext)}.
> +     * @param socket the socket to connect, as obtained from {@link
> #createSocket(HttpContext)}.
>       * {@code null} indicates that a new socket should be created and
> connected.
>       * @param host target host as specified by the caller (end user).
>       * @param remoteAddress the resolved remote address to connect to.
> @@ -75,7 +75,7 @@ public interface ConnectionSocketFactory {
>       */
>      Socket connectSocket(
>          TimeValue connectTimeout,
> -        Socket sock,
> +        Socket socket,
>          HttpHost host,
>          InetSocketAddress remoteAddress,
>          InetSocketAddress localAddress,
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java
> index 741f016..d3be931 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java
> @@ -121,7 +121,7 @@ public class SSLConnectionSocketFactory implements
> LayeredConnectionSocketFactor
>          return false;
>      }
>
> -    private final javax.net.ssl.SSLSocketFactory socketfactory;
> +    private final javax.net.ssl.SSLSocketFactory socketFactory;
>      private final HostnameVerifier hostnameVerifier;
>      private final String[] supportedProtocols;
>      private final String[] supportedCipherSuites;
> @@ -156,20 +156,20 @@ public class SSLConnectionSocketFactory implements
> LayeredConnectionSocketFactor
>       * @since 4.4
>       */
>      public SSLConnectionSocketFactory(
> -            final javax.net.ssl.SSLSocketFactory socketfactory,
> +            final javax.net.ssl.SSLSocketFactory socketFactory,
>              final HostnameVerifier hostnameVerifier) {
> -        this(socketfactory, null, null, hostnameVerifier);
> +        this(socketFactory, null, null, hostnameVerifier);
>      }
>
>      /**
>       * @since 4.4
>       */
>      public SSLConnectionSocketFactory(
> -            final javax.net.ssl.SSLSocketFactory socketfactory,
> +            final javax.net.ssl.SSLSocketFactory socketFactory,
>              final String[] supportedProtocols,
>              final String[] supportedCipherSuites,
>              final HostnameVerifier hostnameVerifier) {
> -        this.socketfactory = Args.notNull(socketfactory, "SSL socket
> factory");
> +        this.socketFactory = Args.notNull(socketFactory, "SSL socket
> factory");
>          this.supportedProtocols = supportedProtocols;
>          this.supportedCipherSuites = supportedCipherSuites;
>          this.hostnameVerifier = hostnameVerifier != null ?
> hostnameVerifier : HttpsSupport.getDefaultHostnameVerifier();
> @@ -250,7 +250,7 @@ public class SSLConnectionSocketFactory implements
> LayeredConnectionSocketFactor
>              final String target,
>              final int port,
>              final HttpContext context) throws IOException {
> -        final SSLSocket sslsock = (SSLSocket)
> this.socketfactory.createSocket(
> +        final SSLSocket sslsock = (SSLSocket)
> this.socketFactory.createSocket(
>                  socket,
>                  target,
>                  port,
> @@ -310,8 +310,8 @@ public class SSLConnectionSocketFactory implements
> LayeredConnectionSocketFactor
>
>      protected void verifySession(
>              final String hostname,
> -            final SSLSession sslsession) throws SSLException {
> -        tlsSessionValidator.verifySession(hostname, sslsession,
> hostnameVerifier);
> +            final SSLSession sslSession) throws SSLException {
> +        tlsSessionValidator.verifySession(hostname, sslSession,
> hostnameVerifier);
>      }
>
>  }
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactoryBuilder.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactoryBuilder.java
> index 2310c30..f31d78d 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactoryBuilder.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactoryBuilder.java
> @@ -125,14 +125,14 @@ public class SSLConnectionSocketFactoryBuilder {
>      }
>
>      public SSLConnectionSocketFactory build() {
> -        final javax.net.ssl.SSLSocketFactory socketfactory;
> +        final javax.net.ssl.SSLSocketFactory socketFactory;
>          if (sslContext != null) {
> -            socketfactory = sslContext.getSocketFactory();
> +            socketFactory = sslContext.getSocketFactory();
>          } else {
>              if (systemProperties) {
> -                socketfactory = (javax.net.ssl.SSLSocketFactory)
> javax.net.ssl.SSLSocketFactory.getDefault();
> +                socketFactory = (javax.net.ssl.SSLSocketFactory)
> javax.net.ssl.SSLSocketFactory.getDefault();
>              } else {
> -                socketfactory =
> SSLContexts.createDefault().getSocketFactory();
> +                socketFactory =
> SSLContexts.createDefault().getSocketFactory();
>              }
>          }
>          final String[] tlsVersionsCopy;
> @@ -148,7 +148,7 @@ public class SSLConnectionSocketFactoryBuilder {
>              ciphersCopy = systemProperties ?
> HttpsSupport.getSystemCipherSuits() : null;
>          }
>          return new SSLConnectionSocketFactory(
> -                socketfactory,
> +                socketFactory,
>                  tlsVersionsCopy,
>                  ciphersCopy,
>                  hostnameVerifier != null ? hostnameVerifier :
> HttpsSupport.getDefaultHostnameVerifier());
> diff --git
> a/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java
> b/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java
> index b8688e2..bf53275 100644
> ---
> a/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java
> +++
> b/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java
> @@ -163,7 +163,7 @@ public class URIUtils {
>       * @param reference the URI reference
>       * @return the resulting URI
>       */
> -    public static URI resolve(final URI baseURI, final URI reference){
> +    public static URI resolve(final URI baseURI, final URI reference) {
>          Args.notNull(baseURI, "Base URI");
>          Args.notNull(reference, "Reference URI");
>          final String s = reference.toASCIIString();
> diff --git
> a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java
> b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java
> index e65dcd8..9158afc 100644
> ---
> a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java
> +++
> b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java
> @@ -117,7 +117,7 @@ public class TestEntityBuilder {
>
>      @Test
>      public void testBuildGZipped() throws Exception {
> -        final HttpEntity entity =
> EntityBuilder.create().setText("stuff").gzipCompress().build();
> +        final HttpEntity entity =
> EntityBuilder.create().setText("stuff").gzipCompressed().build();
>          Assert.assertNotNull(entity);
>          Assert.assertNotNull(entity.getContentType());
>          Assert.assertEquals("text/plain; charset=ISO-8859-1",
> entity.getContentType());
>
>

[httpcomponents-client] 01/01: Align names for consistency and fix typos

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

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

commit 7c1c30e4494b6654533a77ee6d02697b78a872d1
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Dec 14 17:28:16 2019 +0100

    Align names for consistency and fix typos
---
 .../hc/client5/http/cache/HttpCacheEntry.java      |  4 +--
 .../client5/http/impl/cache/BasicIdGenerator.java  |  2 +-
 .../http/impl/cache/CacheValidityPolicy.java       | 16 ++++-----
 .../cache/CachedResponseSuitabilityChecker.java    |  6 ++--
 .../http/impl/cache/ManagedHttpCacheStorage.java   |  2 +-
 .../apache/hc/client5/http/fluent/Executor.java    | 12 +++----
 .../org/apache/hc/client5/http/auth/AuthScope.java | 14 ++++----
 .../hc/client5/http/auth/CredentialsProvider.java  |  4 +--
 .../hc/client5/http/auth/CredentialsStore.java     |  4 +--
 .../http/classic/ConnectionBackoffStrategy.java    |  4 +--
 .../hc/client5/http/entity/EntityBuilder.java      | 12 +++----
 .../http/entity/mime/AbstractMultipartFormat.java  |  8 ++---
 .../client5/http/impl/IdleConnectionEvictor.java   |  2 +-
 .../client5/http/impl/TunnelRefusedException.java  |  8 ++---
 .../java/org/apache/hc/client5/http/impl/Wire.java |  8 ++---
 .../async/AbstractMinimalHttpAsyncClientBase.java  |  2 +-
 .../http/impl/async/H2AsyncClientBuilder.java      |  6 ++--
 .../http/impl/async/HttpAsyncMainClientExec.java   |  2 +-
 .../http/impl/async/InternalHttpAsyncClient.java   |  8 ++---
 .../http/impl/async/MinimalH2AsyncClient.java      |  4 +--
 .../http/impl/async/MinimalHttpAsyncClient.java    | 14 ++++----
 .../http/impl/auth/BasicCredentialsProvider.java   | 20 ++++++------
 .../auth/SystemDefaultCredentialsProvider.java     | 38 +++++++++++-----------
 .../http/impl/classic/AIMDBackoffManager.java      |  6 ++--
 .../http/impl/classic/DefaultBackoffStrategy.java  |  6 ++--
 .../http/impl/classic/NullBackoffStrategy.java     |  2 +-
 ...ator.java => MultihomeConnectionInitiator.java} |  4 +--
 .../client5/http/psl/PublicSuffixListParser.java   |  1 -
 .../http/socket/ConnectionSocketFactory.java       |  4 +--
 .../http/ssl/SSLConnectionSocketFactory.java       | 16 ++++-----
 .../ssl/SSLConnectionSocketFactoryBuilder.java     | 10 +++---
 .../org/apache/hc/client5/http/utils/URIUtils.java |  2 +-
 .../hc/client5/http/entity/TestEntityBuilder.java  |  2 +-
 33 files changed, 125 insertions(+), 128 deletions(-)

diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheEntry.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheEntry.java
index 47ed671..ff53120 100644
--- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheEntry.java
+++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheEntry.java
@@ -64,7 +64,7 @@ public class HttpCacheEntry implements MessageHeaders, Serializable {
     private final int status;
     private final HeaderGroup responseHeaders;
     private final Resource resource;
-    private final Map<String,String> variantMap;
+    private final Map<String, String> variantMap;
     private final Date date;
 
     /**
@@ -91,7 +91,7 @@ public class HttpCacheEntry implements MessageHeaders, Serializable {
             final int status,
             final Header[] responseHeaders,
             final Resource resource,
-            final Map<String,String> variantMap) {
+            final Map<String, String> variantMap) {
         super();
         Args.notNull(requestDate, "Request date");
         Args.notNull(responseDate, "Response date");
diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/BasicIdGenerator.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/BasicIdGenerator.java
index cfa28ac..80fdb6b 100644
--- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/BasicIdGenerator.java
+++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/BasicIdGenerator.java
@@ -65,7 +65,7 @@ class BasicIdGenerator {
         final int rndnum = this.rnd.nextInt();
         buffer.append(System.currentTimeMillis());
         buffer.append('.');
-        final Formatter formatter = new Formatter(buffer, Locale.US);
+        final Formatter formatter = new Formatter(buffer, Locale.ROOT);
         formatter.format("%1$016x-%2$08x", Long.valueOf(this.count), Integer.valueOf(rndnum));
         formatter.close();
         buffer.append('.');
diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheValidityPolicy.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheValidityPolicy.java
index 2d469ca..7f7a674 100644
--- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheValidityPolicy.java
+++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheValidityPolicy.java
@@ -53,9 +53,9 @@ class CacheValidityPolicy {
     }
 
     public long getFreshnessLifetimeSecs(final HttpCacheEntry entry) {
-        final long maxage = getMaxAge(entry);
-        if (maxage > -1) {
-            return maxage;
+        final long maxAge = getMaxAge(entry);
+        if (maxAge > -1) {
+            return maxAge;
         }
 
         final Date dateValue = entry.getDate();
@@ -242,23 +242,23 @@ class CacheValidityPolicy {
     }
 
     protected long getMaxAge(final HttpCacheEntry entry) {
-        long maxage = -1;
+        long maxAge = -1;
         final Iterator<HeaderElement> it = MessageSupport.iterate(entry, HeaderConstants.CACHE_CONTROL);
         while (it.hasNext()) {
             final HeaderElement elt = it.next();
             if (HeaderConstants.CACHE_CONTROL_MAX_AGE.equals(elt.getName()) || "s-maxage".equals(elt.getName())) {
                 try {
                     final long currMaxAge = Long.parseLong(elt.getValue());
-                    if (maxage == -1 || currMaxAge < maxage) {
-                        maxage = currMaxAge;
+                    if (maxAge == -1 || currMaxAge < maxAge) {
+                        maxAge = currMaxAge;
                     }
                 } catch (final NumberFormatException nfe) {
                     // be conservative if can't parse
-                    maxage = 0;
+                    maxAge = 0;
                 }
             }
         }
-        return maxage;
+        return maxAge;
     }
 
     public boolean hasCacheControlDirective(final HttpCacheEntry entry, final String directive) {
diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedResponseSuitabilityChecker.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedResponseSuitabilityChecker.java
index dc6b4d1..6142556 100644
--- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedResponseSuitabilityChecker.java
+++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachedResponseSuitabilityChecker.java
@@ -104,7 +104,7 @@ class CachedResponseSuitabilityChecker {
         while (it.hasNext()) {
             final HeaderElement elt = it.next();
             if (HeaderConstants.CACHE_CONTROL_MAX_STALE.equals(elt.getName())) {
-                if ((elt.getValue() == null || "".equals(elt.getValue().trim())) && maxstale == -1) {
+                if ((elt.getValue() == null || elt.getValue().trim().isEmpty()) && maxstale == -1) {
                     maxstale = Long.MAX_VALUE;
                 } else {
                     try {
@@ -185,8 +185,8 @@ class CachedResponseSuitabilityChecker {
 
             if (HeaderConstants.CACHE_CONTROL_MAX_AGE.equals(elt.getName())) {
                 try {
-                    final int maxage = Integer.parseInt(elt.getValue());
-                    if (validityStrategy.getCurrentAgeSecs(entry, now) > maxage) {
+                    final int maxAge = Integer.parseInt(elt.getValue());
+                    if (validityStrategy.getCurrentAgeSecs(entry, now) > maxAge) {
                         log.debug("Response from cache was NOT suitable due to max age");
                         return false;
                     }
diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ManagedHttpCacheStorage.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ManagedHttpCacheStorage.java
index 0623171..4582edc 100644
--- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ManagedHttpCacheStorage.java
+++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ManagedHttpCacheStorage.java
@@ -90,7 +90,7 @@ public class ManagedHttpCacheStorage implements HttpCacheStorage, Closeable {
         this.active = new AtomicBoolean(true);
     }
 
-    private void ensureValidState() throws IllegalStateException {
+    private void ensureValidState() {
         if (!this.active.get()) {
             throw new IllegalStateException("Cache has been shut down");
         }
diff --git a/httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/Executor.java b/httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/Executor.java
index 28fef86..97ffaf3 100644
--- a/httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/Executor.java
+++ b/httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/Executor.java
@@ -99,29 +99,29 @@ public class Executor {
         return this;
     }
 
-    public Executor auth(final AuthScope authScope, final Credentials creds) {
+    public Executor auth(final AuthScope authScope, final Credentials crededentials) {
         if (this.credentialsStore == null) {
             this.credentialsStore = new BasicCredentialsProvider();
         }
-        this.credentialsStore.setCredentials(authScope, creds);
+        this.credentialsStore.setCredentials(authScope, crededentials);
         return this;
     }
 
-    public Executor auth(final HttpHost host, final Credentials creds) {
-        return auth(new AuthScope(host), creds);
+    public Executor auth(final HttpHost host, final Credentials credentials) {
+        return auth(new AuthScope(host), credentials);
     }
 
     /**
      * @since 4.4
      */
-    public Executor auth(final String host, final Credentials creds) {
+    public Executor auth(final String host, final Credentials credentials) {
         final HttpHost httpHost;
         try {
             httpHost = HttpHost.create(host);
         } catch (final URISyntaxException ex) {
             throw new IllegalArgumentException("Invalid host: " + host);
         }
-        return auth(httpHost, creds);
+        return auth(httpHost, credentials);
     }
 
     public Executor authPreemptive(final HttpHost host) {
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/AuthScope.java b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/AuthScope.java
index 46fb787..74fe68c 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/AuthScope.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/AuthScope.java
@@ -127,14 +127,14 @@ public class AuthScope {
     /**
      * Creates a copy of the given credentials scope.
      */
-    public AuthScope(final AuthScope authscope) {
+    public AuthScope(final AuthScope authScope) {
         super();
-        Args.notNull(authscope, "Scope");
-        this.protocol = authscope.getProtocol();
-        this.host = authscope.getHost();
-        this.port = authscope.getPort();
-        this.realm = authscope.getRealm();
-        this.authScheme = authscope.getAuthScheme();
+        Args.notNull(authScope, "Scope");
+        this.protocol = authScope.getProtocol();
+        this.host = authScope.getHost();
+        this.port = authScope.getPort();
+        this.realm = authScope.getRealm();
+        this.authScheme = authScope.getAuthScheme();
     }
 
     public String getProtocol() {
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsProvider.java b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsProvider.java
index 103fc06..39be2aa 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsProvider.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsProvider.java
@@ -44,11 +44,11 @@ public interface CredentialsProvider {
      * Returns {@link Credentials credentials} for the given authentication scope,
      * if available.
      *
-     * @param authscope the {@link AuthScope authentication scope}
+     * @param authScope the {@link AuthScope authentication scope}
      * @param context the {@link HttpContext http context}
      * @return the credentials
      * @since 5.0
      */
-    Credentials getCredentials(AuthScope authscope, HttpContext context);
+    Credentials getCredentials(AuthScope authScope, HttpContext context);
 
 }
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsStore.java b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsStore.java
index a757883..a36c59d 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsStore.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/CredentialsStore.java
@@ -42,13 +42,13 @@ public interface CredentialsStore extends CredentialsProvider {
      * Sets the {@link Credentials credentials} for the given authentication
      * scope. Any previous credentials for the given scope will be overwritten.
      *
-     * @param authscope the {@link AuthScope authentication scope}
+     * @param authScope the {@link AuthScope authentication scope}
      * @param credentials the authentication {@link Credentials credentials}
      * for the given scope.
      *
      * @see #getCredentials(AuthScope, org.apache.hc.core5.http.protocol.HttpContext)
      */
-    void setCredentials(AuthScope authscope, Credentials credentials);
+    void setCredentials(AuthScope authScope, Credentials credentials);
 
     /**
      * Clears all credentials.
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/classic/ConnectionBackoffStrategy.java b/httpclient5/src/main/java/org/apache/hc/client5/http/classic/ConnectionBackoffStrategy.java
index 059ac26..1ae39c8 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/classic/ConnectionBackoffStrategy.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/classic/ConnectionBackoffStrategy.java
@@ -56,9 +56,9 @@ public interface ConnectionBackoffStrategy {
      * signal. Implementations MUST restrict themselves to examining
      * the response header and MUST NOT consume any of the response
      * body, if any.
-     * @param resp the {@code HttpResponse} that was received
+     * @param response the {@code HttpResponse} that was received
      * @return {@code true} if a backoff signal should be
      *   given
      */
-    boolean shouldBackoff(HttpResponse resp);
+    boolean shouldBackoff(HttpResponse response);
 }
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/EntityBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/EntityBuilder.java
index 83557b0..e8768a5 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/EntityBuilder.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/EntityBuilder.java
@@ -72,7 +72,7 @@ public class EntityBuilder {
     private ContentType contentType;
     private String contentEncoding;
     private boolean chunked;
-    private boolean gzipCompress;
+    private boolean gzipCompressed;
 
     EntityBuilder() {
         super();
@@ -288,15 +288,15 @@ public class EntityBuilder {
     /**
      * Returns {@code true} if entity is to be GZIP compressed, {@code false} otherwise.
      */
-    public boolean isGzipCompress() {
-        return gzipCompress;
+    public boolean isGzipCompressed() {
+        return gzipCompressed;
     }
 
     /**
      * Makes entity GZIP compressed.
      */
-    public EntityBuilder gzipCompress() {
-        this.gzipCompress = true;
+    public EntityBuilder gzipCompressed() {
+        this.gzipCompressed = true;
         return this;
     }
 
@@ -328,7 +328,7 @@ public class EntityBuilder {
         } else {
             throw new IllegalStateException("No entity set");
         }
-        if (this.gzipCompress) {
+        if (this.gzipCompressed) {
             return new GzipCompressingEntity(e);
         }
         return e;
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/AbstractMultipartFormat.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/AbstractMultipartFormat.java
index 93befa6..416bccb 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/AbstractMultipartFormat.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/AbstractMultipartFormat.java
@@ -91,7 +91,7 @@ abstract class AbstractMultipartFormat {
 
     static final ByteArrayBuffer FIELD_SEP = encode(StandardCharsets.ISO_8859_1, ": ");
     static final ByteArrayBuffer CR_LF = encode(StandardCharsets.ISO_8859_1, "\r\n");
-    static final ByteArrayBuffer TWO_DASHES = encode(StandardCharsets.ISO_8859_1, "--");
+    static final ByteArrayBuffer TWO_HYPHENS = encode(StandardCharsets.ISO_8859_1, "--");
 
     final Charset charset;
     final String boundary;
@@ -122,7 +122,7 @@ abstract class AbstractMultipartFormat {
 
         final ByteArrayBuffer boundaryEncoded = encode(this.charset, this.boundary);
         for (final MultipartPart part: getParts()) {
-            writeBytes(TWO_DASHES, out);
+            writeBytes(TWO_HYPHENS, out);
             writeBytes(boundaryEncoded, out);
             writeBytes(CR_LF, out);
 
@@ -135,9 +135,9 @@ abstract class AbstractMultipartFormat {
             }
             writeBytes(CR_LF, out);
         }
-        writeBytes(TWO_DASHES, out);
+        writeBytes(TWO_HYPHENS, out);
         writeBytes(boundaryEncoded, out);
-        writeBytes(TWO_DASHES, out);
+        writeBytes(TWO_HYPHENS, out);
         writeBytes(CR_LF, out);
     }
 
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/IdleConnectionEvictor.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/IdleConnectionEvictor.java
index 79d9068..1e7258e 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/IdleConnectionEvictor.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/IdleConnectionEvictor.java
@@ -59,7 +59,7 @@ public final class IdleConnectionEvictor {
             public void run() {
                 try {
                     while (!Thread.currentThread().isInterrupted()) {
-                        Thread.sleep(localSleepTime.toMillis());
+                        localSleepTime.sleep();
                         connectionManager.closeExpired();
                         if (maxIdleTime != null) {
                             connectionManager.closeIdle(maxIdleTime);
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/TunnelRefusedException.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/TunnelRefusedException.java
index 188dbfc..8d032fb 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/TunnelRefusedException.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/TunnelRefusedException.java
@@ -38,15 +38,15 @@ public class TunnelRefusedException extends HttpException {
 
     private static final long serialVersionUID = -8646722842745617323L;
 
-    private final String responseMesage;
+    private final String responseMessage;
 
-    public TunnelRefusedException(final String message, final String responseMesage) {
+    public TunnelRefusedException(final String message, final String responseMessage) {
         super(message);
-        this.responseMesage = responseMesage;
+        this.responseMessage = responseMessage;
     }
 
     public String getResponseMessage() {
-        return this.responseMesage;
+        return this.responseMessage;
     }
 
 }
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/Wire.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/Wire.java
index 97d0392..29f6a55 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/Wire.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/Wire.java
@@ -38,7 +38,7 @@ public class Wire {
 
     private static final int MAX_STRING_BUILDER_SIZE = 2048;
 
-    private static final ThreadLocal<StringBuilder> threadLocal = new ThreadLocal<>();
+    private static final ThreadLocal<StringBuilder> THREAD_LOCAL = new ThreadLocal<>();
 
     /**
      * Returns a {@code StringBuilder} that this Layout implementation can use to write the formatted log event to.
@@ -46,12 +46,11 @@ public class Wire {
      * @return a {@code StringBuilder}
      */
     private static StringBuilder getStringBuilder() {
-        StringBuilder result = threadLocal.get();
+        StringBuilder result = THREAD_LOCAL.get();
         if (result == null) {
             result = new StringBuilder(MAX_STRING_BUILDER_SIZE);
-            threadLocal.set(result);
+            THREAD_LOCAL.set(result);
         }
-        // TODO Delegate to Log4j's 2.9 StringBuilds.trimToMaxSize() when it is released.
         trimToMaxSize(result, MAX_STRING_BUILDER_SIZE);
         result.setLength(0);
         return result;
@@ -64,7 +63,6 @@ public class Wire {
      * @param stringBuilder the StringBuilder to check
      * @param maxSize the maximum number of characters the StringBuilder is allowed to have
      */
-    // TODO Delete wheb Log4j's 2.9 (see #trimToMaxSize(StringBuild))
     private static void trimToMaxSize(final StringBuilder stringBuilder, final int maxSize) {
         if (stringBuilder != null && stringBuilder.capacity() > maxSize) {
             stringBuilder.setLength(maxSize);
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AbstractMinimalHttpAsyncClientBase.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AbstractMinimalHttpAsyncClientBase.java
index 4b927ab..9058a96 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AbstractMinimalHttpAsyncClientBase.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AbstractMinimalHttpAsyncClientBase.java
@@ -54,7 +54,7 @@ abstract class AbstractMinimalHttpAsyncClientBase extends AbstractHttpAsyncClien
 
     @Override
     protected <T> Future<T> doExecute(
-            final HttpHost httphost,
+            final HttpHost httpHost,
             final AsyncRequestProducer requestProducer,
             final AsyncResponseConsumer<T> responseConsumer,
             final HandlerFactory<AsyncPushConsumer> pushHandlerFactory,
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 13ddb63..250f44a 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
@@ -65,7 +65,7 @@ import org.apache.hc.client5.http.impl.auth.KerberosSchemeFactory;
 import org.apache.hc.client5.http.impl.auth.NTLMSchemeFactory;
 import org.apache.hc.client5.http.impl.auth.SPNegoSchemeFactory;
 import org.apache.hc.client5.http.impl.auth.SystemDefaultCredentialsProvider;
-import org.apache.hc.client5.http.impl.nio.MultuhomeConnectionInitiator;
+import org.apache.hc.client5.http.impl.nio.MultihomeConnectionInitiator;
 import org.apache.hc.client5.http.impl.routing.DefaultRoutePlanner;
 import org.apache.hc.client5.http.protocol.RedirectStrategy;
 import org.apache.hc.client5.http.protocol.RequestAddCookies;
@@ -800,7 +800,7 @@ public class H2AsyncClientBuilder {
             }
         }
 
-        final MultuhomeConnectionInitiator connectionInitiator = new MultuhomeConnectionInitiator(ioReactor, dnsResolver);
+        final MultihomeConnectionInitiator connectionInitiator = new MultihomeConnectionInitiator(ioReactor, dnsResolver);
         final H2ConnPool connPool = new H2ConnPool(connectionInitiator, new Resolver<HttpHost, InetSocketAddress>() {
 
             @Override
@@ -863,7 +863,7 @@ public class H2AsyncClientBuilder {
                 public void run() {
                     try {
                         while (!Thread.currentThread().isInterrupted()) {
-                            Thread.sleep(maxIdleTime.toMillis());
+                            maxIdleTime.sleep();
                             connPool.closeIdle(maxIdleTime);
                         }
                     } catch (final InterruptedException ex) {
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncMainClientExec.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncMainClientExec.java
index f09b51f..9299a8a 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncMainClientExec.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncMainClientExec.java
@@ -66,7 +66,7 @@ import org.slf4j.LoggerFactory;
 /**
  * Usually the last HTTP/1.1 request execution handler in the asynchronous
  * request execution chain that is responsible for execution of
- * request / response exchanges with the opposite endpoint.
+ * request/response exchanges with the opposite endpoint.
  *
  * @since 5.0
  */
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalHttpAsyncClient.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalHttpAsyncClient.java
index 07882c1..48289b9 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalHttpAsyncClient.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalHttpAsyncClient.java
@@ -68,7 +68,7 @@ import org.apache.hc.core5.reactor.DefaultConnectingIOReactor;
 @Internal
 public final class InternalHttpAsyncClient extends InternalAbstractHttpAsyncClient {
 
-    private final AsyncClientConnectionManager connmgr;
+    private final AsyncClientConnectionManager manager;
     private final HttpRoutePlanner routePlanner;
     private final HttpVersionPolicy versionPolicy;
 
@@ -77,7 +77,7 @@ public final class InternalHttpAsyncClient extends InternalAbstractHttpAsyncClie
             final AsyncExecChainElement execChain,
             final AsyncPushConsumerRegistry pushConsumerRegistry,
             final ThreadFactory threadFactory,
-            final AsyncClientConnectionManager connmgr,
+            final AsyncClientConnectionManager manager,
             final HttpRoutePlanner routePlanner,
             final HttpVersionPolicy versionPolicy,
             final Lookup<CookieSpecProvider> cookieSpecRegistry,
@@ -88,14 +88,14 @@ public final class InternalHttpAsyncClient extends InternalAbstractHttpAsyncClie
             final List<Closeable> closeables) {
         super(ioReactor, pushConsumerRegistry, threadFactory, execChain,
                 cookieSpecRegistry, authSchemeRegistry, cookieStore, credentialsProvider, defaultConfig, closeables);
-        this.connmgr = connmgr;
+        this.manager = manager;
         this.routePlanner = routePlanner;
         this.versionPolicy = versionPolicy;
     }
 
     @Override
     AsyncExecRuntime createAsyncExecRuntime(final HandlerFactory<AsyncPushConsumer> pushHandlerFactory) {
-        return new InternalHttpAsyncExecRuntime(log, connmgr, getConnectionInitiator(), pushHandlerFactory, versionPolicy);
+        return new InternalHttpAsyncExecRuntime(log, manager, getConnectionInitiator(), pushHandlerFactory, versionPolicy);
     }
 
     @Override
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalH2AsyncClient.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalH2AsyncClient.java
index 5147426..bd4a35d 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalH2AsyncClient.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalH2AsyncClient.java
@@ -39,7 +39,7 @@ import org.apache.hc.client5.http.config.RequestConfig;
 import org.apache.hc.client5.http.impl.ConnPoolSupport;
 import org.apache.hc.client5.http.impl.ExecSupport;
 import org.apache.hc.client5.http.impl.classic.RequestFailedException;
-import org.apache.hc.client5.http.impl.nio.MultuhomeConnectionInitiator;
+import org.apache.hc.client5.http.impl.nio.MultihomeConnectionInitiator;
 import org.apache.hc.client5.http.protocol.HttpClientContext;
 import org.apache.hc.core5.annotation.Contract;
 import org.apache.hc.core5.annotation.ThreadingBehavior;
@@ -118,7 +118,7 @@ public final class MinimalH2AsyncClient extends AbstractMinimalHttpAsyncClientBa
                 }),
                 pushConsumerRegistry,
                 threadFactory);
-        this.connectionInitiator = new MultuhomeConnectionInitiator(getConnectionInitiator(), dnsResolver);
+        this.connectionInitiator = new MultihomeConnectionInitiator(getConnectionInitiator(), dnsResolver);
         this.connPool = new H2ConnPool(this.connectionInitiator, new Resolver<HttpHost, InetSocketAddress>() {
 
             @Override
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalHttpAsyncClient.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalHttpAsyncClient.java
index fc93999..e74cf3d 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalHttpAsyncClient.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/MinimalHttpAsyncClient.java
@@ -98,7 +98,7 @@ import org.apache.hc.core5.util.Timeout;
 @Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
 public final class MinimalHttpAsyncClient extends AbstractMinimalHttpAsyncClientBase {
 
-    private final AsyncClientConnectionManager connmgr;
+    private final AsyncClientConnectionManager manager;
     private final SchemePortResolver schemePortResolver;
     private final HttpVersionPolicy versionPolicy;
 
@@ -109,7 +109,7 @@ public final class MinimalHttpAsyncClient extends AbstractMinimalHttpAsyncClient
             final IOReactorConfig reactorConfig,
             final ThreadFactory threadFactory,
             final ThreadFactory workerThreadFactory,
-            final AsyncClientConnectionManager connmgr,
+            final AsyncClientConnectionManager manager,
             final SchemePortResolver schemePortResolver) {
         super(new DefaultConnectingIOReactor(
                 eventHandlerFactory,
@@ -128,7 +128,7 @@ public final class MinimalHttpAsyncClient extends AbstractMinimalHttpAsyncClient
                 }),
                 pushConsumerRegistry,
                 threadFactory);
-        this.connmgr = connmgr;
+        this.manager = manager;
         this.schemePortResolver = schemePortResolver != null ? schemePortResolver : DefaultSchemePortResolver.INSTANCE;
         this.versionPolicy = versionPolicy != null ? versionPolicy : HttpVersionPolicy.NEGOTIATE;
     }
@@ -142,7 +142,7 @@ public final class MinimalHttpAsyncClient extends AbstractMinimalHttpAsyncClient
         final HttpRoute route = new HttpRoute(RoutingSupport.normalize(host, schemePortResolver));
         final ComplexFuture<AsyncConnectionEndpoint> resultFuture = new ComplexFuture<>(callback);
         final String exchangeId = ExecSupport.getNextExchangeId();
-        final Future<AsyncConnectionEndpoint> leaseFuture = connmgr.lease(
+        final Future<AsyncConnectionEndpoint> leaseFuture = manager.lease(
                 exchangeId,
                 route,
                 null,
@@ -154,7 +154,7 @@ public final class MinimalHttpAsyncClient extends AbstractMinimalHttpAsyncClient
                         if (connectionEndpoint.isConnected()) {
                             resultFuture.completed(connectionEndpoint);
                         } else {
-                            final Future<AsyncConnectionEndpoint> connectFuture = connmgr.connect(
+                            final Future<AsyncConnectionEndpoint> connectFuture = manager.connect(
                                     connectionEndpoint,
                                     getConnectionInitiator(),
                                     connectTimeout,
@@ -478,7 +478,7 @@ public final class MinimalHttpAsyncClient extends AbstractMinimalHttpAsyncClient
         @Override
         public void releaseAndReuse() {
             if (released.compareAndSet(false, true)) {
-                connmgr.release(connectionEndpoint, null, TimeValue.NEG_ONE_MILLISECONDS);
+                manager.release(connectionEndpoint, null, TimeValue.NEG_ONE_MILLISECONDS);
             }
         }
 
@@ -486,7 +486,7 @@ public final class MinimalHttpAsyncClient extends AbstractMinimalHttpAsyncClient
         public void releaseAndDiscard() {
             if (released.compareAndSet(false, true)) {
                 Closer.closeQuietly(connectionEndpoint);
-                connmgr.release(connectionEndpoint, null, TimeValue.ZERO_MILLISECONDS);
+                manager.release(connectionEndpoint, null, TimeValue.ZERO_MILLISECONDS);
             }
         }
 
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/BasicCredentialsProvider.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/BasicCredentialsProvider.java
index 26465ca..579d8b2 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/BasicCredentialsProvider.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/BasicCredentialsProvider.java
@@ -57,32 +57,32 @@ public class BasicCredentialsProvider implements CredentialsStore {
 
     @Override
     public void setCredentials(
-            final AuthScope authscope,
+            final AuthScope authScope,
             final Credentials credentials) {
-        Args.notNull(authscope, "Authentication scope");
-        credMap.put(authscope, credentials);
+        Args.notNull(authScope, "Authentication scope");
+        credMap.put(authScope, credentials);
     }
 
     /**
      * Find matching {@link Credentials credentials} for the given authentication scope.
      *
      * @param map the credentials hash map
-     * @param authscope the {@link AuthScope authentication scope}
+     * @param authScope the {@link AuthScope authentication scope}
      * @return the credentials
      *
      */
     private static Credentials matchCredentials(
             final Map<AuthScope, Credentials> map,
-            final AuthScope authscope) {
+            final AuthScope authScope) {
         // see if we get a direct hit
-        Credentials creds = map.get(authscope);
+        Credentials creds = map.get(authScope);
         if (creds == null) {
             // Nope.
             // Do a full scan
             int bestMatchFactor  = -1;
             AuthScope bestMatch  = null;
             for (final AuthScope current: map.keySet()) {
-                final int factor = authscope.match(current);
+                final int factor = authScope.match(current);
                 if (factor > bestMatchFactor) {
                     bestMatchFactor = factor;
                     bestMatch = current;
@@ -96,10 +96,10 @@ public class BasicCredentialsProvider implements CredentialsStore {
     }
 
     @Override
-    public Credentials getCredentials(final AuthScope authscope,
+    public Credentials getCredentials(final AuthScope authScope,
                                       final HttpContext httpContext) {
-        Args.notNull(authscope, "Authentication scope");
-        return matchCredentials(this.credMap, authscope);
+        Args.notNull(authScope, "Authentication scope");
+        return matchCredentials(this.credMap, authScope);
     }
 
     @Override
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/SystemDefaultCredentialsProvider.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/SystemDefaultCredentialsProvider.java
index a4c0b0e..b338c2d 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/SystemDefaultCredentialsProvider.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/SystemDefaultCredentialsProvider.java
@@ -88,13 +88,13 @@ public class SystemDefaultCredentialsProvider implements CredentialsStore {
     }
 
     @Override
-    public void setCredentials(final AuthScope authscope, final Credentials credentials) {
-        internal.setCredentials(authscope, credentials);
+    public void setCredentials(final AuthScope authScope, final Credentials credentials) {
+        internal.setCredentials(authScope, credentials);
     }
 
     private static PasswordAuthentication getSystemCreds(
             final String protocol,
-            final AuthScope authscope,
+            final AuthScope authScope,
             final Authenticator.RequestorType requestorType,
             final HttpClientContext context) {
         final HttpRequest request = context != null ? context.getRequest() : null;
@@ -107,41 +107,41 @@ public class SystemDefaultCredentialsProvider implements CredentialsStore {
         }
         // use null addr, because the authentication fails if it does not exactly match the expected realm's host
         return Authenticator.requestPasswordAuthentication(
-                authscope.getHost(),
+                authScope.getHost(),
                 null,
-                authscope.getPort(),
+                authScope.getPort(),
                 protocol,
-                authscope.getRealm(),
-                translateAuthScheme(authscope.getAuthScheme()),
+                authScope.getRealm(),
+                translateAuthScheme(authScope.getAuthScheme()),
                 targetHostURL,
                 requestorType);
     }
 
     @Override
-    public Credentials getCredentials(final AuthScope authscope, final HttpContext context) {
-        Args.notNull(authscope, "Auth scope");
-        final Credentials localcreds = internal.getCredentials(authscope, context);
+    public Credentials getCredentials(final AuthScope authScope, final HttpContext context) {
+        Args.notNull(authScope, "Auth scope");
+        final Credentials localcreds = internal.getCredentials(authScope, context);
         if (localcreds != null) {
             return localcreds;
         }
-        final String host = authscope.getHost();
+        final String host = authScope.getHost();
         if (host != null) {
             final HttpClientContext clientContext = context != null ? HttpClientContext.adapt(context) : null;
-            final String protocol = authscope.getProtocol() != null ? authscope.getProtocol() : (authscope.getPort() == 443 ? URIScheme.HTTPS.id : URIScheme.HTTP.id);
+            final String protocol = authScope.getProtocol() != null ? authScope.getProtocol() : (authScope.getPort() == 443 ? URIScheme.HTTPS.id : URIScheme.HTTP.id);
             PasswordAuthentication systemcreds = getSystemCreds(
-                    protocol, authscope, Authenticator.RequestorType.SERVER, clientContext);
+                    protocol, authScope, Authenticator.RequestorType.SERVER, clientContext);
             if (systemcreds == null) {
                 systemcreds = getSystemCreds(
-                        protocol, authscope, Authenticator.RequestorType.PROXY, clientContext);
+                        protocol, authScope, Authenticator.RequestorType.PROXY, clientContext);
             }
             if (systemcreds == null) {
                 // Look for values given using http.proxyUser/http.proxyPassword or
                 // https.proxyUser/https.proxyPassword. We cannot simply use the protocol from
                 // the origin since a proxy retrieved from https.proxyHost/https.proxyPort will
                 // still use http as protocol
-                systemcreds = getProxyCredentials("http", authscope);
+                systemcreds = getProxyCredentials("http", authScope);
                 if (systemcreds == null) {
-                    systemcreds = getProxyCredentials("https", authscope);
+                    systemcreds = getProxyCredentials("https", authScope);
                 }
             }
             if (systemcreds != null) {
@@ -149,7 +149,7 @@ public class SystemDefaultCredentialsProvider implements CredentialsStore {
                 if (domain != null) {
                     return new NTCredentials(systemcreds.getUserName(), systemcreds.getPassword(), null, domain);
                 }
-                if (AuthSchemes.NTLM.ident.equalsIgnoreCase(authscope.getAuthScheme())) {
+                if (AuthSchemes.NTLM.ident.equalsIgnoreCase(authScope.getAuthScheme())) {
                     // Domain may be specified in a fully qualified user name
                     return new NTCredentials(
                             systemcreds.getUserName(), systemcreds.getPassword(), null, null);
@@ -160,7 +160,7 @@ public class SystemDefaultCredentialsProvider implements CredentialsStore {
         return null;
     }
 
-    private static PasswordAuthentication getProxyCredentials(final String protocol, final AuthScope authscope) {
+    private static PasswordAuthentication getProxyCredentials(final String protocol, final AuthScope authScope) {
         final String proxyHost = System.getProperty(protocol + ".proxyHost");
         if (proxyHost == null) {
             return null;
@@ -172,7 +172,7 @@ public class SystemDefaultCredentialsProvider implements CredentialsStore {
 
         try {
             final AuthScope systemScope = new AuthScope(proxyHost, Integer.parseInt(proxyPort));
-            if (authscope.match(systemScope) >= 0) {
+            if (authScope.match(systemScope) >= 0) {
                 final String proxyUser = System.getProperty(protocol + ".proxyUser");
                 if (proxyUser == null) {
                     return null;
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/AIMDBackoffManager.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/AIMDBackoffManager.java
index c662e13..5341826 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/AIMDBackoffManager.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/AIMDBackoffManager.java
@@ -60,8 +60,8 @@ public class AIMDBackoffManager implements BackoffManager {
 
     private final ConnPoolControl<HttpRoute> connPerRoute;
     private final Clock clock;
-    private final Map<HttpRoute,Long> lastRouteProbes;
-    private final Map<HttpRoute,Long> lastRouteBackoffs;
+    private final Map<HttpRoute, Long> lastRouteProbes;
+    private final Map<HttpRoute, Long> lastRouteBackoffs;
     private long coolDown = 5 * 1000L;
     private double backoffFactor = 0.5;
     private int cap = 2; // Per RFC 2616 sec 8.1.4
@@ -121,7 +121,7 @@ public class AIMDBackoffManager implements BackoffManager {
         }
     }
 
-    private Long getLastUpdate(final Map<HttpRoute,Long> updates, final HttpRoute route) {
+    private Long getLastUpdate(final Map<HttpRoute, Long> updates, final HttpRoute route) {
         Long lastUpdate = updates.get(route);
         if (lastUpdate == null) {
             lastUpdate = Long.valueOf(0L);
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/DefaultBackoffStrategy.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/DefaultBackoffStrategy.java
index 86c7af3..9ade7ea 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/DefaultBackoffStrategy.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/DefaultBackoffStrategy.java
@@ -50,9 +50,9 @@ public class DefaultBackoffStrategy implements ConnectionBackoffStrategy {
     }
 
     @Override
-    public boolean shouldBackoff(final HttpResponse resp) {
-        return resp.getCode() == HttpStatus.SC_TOO_MANY_REQUESTS ||
-            resp.getCode() == HttpStatus.SC_SERVICE_UNAVAILABLE;
+    public boolean shouldBackoff(final HttpResponse response) {
+        return response.getCode() == HttpStatus.SC_TOO_MANY_REQUESTS ||
+            response.getCode() == HttpStatus.SC_SERVICE_UNAVAILABLE;
     }
 
 }
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/NullBackoffStrategy.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/NullBackoffStrategy.java
index 36440aa..402af48 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/NullBackoffStrategy.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/NullBackoffStrategy.java
@@ -43,7 +43,7 @@ public class NullBackoffStrategy implements ConnectionBackoffStrategy {
     }
 
     @Override
-    public boolean shouldBackoff(final HttpResponse resp) {
+    public boolean shouldBackoff(final HttpResponse response) {
         return false;
     }
 }
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/MultuhomeConnectionInitiator.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/MultihomeConnectionInitiator.java
similarity index 96%
rename from httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/MultuhomeConnectionInitiator.java
rename to httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/MultihomeConnectionInitiator.java
index 3ea9718..2e8e00b 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/MultuhomeConnectionInitiator.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/MultihomeConnectionInitiator.java
@@ -46,12 +46,12 @@ import org.apache.hc.core5.util.Timeout;
  * @since 5.0
  */
 @Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
-public final class MultuhomeConnectionInitiator implements ConnectionInitiator {
+public final class MultihomeConnectionInitiator implements ConnectionInitiator {
 
     private final ConnectionInitiator connectionInitiator;
     private final MultihomeIOSessionRequester sessionRequester;
 
-    public MultuhomeConnectionInitiator(
+    public MultihomeConnectionInitiator(
             final ConnectionInitiator connectionInitiator,
             final DnsResolver dnsResolver) {
         this.connectionInitiator = Args.notNull(connectionInitiator, "Connection initiator");
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixListParser.java b/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixListParser.java
index 9619d5d..e943f1f 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixListParser.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixListParser.java
@@ -102,7 +102,6 @@ public final class PublicSuffixListParser {
         final List<PublicSuffixList> result = new ArrayList<>(2);
 
         final BufferedReader r = new BufferedReader(reader);
-        final StringBuilder sb = new StringBuilder(256);
 
         DomainType domainType = null;
         List<String> rules = null;
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/socket/ConnectionSocketFactory.java b/httpclient5/src/main/java/org/apache/hc/client5/http/socket/ConnectionSocketFactory.java
index edb510b..88cafd0 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/socket/ConnectionSocketFactory.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/socket/ConnectionSocketFactory.java
@@ -60,7 +60,7 @@ public interface ConnectionSocketFactory {
      * Connects the socket to the target host with the given resolved remote address.
      *
      * @param connectTimeout connect timeout.
-     * @param sock the socket to connect, as obtained from {@link #createSocket(HttpContext)}.
+     * @param socket the socket to connect, as obtained from {@link #createSocket(HttpContext)}.
      * {@code null} indicates that a new socket should be created and connected.
      * @param host target host as specified by the caller (end user).
      * @param remoteAddress the resolved remote address to connect to.
@@ -75,7 +75,7 @@ public interface ConnectionSocketFactory {
      */
     Socket connectSocket(
         TimeValue connectTimeout,
-        Socket sock,
+        Socket socket,
         HttpHost host,
         InetSocketAddress remoteAddress,
         InetSocketAddress localAddress,
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java b/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java
index 741f016..d3be931 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java
@@ -121,7 +121,7 @@ public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactor
         return false;
     }
 
-    private final javax.net.ssl.SSLSocketFactory socketfactory;
+    private final javax.net.ssl.SSLSocketFactory socketFactory;
     private final HostnameVerifier hostnameVerifier;
     private final String[] supportedProtocols;
     private final String[] supportedCipherSuites;
@@ -156,20 +156,20 @@ public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactor
      * @since 4.4
      */
     public SSLConnectionSocketFactory(
-            final javax.net.ssl.SSLSocketFactory socketfactory,
+            final javax.net.ssl.SSLSocketFactory socketFactory,
             final HostnameVerifier hostnameVerifier) {
-        this(socketfactory, null, null, hostnameVerifier);
+        this(socketFactory, null, null, hostnameVerifier);
     }
 
     /**
      * @since 4.4
      */
     public SSLConnectionSocketFactory(
-            final javax.net.ssl.SSLSocketFactory socketfactory,
+            final javax.net.ssl.SSLSocketFactory socketFactory,
             final String[] supportedProtocols,
             final String[] supportedCipherSuites,
             final HostnameVerifier hostnameVerifier) {
-        this.socketfactory = Args.notNull(socketfactory, "SSL socket factory");
+        this.socketFactory = Args.notNull(socketFactory, "SSL socket factory");
         this.supportedProtocols = supportedProtocols;
         this.supportedCipherSuites = supportedCipherSuites;
         this.hostnameVerifier = hostnameVerifier != null ? hostnameVerifier : HttpsSupport.getDefaultHostnameVerifier();
@@ -250,7 +250,7 @@ public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactor
             final String target,
             final int port,
             final HttpContext context) throws IOException {
-        final SSLSocket sslsock = (SSLSocket) this.socketfactory.createSocket(
+        final SSLSocket sslsock = (SSLSocket) this.socketFactory.createSocket(
                 socket,
                 target,
                 port,
@@ -310,8 +310,8 @@ public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactor
 
     protected void verifySession(
             final String hostname,
-            final SSLSession sslsession) throws SSLException {
-        tlsSessionValidator.verifySession(hostname, sslsession, hostnameVerifier);
+            final SSLSession sslSession) throws SSLException {
+        tlsSessionValidator.verifySession(hostname, sslSession, hostnameVerifier);
     }
 
 }
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactoryBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactoryBuilder.java
index 2310c30..f31d78d 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactoryBuilder.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactoryBuilder.java
@@ -125,14 +125,14 @@ public class SSLConnectionSocketFactoryBuilder {
     }
 
     public SSLConnectionSocketFactory build() {
-        final javax.net.ssl.SSLSocketFactory socketfactory;
+        final javax.net.ssl.SSLSocketFactory socketFactory;
         if (sslContext != null) {
-            socketfactory = sslContext.getSocketFactory();
+            socketFactory = sslContext.getSocketFactory();
         } else {
             if (systemProperties) {
-                socketfactory = (javax.net.ssl.SSLSocketFactory) javax.net.ssl.SSLSocketFactory.getDefault();
+                socketFactory = (javax.net.ssl.SSLSocketFactory) javax.net.ssl.SSLSocketFactory.getDefault();
             } else {
-                socketfactory = SSLContexts.createDefault().getSocketFactory();
+                socketFactory = SSLContexts.createDefault().getSocketFactory();
             }
         }
         final String[] tlsVersionsCopy;
@@ -148,7 +148,7 @@ public class SSLConnectionSocketFactoryBuilder {
             ciphersCopy = systemProperties ? HttpsSupport.getSystemCipherSuits() : null;
         }
         return new SSLConnectionSocketFactory(
-                socketfactory,
+                socketFactory,
                 tlsVersionsCopy,
                 ciphersCopy,
                 hostnameVerifier != null ? hostnameVerifier : HttpsSupport.getDefaultHostnameVerifier());
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java b/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java
index b8688e2..bf53275 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java
@@ -163,7 +163,7 @@ public class URIUtils {
      * @param reference the URI reference
      * @return the resulting URI
      */
-    public static URI resolve(final URI baseURI, final URI reference){
+    public static URI resolve(final URI baseURI, final URI reference) {
         Args.notNull(baseURI, "Base URI");
         Args.notNull(reference, "Reference URI");
         final String s = reference.toASCIIString();
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java
index e65dcd8..9158afc 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java
@@ -117,7 +117,7 @@ public class TestEntityBuilder {
 
     @Test
     public void testBuildGZipped() throws Exception {
-        final HttpEntity entity = EntityBuilder.create().setText("stuff").gzipCompress().build();
+        final HttpEntity entity = EntityBuilder.create().setText("stuff").gzipCompressed().build();
         Assert.assertNotNull(entity);
         Assert.assertNotNull(entity.getContentType());
         Assert.assertEquals("text/plain; charset=ISO-8859-1", entity.getContentType());