Skip to content
Permalink
Browse files
Don't initialize AtomicReference to its default value.
  • Loading branch information
garydgregory committed Oct 13, 2021
1 parent f122766 commit 7c4e865a8ce368951b6146b6868b418182eeb5dc
Showing 10 changed files with 10 additions and 10 deletions.
@@ -124,7 +124,7 @@ public void revalidateCacheEntry(
public void run() {
call.execute(new AsyncExecCallback() {

private final AtomicReference<HttpResponse> responseRef = new AtomicReference<>(null);
private final AtomicReference<HttpResponse> responseRef = new AtomicReference<>();

@Override
public AsyncDataConsumer handleResponse(
@@ -61,7 +61,7 @@ public class AsyncEchoHandler implements AsyncServerExchangeHandler {

public AsyncEchoHandler() {
this.entityConsumer = new BasicAsyncEntityConsumer();
this.entityProducerRef = new AtomicReference<>(null);
this.entityProducerRef = new AtomicReference<>();
}

@Override
@@ -63,7 +63,7 @@ public class AsyncRandomHandler implements AsyncServerExchangeHandler {
private final AtomicReference<AsyncEntityProducer> entityProducerRef;

public AsyncRandomHandler() {
this.entityProducerRef = new AtomicReference<>(null);
this.entityProducerRef = new AtomicReference<>();
}

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

@@ -307,7 +307,7 @@ static Map<Long, StreamingTestCase> generate(final int numTestCases, final int m
while (testCases.size() < numTestCases) {
final long seed = 198723L * testCaseNum++;
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 StreamingTestCase streamingTestCase = new StreamingTestCase(length, expectedHash, stream);
testCases.put((long) length, streamingTestCase);
@@ -88,7 +88,7 @@ public void execute(

final AsyncClientExchangeHandler internalExchangeHandler = new AsyncClientExchangeHandler() {

private final AtomicReference<AsyncDataConsumer> entityConsumerRef = new AtomicReference<>(null);
private final AtomicReference<AsyncDataConsumer> entityConsumerRef = new AtomicReference<>();

@Override
public void releaseResources() {
@@ -104,7 +104,7 @@ public void execute(
final AtomicInteger messageCountDown = new AtomicInteger(2);
final AsyncClientExchangeHandler internalExchangeHandler = new AsyncClientExchangeHandler() {

private final AtomicReference<AsyncDataConsumer> entityConsumerRef = new AtomicReference<>(null);
private final AtomicReference<AsyncDataConsumer> entityConsumerRef = new AtomicReference<>();

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

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

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

0 comments on commit 7c4e865

Please sign in to comment.