Drop explicit zeroing at instantiation of Atomic* objects

This commit is contained in:
Сергей Цыпанов
2020-09-30 22:57:04 +03:00
committed by Juergen Hoeller
parent b7e1553c9d
commit 8a04910bdd
35 changed files with 64 additions and 64 deletions

View File

@@ -63,7 +63,7 @@ public abstract class AbstractBrokerMessageHandler
@Nullable
private ApplicationEventPublisher eventPublisher;
private AtomicBoolean brokerAvailable = new AtomicBoolean(false);
private AtomicBoolean brokerAvailable = new AtomicBoolean();
private final BrokerAvailabilityEvent availableEvent = new BrokerAvailabilityEvent(true, this);

View File

@@ -52,7 +52,7 @@ public class OrderedMessageChannelDecorator implements MessageChannel {
private final Queue<Message<?>> messages = new ConcurrentLinkedQueue<>();
private final AtomicBoolean sendInProgress = new AtomicBoolean(false);
private final AtomicBoolean sendInProgress = new AtomicBoolean();
public OrderedMessageChannelDecorator(MessageChannel channel, Log logger) {

View File

@@ -185,7 +185,7 @@ public class DefaultRSocketRequesterTests {
@Test
public void retrieveMonoVoid() {
AtomicBoolean consumed = new AtomicBoolean(false);
AtomicBoolean consumed = new AtomicBoolean();
Mono<Payload> mono = Mono.delay(MILLIS_10).thenReturn(toPayload("bodyA")).doOnSuccess(p -> consumed.set(true));
this.rsocket.setPayloadMonoToReturn(mono);
this.requester.route("").data("").retrieveMono(Void.class).block(Duration.ofSeconds(5));
@@ -215,7 +215,7 @@ public class DefaultRSocketRequesterTests {
@Test
public void retrieveFluxVoid() {
AtomicBoolean consumed = new AtomicBoolean(false);
AtomicBoolean consumed = new AtomicBoolean();
Flux<Payload> flux = Flux.just("bodyA", "bodyB")
.delayElements(MILLIS_10).map(this::toPayload).doOnComplete(() -> consumed.set(true));
this.rsocket.setPayloadFluxToReturn(flux);

View File

@@ -317,9 +317,9 @@ public class RSocketClientToServerIntegrationTests {
private RSocket delegate;
private final AtomicInteger fireAndForgetCount = new AtomicInteger(0);
private final AtomicInteger fireAndForgetCount = new AtomicInteger();
private final AtomicInteger metadataPushCount = new AtomicInteger(0);
private final AtomicInteger metadataPushCount = new AtomicInteger();
public int getFireAndForgetCount() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -86,8 +86,8 @@ public class ChannelInterceptorTests {
@Test
public void postSendInterceptorMessageWasSent() {
final AtomicBoolean preSendInvoked = new AtomicBoolean(false);
final AtomicBoolean completionInvoked = new AtomicBoolean(false);
final AtomicBoolean preSendInvoked = new AtomicBoolean();
final AtomicBoolean completionInvoked = new AtomicBoolean();
this.channel.addInterceptor(new ChannelInterceptor() {
@Override
public void postSend(Message<?> message, MessageChannel channel, boolean sent) {
@@ -119,8 +119,8 @@ public class ChannelInterceptorTests {
return false;
}
};
final AtomicBoolean preSendInvoked = new AtomicBoolean(false);
final AtomicBoolean completionInvoked = new AtomicBoolean(false);
final AtomicBoolean preSendInvoked = new AtomicBoolean();
final AtomicBoolean completionInvoked = new AtomicBoolean();
testChannel.addInterceptor(new ChannelInterceptor() {
@Override
public void postSend(Message<?> message, MessageChannel channel, boolean sent) {