Drop explicit zeroing at instantiation of Atomic* objects
This commit is contained in:
committed by
Juergen Hoeller
parent
b7e1553c9d
commit
8a04910bdd
@@ -62,7 +62,7 @@ class ReactorClientHttpResponse implements ClientHttpResponse {
|
||||
private final NettyDataBufferFactory bufferFactory;
|
||||
|
||||
// 0 - not subscribed, 1 - subscribed, 2 - cancelled via connector (before subscribe)
|
||||
private final AtomicInteger state = new AtomicInteger(0);
|
||||
private final AtomicInteger state = new AtomicInteger();
|
||||
|
||||
private final String logPrefix;
|
||||
|
||||
|
||||
@@ -339,7 +339,7 @@ public class SynchronossPartHttpMessageReader extends LoggingCodecSupport implem
|
||||
|
||||
private final LimitedPartBodyStreamStorageFactory storageFactory;
|
||||
|
||||
private final AtomicInteger terminated = new AtomicInteger(0);
|
||||
private final AtomicInteger terminated = new AtomicInteger();
|
||||
|
||||
FluxSinkAdapterListener(
|
||||
FluxSink<Part> sink, MultipartContext context, LimitedPartBodyStreamStorageFactory factory) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 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.
|
||||
@@ -46,7 +46,7 @@ public class ServletServerHttpAsyncRequestControl implements ServerHttpAsyncRequ
|
||||
@Nullable
|
||||
private AsyncContext asyncContext;
|
||||
|
||||
private AtomicBoolean asyncCompleted = new AtomicBoolean(false);
|
||||
private AtomicBoolean asyncCompleted = new AtomicBoolean();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,7 +48,7 @@ import org.springframework.util.MultiValueMap;
|
||||
*/
|
||||
class ReactorServerHttpRequest extends AbstractServerHttpRequest {
|
||||
|
||||
private static final AtomicLong logPrefixIndex = new AtomicLong(0);
|
||||
private static final AtomicLong logPrefixIndex = new AtomicLong();
|
||||
|
||||
|
||||
private final HttpServerRequest request;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -48,7 +48,7 @@ public class StandardServletAsyncWebRequest extends ServletWebRequest implements
|
||||
|
||||
private AsyncContext asyncContext;
|
||||
|
||||
private AtomicBoolean asyncCompleted = new AtomicBoolean(false);
|
||||
private AtomicBoolean asyncCompleted = new AtomicBoolean();
|
||||
|
||||
private final List<Runnable> timeoutHandlers = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ReactorResourceFactoryTests {
|
||||
@Test
|
||||
void globalResourcesWithConsumer() throws Exception {
|
||||
|
||||
AtomicBoolean invoked = new AtomicBoolean(false);
|
||||
AtomicBoolean invoked = new AtomicBoolean();
|
||||
|
||||
this.resourceFactory.addGlobalResourcesConsumer(httpResources -> invoked.set(true));
|
||||
this.resourceFactory.afterPropertiesSet();
|
||||
|
||||
@@ -75,7 +75,7 @@ public class ClientCodecConfigurerTests {
|
||||
|
||||
private final ClientCodecConfigurer configurer = new DefaultClientCodecConfigurer();
|
||||
|
||||
private final AtomicInteger index = new AtomicInteger(0);
|
||||
private final AtomicInteger index = new AtomicInteger();
|
||||
|
||||
|
||||
@Test
|
||||
|
||||
@@ -73,7 +73,7 @@ class CodecConfigurerTests {
|
||||
|
||||
private final CodecConfigurer configurer = new TestCodecConfigurer();
|
||||
|
||||
private final AtomicInteger index = new AtomicInteger(0);
|
||||
private final AtomicInteger index = new AtomicInteger();
|
||||
|
||||
|
||||
@Test
|
||||
@@ -374,7 +374,7 @@ class CodecConfigurerTests {
|
||||
@SuppressWarnings("deprecation")
|
||||
@Test
|
||||
void withDefaultCodecConfig() {
|
||||
AtomicBoolean callbackCalled = new AtomicBoolean(false);
|
||||
AtomicBoolean callbackCalled = new AtomicBoolean();
|
||||
this.configurer.defaultCodecs().enableLoggingRequestDetails(true);
|
||||
this.configurer.customCodecs().withDefaultCodecConfig(config -> {
|
||||
assertThat(config.isEnableLoggingRequestDetails()).isTrue();
|
||||
|
||||
@@ -77,7 +77,7 @@ public class ServerCodecConfigurerTests {
|
||||
|
||||
private final ServerCodecConfigurer configurer = new DefaultServerCodecConfigurer();
|
||||
|
||||
private final AtomicInteger index = new AtomicInteger(0);
|
||||
private final AtomicInteger index = new AtomicInteger();
|
||||
|
||||
|
||||
@Test
|
||||
|
||||
@@ -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.
|
||||
@@ -121,7 +121,7 @@ public class ContextPathCompositeHandlerTests {
|
||||
@Test // SPR-17144
|
||||
public void notFoundWithCommitAction() {
|
||||
|
||||
AtomicBoolean commitInvoked = new AtomicBoolean(false);
|
||||
AtomicBoolean commitInvoked = new AtomicBoolean();
|
||||
|
||||
ServerHttpRequest request = MockServerHttpRequest.get("/unknown/path").build();
|
||||
ServerHttpResponse response = new MockServerHttpResponse();
|
||||
|
||||
@@ -123,7 +123,7 @@ public class WebHttpHandlerBuilderTests {
|
||||
BiFunction<ServerHttpRequest, String, ServerHttpRequest> mutator =
|
||||
(req, value) -> req.mutate().headers(headers -> headers.add("My-Header", value)).build();
|
||||
|
||||
AtomicBoolean success = new AtomicBoolean(false);
|
||||
AtomicBoolean success = new AtomicBoolean();
|
||||
HttpHandler httpHandler = WebHttpHandlerBuilder
|
||||
.webHandler(exchange -> {
|
||||
HttpHeaders headers = exchange.getRequest().getHeaders();
|
||||
|
||||
Reference in New Issue
Block a user