Remove redundant assignment of default values to volatile fields

This commit is contained in:
Сергей Цыпанов 2020-06-17 10:48:00 +03:00 committed by Juergen Hoeller
parent 8099fc8178
commit 7949937655
37 changed files with 69 additions and 69 deletions

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -49,7 +49,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
@Nullable @Nullable
private Set<String> processedProperties; private Set<String> processedProperties;
private volatile boolean converted = false; private volatile boolean converted;
/** /**

View File

@ -613,7 +613,7 @@ public class AutowiredAnnotationBeanPostProcessor implements SmartInstantiationA
private final boolean required; private final boolean required;
private volatile boolean cached = false; private volatile boolean cached;
@Nullable @Nullable
private volatile Object cachedFieldValue; private volatile Object cachedFieldValue;
@ -678,7 +678,7 @@ public class AutowiredAnnotationBeanPostProcessor implements SmartInstantiationA
private final boolean required; private final boolean required;
private volatile boolean cached = false; private volatile boolean cached;
@Nullable @Nullable
private volatile Object[] cachedMethodArguments; private volatile Object[] cachedMethodArguments;

View File

@ -183,7 +183,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
private volatile String[] frozenBeanDefinitionNames; private volatile String[] frozenBeanDefinitionNames;
/** Whether bean definition metadata may be cached for all beans. */ /** Whether bean definition metadata may be cached for all beans. */
private volatile boolean configurationFrozen = false; private volatile boolean configurationFrozen;
/** /**

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -65,7 +65,7 @@ public class RootBeanDefinition extends AbstractBeanDefinition {
boolean allowCaching = true; boolean allowCaching = true;
boolean isFactoryMethodUnique = false; boolean isFactoryMethodUnique;
@Nullable @Nullable
volatile ResolvableType targetType; volatile ResolvableType targetType;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -45,7 +45,7 @@ public abstract class AbstractRemoteSlsbInvokerInterceptor extends AbstractSlsbI
private boolean refreshHomeOnConnectFailure = false; private boolean refreshHomeOnConnectFailure = false;
private volatile boolean homeAsComponent = false; private volatile boolean homeAsComponent;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -52,7 +52,7 @@ import org.springframework.lang.Nullable;
*/ */
public class LocalSlsbInvokerInterceptor extends AbstractSlsbInvokerInterceptor { public class LocalSlsbInvokerInterceptor extends AbstractSlsbInvokerInterceptor {
private volatile boolean homeAsComponent = false; private volatile boolean homeAsComponent;
/** /**

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -61,7 +61,7 @@ public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport
private volatile int poolSize = 1; private volatile int poolSize = 1;
private volatile boolean removeOnCancelPolicy = false; private volatile boolean removeOnCancelPolicy;
@Nullable @Nullable
private volatile ErrorHandler errorHandler; private volatile ErrorHandler errorHandler;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -50,9 +50,9 @@ public class PeriodicTrigger implements Trigger {
private final TimeUnit timeUnit; private final TimeUnit timeUnit;
private volatile long initialDelay = 0; private volatile long initialDelay;
private volatile boolean fixedRate = false; private volatile boolean fixedRate;
/** /**

View File

@ -428,7 +428,7 @@ public abstract class MimeTypeUtils {
private final Function<K, V> generator; private final Function<K, V> generator;
private volatile int size = 0; private volatile int size;
public ConcurrentLruCache(int maxSize, Function<K, V> generator) { public ConcurrentLruCache(int maxSize, Function<K, V> generator) {
Assert.isTrue(maxSize > 0, "LRU max size should be positive"); Assert.isTrue(maxSize > 0, "LRU max size should be positive");

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -70,7 +70,7 @@ public abstract class AbstractJdbcCall {
* Has this operation been compiled? Compilation means at least checking * Has this operation been compiled? Compilation means at least checking
* that a DataSource or JdbcTemplate has been provided. * that a DataSource or JdbcTemplate has been provided.
*/ */
private volatile boolean compiled = false; private volatile boolean compiled;
/** The generated string used for call statement. */ /** The generated string used for call statement. */
@Nullable @Nullable

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -80,7 +80,7 @@ public abstract class AbstractJdbcInsert {
* Has this operation been compiled? Compilation means at least checking * Has this operation been compiled? Compilation means at least checking
* that a DataSource or JdbcTemplate has been provided. * that a DataSource or JdbcTemplate has been provided.
*/ */
private volatile boolean compiled = false; private volatile boolean compiled;
/** The generated string used for insert statement. */ /** The generated string used for insert statement. */
private String insertString = ""; private String insertString = "";

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -81,7 +81,7 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
private boolean active = false; private boolean active = false;
private volatile boolean running = false; private volatile boolean running;
private final List<Object> pausedTasks = new LinkedList<>(); private final List<Object> pausedTasks = new LinkedList<>();

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -198,9 +198,9 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
private int registeredWithDestination = 0; private int registeredWithDestination = 0;
private volatile boolean recovering = false; private volatile boolean recovering;
private volatile boolean interrupted = false; private volatile boolean interrupted;
@Nullable @Nullable
private Runnable stopCallback; private Runnable stopCallback;

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -65,7 +65,7 @@ public class GenericMessagingTemplate extends AbstractDestinationResolvingMessag
private String receiveTimeoutHeader = DEFAULT_RECEIVE_TIMEOUT_HEADER; private String receiveTimeoutHeader = DEFAULT_RECEIVE_TIMEOUT_HEADER;
private volatile boolean throwExceptionOnLateReply = false; private volatile boolean throwExceptionOnLateReply;
/** /**

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -121,7 +121,7 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan
@Nullable @Nullable
private MessageHeaderInitializer headerInitializer; private MessageHeaderInitializer headerInitializer;
private volatile boolean running = false; private volatile boolean running;
private final Object lifecycleMonitor = new Object(); private final Object lifecycleMonitor = new Object();

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -71,7 +71,7 @@ public abstract class AbstractBrokerMessageHandler
private boolean autoStartup = true; private boolean autoStartup = true;
private volatile boolean running = false; private volatile boolean running;
private final Object lifecycleMonitor = new Object(); private final Object lifecycleMonitor = new Object();

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -77,7 +77,7 @@ public class DefaultSubscriptionRegistry extends AbstractSubscriptionRegistry {
@Nullable @Nullable
private String selectorHeaderName = "selector"; private String selectorHeaderName = "selector";
private volatile boolean selectorHeaderInUse = false; private volatile boolean selectorHeaderInUse;
private final ExpressionParser expressionParser = new SpelExpressionParser(); private final ExpressionParser expressionParser = new SpelExpressionParser();

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -111,7 +111,7 @@ public class DefaultStompSession implements ConnectionHandlingStompSession {
private final Map<String, ReceiptHandler> receiptHandlers = new ConcurrentHashMap<>(4); private final Map<String, ReceiptHandler> receiptHandlers = new ConcurrentHashMap<>(4);
/* Whether the client is willfully closing the connection */ /* Whether the client is willfully closing the connection */
private volatile boolean closing = false; private volatile boolean closing;
/** /**

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -67,7 +67,7 @@ public class UserDestinationMessageHandler implements MessageHandler, SmartLifec
@Nullable @Nullable
private MessageHeaderInitializer headerInitializer; private MessageHeaderInitializer headerInitializer;
private volatile boolean running = false; private volatile boolean running;
private final Object lifecycleMonitor = new Object(); private final Object lifecycleMonitor = new Object();

View File

@ -87,7 +87,7 @@ public class ReactorNettyTcpClient<P> implements TcpOperations<P> {
private Log logger = LogFactory.getLog(ReactorNettyTcpClient.class); private Log logger = LogFactory.getLog(ReactorNettyTcpClient.class);
private volatile boolean stopping = false; private volatile boolean stopping;
/** /**

View File

@ -439,7 +439,7 @@ public abstract class ExtendedEntityManagerCreator {
@Nullable @Nullable
private final PersistenceExceptionTranslator exceptionTranslator; private final PersistenceExceptionTranslator exceptionTranslator;
public volatile boolean closeOnCompletion = false; public volatile boolean closeOnCompletion;
public ExtendedEntityManagerSynchronization( public ExtendedEntityManagerSynchronization(
EntityManager em, @Nullable PersistenceExceptionTranslator exceptionTranslator) { EntityManager em, @Nullable PersistenceExceptionTranslator exceptionTranslator) {

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -161,7 +161,7 @@ public class GenericMessageEndpointManager implements SmartLifecycle, Initializi
private int phase = DEFAULT_PHASE; private int phase = DEFAULT_PHASE;
private volatile boolean running = false; private volatile boolean running;
private final Object lifecycleMonitor = new Object(); private final Object lifecycleMonitor = new Object();

View File

@ -106,7 +106,7 @@ import org.springframework.util.xml.StaxUtils;
*/ */
public class Jackson2ObjectMapperBuilder { public class Jackson2ObjectMapperBuilder {
private static volatile boolean kotlinWarningLogged = false; private static volatile boolean kotlinWarningLogged;
private final Log logger = HttpLogging.forLogName(getClass()); private final Log logger = HttpLogging.forLogName(getClass());

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -73,7 +73,7 @@ public class DeferredResult<T> {
private volatile Object result = RESULT_NONE; private volatile Object result = RESULT_NONE;
private volatile boolean expired = false; private volatile boolean expired;
/** /**

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -89,7 +89,7 @@ public class HandshakeWebSocketService implements WebSocketService, Lifecycle {
@Nullable @Nullable
private Predicate<String> sessionAttributePredicate; private Predicate<String> sessionAttributePredicate;
private volatile boolean running = false; private volatile boolean running;
/** /**

View File

@ -66,7 +66,7 @@ public class JettyRequestUpgradeStrategy implements RequestUpgradeStrategy, Life
@Nullable @Nullable
private volatile ServletContext servletContext; private volatile ServletContext servletContext;
private volatile boolean running = false; private volatile boolean running;
private final Object lifecycleMonitor = new Object(); private final Object lifecycleMonitor = new Object();

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -221,7 +221,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
private boolean webApplicationContextInjected = false; private boolean webApplicationContextInjected = false;
/** Flag used to detect whether onRefresh has already been called. */ /** Flag used to detect whether onRefresh has already been called. */
private volatile boolean refreshEventReceived = false; private volatile boolean refreshEventReceived;
/** Monitor for synchronized onRefresh execution. */ /** Monitor for synchronized onRefresh execution. */
private final Object onRefreshMonitor = new Object(); private final Object onRefreshMonitor = new Object();

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -44,7 +44,7 @@ public abstract class ConnectionManagerSupport implements SmartLifecycle {
private int phase = DEFAULT_PHASE; private int phase = DEFAULT_PHASE;
private volatile boolean running = false; private volatile boolean running;
private final Object lifecycleMonitor = new Object(); private final Object lifecycleMonitor = new Object();

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -101,7 +101,7 @@ public class SubProtocolWebSocketHandler
private final DefaultStats stats = new DefaultStats(); private final DefaultStats stats = new DefaultStats();
private volatile boolean running = false; private volatile boolean running;
private final Object lifecycleMonitor = new Object(); private final Object lifecycleMonitor = new Object();

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -82,7 +82,7 @@ public class WebSocketStompClient extends StompClientSupport implements SmartLif
private int phase = DEFAULT_PHASE; private int phase = DEFAULT_PHASE;
private volatile boolean running = false; private volatile boolean running;
/** /**

View File

@ -78,7 +78,7 @@ public class JettyRequestUpgradeStrategy implements RequestUpgradeStrategy, Serv
@Nullable @Nullable
private ServletContext servletContext; private ServletContext servletContext;
private volatile boolean running = false; private volatile boolean running;
@Nullable @Nullable
private volatile List<WebSocketExtension> supportedExtensions; private volatile List<WebSocketExtension> supportedExtensions;

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -107,7 +107,7 @@ public abstract class AbstractHandshakeHandler implements HandshakeHandler, Life
private final List<String> supportedProtocols = new ArrayList<>(); private final List<String> supportedProtocols = new ArrayList<>();
private volatile boolean running = false; private volatile boolean running;
/** /**

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -34,7 +34,7 @@ import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
*/ */
public class WebSocketHandlerMapping extends SimpleUrlHandlerMapping implements SmartLifecycle { public class WebSocketHandlerMapping extends SimpleUrlHandlerMapping implements SmartLifecycle {
private volatile boolean running = false; private volatile boolean running;
@Override @Override

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -67,7 +67,7 @@ public class WebSocketHttpRequestHandler implements HttpRequestHandler, Lifecycl
private final List<HandshakeInterceptor> interceptors = new ArrayList<>(); private final List<HandshakeInterceptor> interceptors = new ArrayList<>();
private volatile boolean running = false; private volatile boolean running;
public WebSocketHttpRequestHandler(WebSocketHandler wsHandler) { public WebSocketHttpRequestHandler(WebSocketHandler wsHandler) {

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -90,7 +90,7 @@ public class SockJsClient implements WebSocketClient, Lifecycle {
@Nullable @Nullable
private TaskScheduler connectTimeoutScheduler; private TaskScheduler connectTimeoutScheduler;
private volatile boolean running = false; private volatile boolean running;
private final Map<URI, ServerInfo> serverInfoCache = new ConcurrentHashMap<>(); private final Map<URI, ServerInfo> serverInfoCache = new ConcurrentHashMap<>();

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -52,7 +52,7 @@ public class WebSocketTransport implements Transport, Lifecycle {
private final WebSocketClient webSocketClient; private final WebSocketClient webSocketClient;
private volatile boolean running = false; private volatile boolean running;
public WebSocketTransport(WebSocketClient webSocketClient) { public WebSocketTransport(WebSocketClient webSocketClient) {

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -58,7 +58,7 @@ public class SockJsHttpRequestHandler
private final WebSocketHandler webSocketHandler; private final WebSocketHandler webSocketHandler;
private volatile boolean running = false; private volatile boolean running;
/** /**