diff --git a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/ConsumableInputStream.java b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/ConsumableInputStream.java index 450602096..a6de12aa0 100644 --- a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/ConsumableInputStream.java +++ b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/ConsumableInputStream.java @@ -35,7 +35,7 @@ import org.apache.hc.core5.io.Closer; public class ConsumableInputStream extends InputStream { private final ByteArrayInputStream buf; - private boolean closed = false; + private boolean closed; public ConsumableInputStream(final ByteArrayInputStream buf) { this.buf = buf; diff --git a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/DummyBackend.java b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/DummyBackend.java index 50b49cd3d..4694e381a 100644 --- a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/DummyBackend.java +++ b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/DummyBackend.java @@ -40,7 +40,7 @@ public class DummyBackend implements ExecChain { private ClassicHttpRequest request; private ClassicHttpResponse response = new BasicClassicHttpResponse(HttpStatus.SC_OK, "OK"); - private int executions = 0; + private int executions; public void setResponse(final ClassicHttpResponse resp) { response = resp; diff --git a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestCachingExecChain.java b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestCachingExecChain.java index eb5616536..edbe9b814 100644 --- a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestCachingExecChain.java +++ b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestCachingExecChain.java @@ -1207,7 +1207,7 @@ public abstract class TestCachingExecChain { final ClassicHttpResponse resp1 = new BasicClassicHttpResponse(HttpStatus.SC_OK, "OK"); resp1.setEntity(new InputStreamEntity(new InputStream() { - private boolean closed = false; + private boolean closed; @Override public void close() throws IOException { diff --git a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestContentCodings.java b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestContentCodings.java index df37bd932..a07425997 100644 --- a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestContentCodings.java +++ b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestContentCodings.java @@ -397,7 +397,7 @@ public class TestContentCodings extends LocalServerTestBase { private final CountDownLatch startGate; private final CountDownLatch endGate; - private boolean failed = false; + private boolean failed; private String text; WorkerTask(final CloseableHttpClient client, final HttpHost target, final boolean identity, final CountDownLatch startGate, final CountDownLatch endGate) { diff --git a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestSSLSocketFactory.java b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestSSLSocketFactory.java index 082f621b2..65e47d92e 100644 --- a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestSSLSocketFactory.java +++ b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestSSLSocketFactory.java @@ -79,7 +79,7 @@ public class TestSSLSocketFactory { static class TestX509HostnameVerifier implements HostnameVerifier { - private boolean fired = false; + private boolean fired; @Override public boolean verify(final String host, final SSLSession session) { diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/DeflateInputStream.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/DeflateInputStream.java index dc8d5a45a..66ef7e402 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/DeflateInputStream.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/DeflateInputStream.java @@ -138,7 +138,7 @@ public class DeflateInputStream extends InputStream { static class DeflateStream extends InflaterInputStream { - private boolean closed = false; + private boolean closed; public DeflateStream(final InputStream in, final Inflater inflater) { super(in, inflater); diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartEntityBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartEntityBuilder.java index 8ed0b44f0..dfeadedcd 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartEntityBuilder.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartEntityBuilder.java @@ -59,9 +59,9 @@ public class MultipartEntityBuilder { private ContentType contentType; private HttpMultipartMode mode = HttpMultipartMode.STRICT; - private String boundary = null; - private Charset charset = null; - private List multipartParts = null; + private String boundary; + private Charset charset; + private List multipartParts; public static MultipartEntityBuilder create() { return new MultipartEntityBuilder(); diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/NTLMEngineImpl.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/NTLMEngineImpl.java index 50922265a..85e6320d0 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/NTLMEngineImpl.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/NTLMEngineImpl.java @@ -332,22 +332,22 @@ final class NTLMEngineImpl implements NTLMEngine { byte[] timestamp; // Stuff we always generate - byte[] lmHash = null; - byte[] lmResponse = null; - byte[] ntlmHash = null; - byte[] ntlmResponse = null; - byte[] ntlmv2Hash = null; - byte[] lmv2Hash = null; - byte[] lmv2Response = null; - byte[] ntlmv2Blob = null; - byte[] ntlmv2Response = null; - byte[] ntlm2SessionResponse = null; - byte[] lm2SessionResponse = null; - byte[] lmUserSessionKey = null; - byte[] ntlmUserSessionKey = null; - byte[] ntlmv2UserSessionKey = null; - byte[] ntlm2SessionResponseUserSessionKey = null; - byte[] lanManagerSessionKey = null; + byte[] lmHash; + byte[] lmResponse; + byte[] ntlmHash; + byte[] ntlmResponse; + byte[] ntlmv2Hash; + byte[] lmv2Hash; + byte[] lmv2Response; + byte[] ntlmv2Blob; + byte[] ntlmv2Response; + byte[] ntlm2SessionResponse; + byte[] lm2SessionResponse; + byte[] lmUserSessionKey; + byte[] ntlmUserSessionKey; + byte[] ntlmv2UserSessionKey; + byte[] ntlm2SessionResponseUserSessionKey; + byte[] lanManagerSessionKey; public CipherGen(final Random random, final long currentTime, final String domain, final String user, final char[] password, @@ -808,7 +808,7 @@ final class NTLMEngineImpl implements NTLMEngine { private final Cipher rc4; final Mode mode; final private boolean isConnection; - int sequenceNumber = 0; + int sequenceNumber; Handle( final byte[] exportedSessionKey, final Mode mode, final boolean isConnection ) throws NTLMEngineException @@ -1080,10 +1080,10 @@ final class NTLMEngineImpl implements NTLMEngine { /** NTLM message generation, base class */ static class NTLMMessage { /** The current response */ - byte[] messageContents = null; + byte[] messageContents; /** The current output position */ - int currentOutputPosition = 0; + int currentOutputPosition; /** Constructor to use when message contents are not yet known */ NTLMMessage() { @@ -1862,7 +1862,7 @@ final class NTLMEngineImpl implements NTLMEngine { int B = 0xefcdab89; int C = 0x98badcfe; int D = 0x10325476; - long count = 0L; + long count; final byte[] dataBuffer = new byte[64]; MD4() { diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/RequestEntityProxy.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/RequestEntityProxy.java index e7e4835ed..c6d46b205 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/RequestEntityProxy.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/RequestEntityProxy.java @@ -51,7 +51,7 @@ class RequestEntityProxy implements HttpEntity { } private final HttpEntity original; - private boolean consumed = false; + private boolean consumed; RequestEntityProxy(final HttpEntity original) { super(); diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManagerBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManagerBuilder.java index 955c3e746..121127e76 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManagerBuilder.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManagerBuilder.java @@ -80,8 +80,8 @@ public class PoolingHttpClientConnectionManagerBuilder { private boolean systemProperties; - private int maxConnTotal = 0; - private int maxConnPerRoute = 0; + private int maxConnTotal; + private int maxConnPerRoute; private TimeValue timeToLive; private TimeValue validateAfterInactivity; diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManagerBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManagerBuilder.java index ad390b65c..cafe7e41a 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManagerBuilder.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManagerBuilder.java @@ -74,8 +74,8 @@ public class PoolingAsyncClientConnectionManagerBuilder { private boolean systemProperties; - private int maxConnTotal = 0; - private int maxConnPerRoute = 0; + private int maxConnTotal; + private int maxConnPerRoute; private TimeValue timeToLive; private TimeValue validateAfterInactivity;