Don't initialize AtomicReference to its default value.

This commit is contained in:
Gary Gregory 2021-10-11 11:41:23 -04:00 committed by Oleg Kalnichevski
parent 4dd7cefbde
commit b6ae693fe5
10 changed files with 10 additions and 10 deletions

View File

@ -120,7 +120,7 @@ class DefaultAsyncCacheRevalidator extends CacheRevalidatorBase {
final RevalidationCall call) { final RevalidationCall call) {
scheduleRevalidation(cacheKey, () -> call.execute(new AsyncExecCallback() { scheduleRevalidation(cacheKey, () -> call.execute(new AsyncExecCallback() {
private final AtomicReference<HttpResponse> responseRef = new AtomicReference<>(null); private final AtomicReference<HttpResponse> responseRef = new AtomicReference<>();
@Override @Override
public AsyncDataConsumer handleResponse( public AsyncDataConsumer handleResponse(

View File

@ -61,7 +61,7 @@ public class AsyncEchoHandler implements AsyncServerExchangeHandler {
public AsyncEchoHandler() { public AsyncEchoHandler() {
this.entityConsumer = new BasicAsyncEntityConsumer(); this.entityConsumer = new BasicAsyncEntityConsumer();
this.entityProducerRef = new AtomicReference<>(null); this.entityProducerRef = new AtomicReference<>();
} }
@Override @Override

View File

@ -63,7 +63,7 @@ public class AsyncRandomHandler implements AsyncServerExchangeHandler {
private final AtomicReference<AsyncEntityProducer> entityProducerRef; private final AtomicReference<AsyncEntityProducer> entityProducerRef;
public AsyncRandomHandler() { public AsyncRandomHandler() {
this.entityProducerRef = new AtomicReference<>(null); this.entityProducerRef = new AtomicReference<>();
} }
@Override @Override

View File

@ -65,7 +65,7 @@ public class AuthenticatingAsyncDecorator implements AsyncServerExchangeHandler
public AuthenticatingAsyncDecorator(final AsyncServerExchangeHandler exchangeHandler, final Authenticator authenticator) { public AuthenticatingAsyncDecorator(final AsyncServerExchangeHandler exchangeHandler, final Authenticator authenticator) {
this.exchangeHandler = Args.notNull(exchangeHandler, "Request handler"); this.exchangeHandler = Args.notNull(exchangeHandler, "Request handler");
this.authenticator = Args.notNull(authenticator, "Authenticator"); this.authenticator = Args.notNull(authenticator, "Authenticator");
this.responseProducerRef = new AtomicReference<>(null); this.responseProducerRef = new AtomicReference<>();
this.authTokenExtractor = new BasicAuthTokenExtractor(); this.authTokenExtractor = new BasicAuthTokenExtractor();
} }

View File

@ -299,7 +299,7 @@ public abstract class AbstractHttpReactiveFundamentalsTest<T extends CloseableHt
while (testCases.size() < numTestCases) { while (testCases.size() < numTestCases) {
final long seed = 198723L * testCaseNum++; final long seed = 198723L * testCaseNum++;
final int length = 1 + new Random(seed).nextInt(maxSize); final int length = 1 + new Random(seed).nextInt(maxSize);
final AtomicReference<String> expectedHash = new AtomicReference<>(null); final AtomicReference<String> expectedHash = new AtomicReference<>();
final Flowable<ByteBuffer> stream = ReactiveTestUtils.produceStream(length, expectedHash); final Flowable<ByteBuffer> stream = ReactiveTestUtils.produceStream(length, expectedHash);
final StreamingTestCase streamingTestCase = new StreamingTestCase(length, expectedHash, stream); final StreamingTestCase streamingTestCase = new StreamingTestCase(length, expectedHash, stream);
testCases.put((long) length, streamingTestCase); testCases.put((long) length, streamingTestCase);

View File

@ -88,7 +88,7 @@ public class H2AsyncMainClientExec implements AsyncExecChainHandler {
final AsyncClientExchangeHandler internalExchangeHandler = new AsyncClientExchangeHandler() { final AsyncClientExchangeHandler internalExchangeHandler = new AsyncClientExchangeHandler() {
private final AtomicReference<AsyncDataConsumer> entityConsumerRef = new AtomicReference<>(null); private final AtomicReference<AsyncDataConsumer> entityConsumerRef = new AtomicReference<>();
@Override @Override
public void releaseResources() { public void releaseResources() {

View File

@ -104,7 +104,7 @@ class HttpAsyncMainClientExec implements AsyncExecChainHandler {
final AtomicInteger messageCountDown = new AtomicInteger(2); final AtomicInteger messageCountDown = new AtomicInteger(2);
final AsyncClientExchangeHandler internalExchangeHandler = new AsyncClientExchangeHandler() { final AsyncClientExchangeHandler internalExchangeHandler = new AsyncClientExchangeHandler() {
private final AtomicReference<AsyncDataConsumer> entityConsumerRef = new AtomicReference<>(null); private final AtomicReference<AsyncDataConsumer> entityConsumerRef = new AtomicReference<>();
@Override @Override
public void releaseResources() { public void releaseResources() {

View File

@ -68,7 +68,7 @@ class InternalH2AsyncExecRuntime implements AsyncExecRuntime {
this.log = log; this.log = log;
this.connPool = connPool; this.connPool = connPool;
this.pushHandlerFactory = pushHandlerFactory; this.pushHandlerFactory = pushHandlerFactory;
this.sessionRef = new AtomicReference<>(null); this.sessionRef = new AtomicReference<>();
} }
@Override @Override

View File

@ -75,7 +75,7 @@ class InternalHttpAsyncExecRuntime implements AsyncExecRuntime {
this.connectionInitiator = connectionInitiator; this.connectionInitiator = connectionInitiator;
this.pushHandlerFactory = pushHandlerFactory; this.pushHandlerFactory = pushHandlerFactory;
this.versionPolicy = versionPolicy; this.versionPolicy = versionPolicy;
this.endpointRef = new AtomicReference<>(null); this.endpointRef = new AtomicReference<>();
this.validDuration = TimeValue.NEG_ONE_MILLISECOND; this.validDuration = TimeValue.NEG_ONE_MILLISECOND;
} }

View File

@ -76,7 +76,7 @@ class InternalExecRuntime implements ExecRuntime, Cancellable {
this.manager = manager; this.manager = manager;
this.requestExecutor = requestExecutor; this.requestExecutor = requestExecutor;
this.cancellableDependency = cancellableDependency; this.cancellableDependency = cancellableDependency;
this.endpointRef = new AtomicReference<>(null); this.endpointRef = new AtomicReference<>();
this.validDuration = TimeValue.NEG_ONE_MILLISECOND; this.validDuration = TimeValue.NEG_ONE_MILLISECOND;
} }