Skip to content

Commit 9e656c1

Browse files
committed
Remove unnecessary field initialization
Closes gh-45168 Co-authored-by: CatiaCorreia catia.correia97@gmail.com
1 parent 9b387cb commit 9e656c1

File tree

76 files changed

+132
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+132
-131
lines changed

buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public Iterator<Node> iterator() {
142142

143143
return new Iterator<>() {
144144

145-
private int index = 0;
145+
private int index;
146146

147147
@Override
148148
public boolean hasNext() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthIndicatorProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class DataSourceHealthIndicatorProperties {
3232
* Whether to ignore AbstractRoutingDataSources when creating database health
3333
* indicators.
3434
*/
35-
private boolean ignoreRoutingDataSources = false;
35+
private boolean ignoreRoutingDataSources;
3636

3737
public boolean isIgnoreRoutingDataSources() {
3838
return this.ignoreRoutingDataSources;

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public class ElasticProperties extends StepRegistryProperties {
8383
* Whether to enable _source in the default index template when auto-creating the
8484
* index.
8585
*/
86-
private boolean enableSource = false;
86+
private boolean enableSource;
8787

8888
public String getHost() {
8989
return this.host;

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/stackdriver/StackdriverProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class StackdriverProperties extends StepRegistryProperties {
5252
* published as the GAUGE MetricKind. When true, counter metrics are published as the
5353
* CUMULATIVE MetricKind.
5454
*/
55-
private boolean useSemanticMetricTypes = false;
55+
private boolean useSemanticMetricTypes;
5656

5757
/**
5858
* Prefix for metric type. Valid prefixes are described in the Google Cloud

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/TracingProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public static class Brave {
281281
* between client and server spans. Requires B3 propagation and a compatible
282282
* backend.
283283
*/
284-
private boolean spanJoiningSupported = false;
284+
private boolean spanJoiningSupported;
285285

286286
public boolean isSpanJoiningSupported() {
287287
return this.spanJoiningSupported;

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ public static class TestProperties {
464464

465465
private String myTestProperty = "654321";
466466

467-
private String nullValue = null;
467+
private String nullValue;
468468

469469
private Duration duration = Duration.ofSeconds(10);
470470

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ public static class DirectContainer extends AmqpContainer {
936936
* Whether to fail if the queues declared by the container are not available on
937937
* the broker.
938938
*/
939-
private boolean missingQueuesFatal = false;
939+
private boolean missingQueuesFatal;
940940

941941
public Integer getConsumersPerQueue() {
942942
return this.consumersPerQueue;

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ public class MessageSourceProperties {
7474
* Whether to always apply the MessageFormat rules, parsing even messages without
7575
* arguments.
7676
*/
77-
private boolean alwaysUseMessageFormat = false;
77+
private boolean alwaysUseMessageFormat;
7878

7979
/**
8080
* Whether to use the message code as the default message instead of throwing a
8181
* "NoSuchMessageException". Recommended during development only.
8282
*/
83-
private boolean useCodeAsDefaultMessage = false;
83+
private boolean useCodeAsDefaultMessage;
8484

8585
public List<String> getBasename() {
8686
return this.basename;

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/JpaRepositoriesRegistrar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*/
3939
class JpaRepositoriesRegistrar extends AbstractRepositoryConfigurationSourceSupport {
4040

41-
private BootstrapMode bootstrapMode = null;
41+
private BootstrapMode bootstrapMode;
4242

4343
@Override
4444
protected Class<? extends Annotation> getAnnotation() {

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class RedisProperties {
3939
/**
4040
* Database index used by the connection factory.
4141
*/
42-
private int database = 0;
42+
private int database;
4343

4444
/**
4545
* Connection URL. Overrides host, port, username, and password. Example:
@@ -245,7 +245,7 @@ public static class Pool {
245245
* setting only has an effect if both it and time between eviction runs are
246246
* positive.
247247
*/
248-
private int minIdle = 0;
248+
private int minIdle;
249249

250250
/**
251251
* Maximum number of connections that can be allocated by the pool at a given

0 commit comments

Comments
 (0)