Skip to content

Commit 7949937

Browse files
stsypanovjhoeller
authored andcommitted
Remove redundant assignment of default values to volatile fields
1 parent 8099fc8 commit 7949937

37 files changed

Lines changed: 69 additions & 69 deletions

File tree

spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -49,7 +49,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
4949
@Nullable
5050
private Set<String> processedProperties;
5151

52-
private volatile boolean converted = false;
52+
private volatile boolean converted;
5353

5454

5555
/**

spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ private class AutowiredFieldElement extends InjectionMetadata.InjectedElement {
613613

614614
private final boolean required;
615615

616-
private volatile boolean cached = false;
616+
private volatile boolean cached;
617617

618618
@Nullable
619619
private volatile Object cachedFieldValue;
@@ -678,7 +678,7 @@ private class AutowiredMethodElement extends InjectionMetadata.InjectedElement {
678678

679679
private final boolean required;
680680

681-
private volatile boolean cached = false;
681+
private volatile boolean cached;
682682

683683
@Nullable
684684
private volatile Object[] cachedMethodArguments;

spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
183183
private volatile String[] frozenBeanDefinitionNames;
184184

185185
/** Whether bean definition metadata may be cached for all beans. */
186-
private volatile boolean configurationFrozen = false;
186+
private volatile boolean configurationFrozen;
187187

188188

189189
/**

spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -65,7 +65,7 @@ public class RootBeanDefinition extends AbstractBeanDefinition {
6565

6666
boolean allowCaching = true;
6767

68-
boolean isFactoryMethodUnique = false;
68+
boolean isFactoryMethodUnique;
6969

7070
@Nullable
7171
volatile ResolvableType targetType;

spring-context/src/main/java/org/springframework/ejb/access/AbstractRemoteSlsbInvokerInterceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ public abstract class AbstractRemoteSlsbInvokerInterceptor extends AbstractSlsbI
4545

4646
private boolean refreshHomeOnConnectFailure = false;
4747

48-
private volatile boolean homeAsComponent = false;
48+
private volatile boolean homeAsComponent;
4949

5050

5151

spring-context/src/main/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@
5252
*/
5353
public class LocalSlsbInvokerInterceptor extends AbstractSlsbInvokerInterceptor {
5454

55-
private volatile boolean homeAsComponent = false;
55+
private volatile boolean homeAsComponent;
5656

5757

5858
/**

spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -61,7 +61,7 @@ public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport
6161

6262
private volatile int poolSize = 1;
6363

64-
private volatile boolean removeOnCancelPolicy = false;
64+
private volatile boolean removeOnCancelPolicy;
6565

6666
@Nullable
6767
private volatile ErrorHandler errorHandler;

spring-context/src/main/java/org/springframework/scheduling/support/PeriodicTrigger.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -50,9 +50,9 @@ public class PeriodicTrigger implements Trigger {
5050

5151
private final TimeUnit timeUnit;
5252

53-
private volatile long initialDelay = 0;
53+
private volatile long initialDelay;
5454

55-
private volatile boolean fixedRate = false;
55+
private volatile boolean fixedRate;
5656

5757

5858
/**

spring-core/src/main/java/org/springframework/util/MimeTypeUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ private static class ConcurrentLruCache<K, V> {
428428

429429
private final Function<K, V> generator;
430430

431-
private volatile int size = 0;
431+
private volatile int size;
432432

433433
public ConcurrentLruCache(int maxSize, Function<K, V> generator) {
434434
Assert.isTrue(maxSize > 0, "LRU max size should be positive");

spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcCall.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -70,7 +70,7 @@ public abstract class AbstractJdbcCall {
7070
* Has this operation been compiled? Compilation means at least checking
7171
* that a DataSource or JdbcTemplate has been provided.
7272
*/
73-
private volatile boolean compiled = false;
73+
private volatile boolean compiled;
7474

7575
/** The generated string used for call statement. */
7676
@Nullable

0 commit comments

Comments
 (0)