From 9e656c1554f7fcdb686bc0fc02fe8e93045c8eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Thu, 13 Nov 2025 10:20:57 +0100 Subject: [PATCH] Remove unnecessary field initialization Closes gh-45168 Co-authored-by: CatiaCorreia catia.correia97@gmail.com --- .../build/mavenplugin/PluginXmlParser.java | 2 +- .../DataSourceHealthIndicatorProperties.java | 2 +- .../export/elastic/ElasticProperties.java | 2 +- .../stackdriver/StackdriverProperties.java | 2 +- .../tracing/TracingProperties.java | 2 +- ...gurationPropertiesReportEndpointTests.java | 2 +- .../autoconfigure/amqp/RabbitProperties.java | 2 +- .../context/MessageSourceProperties.java | 4 ++-- .../data/jpa/JpaRepositoriesRegistrar.java | 2 +- .../data/redis/RedisProperties.java | 4 ++-- .../data/web/SpringDataWebProperties.java | 2 +- .../ElasticsearchProperties.java | 2 +- .../flyway/FlywayMigrationInitializer.java | 2 +- .../flyway/FlywayProperties.java | 2 +- .../graphql/GraphQlProperties.java | 4 ++-- .../autoconfigure/h2/H2ConsoleProperties.java | 6 +++--- .../integration/IntegrationProperties.java | 2 +- .../jackson/JacksonProperties.java | 2 +- .../boot/autoconfigure/jms/JmsProperties.java | 8 ++++---- .../jms/activemq/ActiveMQProperties.java | 2 +- .../boot/autoconfigure/jmx/JmxProperties.java | 4 ++-- .../autoconfigure/kafka/KafkaProperties.java | 12 +++++------ .../autoconfigure/ldap/LdapProperties.java | 4 ++-- .../ldap/embedded/EmbeddedLdapProperties.java | 2 +- .../autoconfigure/mail/MailProperties.java | 2 +- .../autoconfigure/mongo/MongoProperties.java | 2 +- ...dMongoClientSettingsBuilderCustomizer.java | 2 +- .../mustache/MustacheProperties.java | 8 ++++---- .../autoconfigure/neo4j/Neo4jProperties.java | 6 +++--- .../autoconfigure/orm/jpa/JpaProperties.java | 4 ++-- .../pulsar/PulsarProperties.java | 8 ++++---- .../quartz/QuartzProperties.java | 4 ++-- .../autoconfigure/r2dbc/R2dbcProperties.java | 2 +- .../OAuth2AuthorizationServerProperties.java | 6 +++--- .../sql/init/SqlInitializationProperties.java | 2 +- ...bstractTemplateViewResolverProperties.java | 8 ++++---- .../thymeleaf/ThymeleafProperties.java | 2 +- .../autoconfigure/web/ServerProperties.java | 20 +++++++++---------- .../boot/autoconfigure/web/WebProperties.java | 14 ++++++------- .../web/reactive/WebFluxProperties.java | 2 +- .../web/servlet/MultipartProperties.java | 4 ++-- .../web/servlet/WebMvcProperties.java | 8 ++++---- .../batch/BatchAutoConfigurationTests.java | 2 +- .../GraphQlAutoConfigurationTests.java | 4 ++-- .../jmx/JmxAutoConfigurationTests.java | 2 +- .../autoconfigure/ssl/FileWatcherTests.java | 2 +- .../WebFluxAutoConfigurationTests.java | 4 ++-- ...ttpConnectorFactoryConfigurationTests.java | 2 +- .../servlet/WebMvcAutoConfigurationTests.java | 4 ++-- .../boot/devtools/restart/RestarterTests.java | 4 ++-- ...stEmbeddedReactiveWebEnvironmentTests.java | 4 ++-- ...gBootTestWebServerWebEnvironmentTests.java | 4 ++-- ...SpringBootTestWebEnvironmentMockTests.java | 2 +- .../ResetMocksTestExecutionListenerTests.java | 2 +- .../web/client/scan/SimpleFactoryBean.java | 2 +- .../ImportTestcontainersTests.java | 2 +- .../buildpack/platform/docker/DockerApi.java | 2 +- .../platform/socket/FileDescriptorTests.java | 2 +- .../boot/gradle/tasks/bundling/CacheSpec.java | 2 +- .../boot/loader/jar/JarFileEntries.java | 2 +- .../tools/SizeCalculatingEntryWriter.java | 2 +- .../boot/loader/zip/VirtualDataBlock.java | 2 +- .../boot/SpringApplicationShutdownHook.java | 2 +- .../boot/SpringBootExceptionHandler.java | 2 +- .../logging/LoggingApplicationListener.java | 2 +- ...ngIterableConfigurationPropertySource.java | 2 +- .../web/embedded/jetty/GracefulShutdown.java | 2 +- .../web/embedded/tomcat/GracefulShutdown.java | 2 +- .../embedded/tomcat/NestedJarResourceSet.java | 4 ++-- .../embedded/undertow/UndertowWebServer.java | 2 +- .../boot/web/server/Compression.java | 2 +- .../boot/image/paketo/PaketoBuilderTests.java | 2 +- .../websocket/jetty/snake/SnakeTimer.java | 2 +- .../websocket/tomcat/snake/SnakeTimer.java | 2 +- .../websocket/undertow/snake/SnakeTimer.java | 2 +- src/checkstyle/checkstyle.xml | 1 + 76 files changed, 132 insertions(+), 131 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java index cb6b81b348f..39e06f2989f 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java @@ -142,7 +142,7 @@ class PluginXmlParser { return new Iterator<>() { - private int index = 0; + private int index; @Override public boolean hasNext() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthIndicatorProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthIndicatorProperties.java index f7512069b15..e3a39f7d1d8 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthIndicatorProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthIndicatorProperties.java @@ -32,7 +32,7 @@ public class DataSourceHealthIndicatorProperties { * Whether to ignore AbstractRoutingDataSources when creating database health * indicators. */ - private boolean ignoreRoutingDataSources = false; + private boolean ignoreRoutingDataSources; public boolean isIgnoreRoutingDataSources() { return this.ignoreRoutingDataSources; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticProperties.java index 58085e5b895..0d5fbe6fd85 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticProperties.java @@ -83,7 +83,7 @@ public class ElasticProperties extends StepRegistryProperties { * Whether to enable _source in the default index template when auto-creating the * index. */ - private boolean enableSource = false; + private boolean enableSource; public String getHost() { return this.host; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/stackdriver/StackdriverProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/stackdriver/StackdriverProperties.java index a0f398cbc76..174b2df1794 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/stackdriver/StackdriverProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/stackdriver/StackdriverProperties.java @@ -52,7 +52,7 @@ public class StackdriverProperties extends StepRegistryProperties { * published as the GAUGE MetricKind. When true, counter metrics are published as the * CUMULATIVE MetricKind. */ - private boolean useSemanticMetricTypes = false; + private boolean useSemanticMetricTypes; /** * Prefix for metric type. Valid prefixes are described in the Google Cloud diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/TracingProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/TracingProperties.java index f9d02a26966..a9d610c4086 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/TracingProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/TracingProperties.java @@ -281,7 +281,7 @@ public class TracingProperties { * between client and server spans. Requires B3 propagation and a compatible * backend. */ - private boolean spanJoiningSupported = false; + private boolean spanJoiningSupported; public boolean isSpanJoiningSupported() { return this.spanJoiningSupported; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointTests.java index b669475855c..59e1f8f6f66 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointTests.java @@ -464,7 +464,7 @@ class ConfigurationPropertiesReportEndpointTests { private String myTestProperty = "654321"; - private String nullValue = null; + private String nullValue; private Duration duration = Duration.ofSeconds(10); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java index 8c3742efc89..ec366fc539d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java @@ -936,7 +936,7 @@ public class RabbitProperties { * Whether to fail if the queues declared by the container are not available on * the broker. */ - private boolean missingQueuesFatal = false; + private boolean missingQueuesFatal; public Integer getConsumersPerQueue() { return this.consumersPerQueue; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceProperties.java index 403c2aae427..1a29aa7bef6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceProperties.java @@ -74,13 +74,13 @@ public class MessageSourceProperties { * Whether to always apply the MessageFormat rules, parsing even messages without * arguments. */ - private boolean alwaysUseMessageFormat = false; + private boolean alwaysUseMessageFormat; /** * Whether to use the message code as the default message instead of throwing a * "NoSuchMessageException". Recommended during development only. */ - private boolean useCodeAsDefaultMessage = false; + private boolean useCodeAsDefaultMessage; public List getBasename() { return this.basename; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/JpaRepositoriesRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/JpaRepositoriesRegistrar.java index fddd30a5adf..b609feb27d5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/JpaRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/JpaRepositoriesRegistrar.java @@ -38,7 +38,7 @@ import org.springframework.util.StringUtils; */ class JpaRepositoriesRegistrar extends AbstractRepositoryConfigurationSourceSupport { - private BootstrapMode bootstrapMode = null; + private BootstrapMode bootstrapMode; @Override protected Class getAnnotation() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java index aab71282a11..1d31d2ae78b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java @@ -39,7 +39,7 @@ public class RedisProperties { /** * Database index used by the connection factory. */ - private int database = 0; + private int database; /** * Connection URL. Overrides host, port, username, and password. Example: @@ -245,7 +245,7 @@ public class RedisProperties { * setting only has an effect if both it and time between eviction runs are * positive. */ - private int minIdle = 0; + private int minIdle; /** * Maximum number of connections that can be allocated by the pool at a given diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebProperties.java index 146220c6510..f59546b60cf 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebProperties.java @@ -60,7 +60,7 @@ public class SpringDataWebProperties { * Whether to expose and assume 1-based page number indexes. Defaults to "false", * meaning a page number of 0 in the request equals the first page. */ - private boolean oneIndexedParameters = false; + private boolean oneIndexedParameters; /** * General prefix to be prepended to the page number and page size parameters. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchProperties.java index 3d5d251c474..8a16a8c173a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchProperties.java @@ -60,7 +60,7 @@ public class ElasticsearchProperties { /** * Whether to enable socket keep alive between client and Elasticsearch. */ - private boolean socketKeepAlive = false; + private boolean socketKeepAlive; /** * Prefix added to the path of every request sent to Elasticsearch. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializer.java index ad27a76e3f6..6d28dbcbe8f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializer.java @@ -35,7 +35,7 @@ public class FlywayMigrationInitializer implements InitializingBean, Ordered { private final FlywayMigrationStrategy migrationStrategy; - private int order = 0; + private int order; /** * Create a new {@link FlywayMigrationInitializer} instance. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java index faf493554a6..6b2049f5c6e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java @@ -247,7 +247,7 @@ public class FlywayProperties { * Whether to validate migrations and callbacks whose scripts do not obey the correct * naming convention. */ - private boolean validateMigrationNaming = false; + private boolean validateMigrationNaming; /** * Whether to automatically call validate when performing a migration. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/GraphQlProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/GraphQlProperties.java index 443dd854a2e..85067e427f2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/GraphQlProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/GraphQlProperties.java @@ -166,7 +166,7 @@ public class GraphQlProperties { * Whether the endpoint that prints the schema is enabled. Schema is available * under spring.graphql.path + "/schema". */ - private boolean enabled = false; + private boolean enabled; public boolean isEnabled() { return this.enabled; @@ -190,7 +190,7 @@ public class GraphQlProperties { /** * Whether the default GraphiQL UI is enabled. */ - private boolean enabled = false; + private boolean enabled; public String getPath() { return this.path; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleProperties.java index 500c995032a..7ec812160c9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleProperties.java @@ -38,7 +38,7 @@ public class H2ConsoleProperties { /** * Whether to enable the console. */ - private boolean enabled = false; + private boolean enabled; private final Settings settings = new Settings(); @@ -70,12 +70,12 @@ public class H2ConsoleProperties { /** * Whether to enable trace output. */ - private boolean trace = false; + private boolean trace; /** * Whether to enable remote access. */ - private boolean webAllowOthers = false; + private boolean webAllowOthers; /** * Password to access preferences and tools of H2 Console. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationProperties.java index 30808358bc8..2764170bedf 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationProperties.java @@ -127,7 +127,7 @@ public class IntegrationProperties { * Whether to throw an exception when a reply is not expected anymore by a * gateway. */ - private boolean throwExceptionOnLateReply = false; + private boolean throwExceptionOnLateReply; /** * List of message header names that should not be populated into Message diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonProperties.java index 643da59ae6f..632ceac6e44 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonProperties.java @@ -110,7 +110,7 @@ public class JacksonProperties { * Time zone used when formatting dates. For instance, "America/Los_Angeles" or * "GMT+10". */ - private TimeZone timeZone = null; + private TimeZone timeZone; /** * Locale used for formatting. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java index 9ed0893691c..5a24dae7be4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java @@ -37,7 +37,7 @@ public class JmsProperties { /** * Whether the default destination type is topic. */ - private boolean pubSubDomain = false; + private boolean pubSubDomain; /** * Connection factory JNDI name. When set, takes precedence to others connection @@ -48,7 +48,7 @@ public class JmsProperties { /** * Whether the subscription is durable. */ - private boolean subscriptionDurable = false; + private boolean subscriptionDurable; /** * Client id of the connection. @@ -115,7 +115,7 @@ public class JmsProperties { /** * Whether to cache message consumers. */ - private boolean consumers = false; + private boolean consumers; /** * Whether to cache message producers. @@ -423,7 +423,7 @@ public class JmsProperties { /** * Whether to use transacted sessions. */ - private boolean transacted = false; + private boolean transacted; public AcknowledgeMode getAcknowledgeMode() { return this.acknowledgeMode; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java index 84684c8772b..8b8a993a95b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java @@ -67,7 +67,7 @@ public class ActiveMQProperties { * Whether to stop message delivery before re-delivering messages from a rolled back * transaction. This implies that message order is not preserved when this is enabled. */ - private boolean nonBlockingRedelivery = false; + private boolean nonBlockingRedelivery; /** * Time to wait on message sends for a response. Set it to 0 to wait forever. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxProperties.java index 501d0e5dd1e..752d1c0f205 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxProperties.java @@ -31,12 +31,12 @@ public class JmxProperties { /** * Expose Spring's management beans to the JMX domain. */ - private boolean enabled = false; + private boolean enabled; /** * Whether unique runtime object names should be ensured. */ - private boolean uniqueNames = false; + private boolean uniqueNames; /** * MBeanServer bean name. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java index c531a7443f9..5c7490fb662 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java @@ -1057,13 +1057,13 @@ public class KafkaProperties { * Whether the container should fail to start if at least one of the configured * topics are not present on the broker. */ - private boolean missingTopicsFatal = false; + private boolean missingTopicsFatal; /** * Whether the container stops after the current record is processed or after all * the records from the previous poll are processed. */ - private boolean immediateStop = false; + private boolean immediateStop; /** * Whether to auto start the container. @@ -1658,7 +1658,7 @@ public class KafkaProperties { /** * Multiplier to use for generating the next backoff delay. */ - private double multiplier = 0.0; + private double multiplier; /** * Maximum wait between retries. If less than the delay then the default @@ -1669,7 +1669,7 @@ public class KafkaProperties { /** * Whether to have the backoff delays. */ - private boolean random = false; + private boolean random; public Duration getDelay() { return this.delay; @@ -1714,12 +1714,12 @@ public class KafkaProperties { /** * Cleanup the application’s local state directory on startup. */ - private boolean onStartup = false; + private boolean onStartup; /** * Cleanup the application’s local state directory on shutdown. */ - private boolean onShutdown = false; + private boolean onShutdown; public boolean isOnStartup() { return this.onStartup; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java index ec76b855763..1658b1d7ca2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java @@ -142,13 +142,13 @@ public class LdapProperties { * Whether PartialResultException should be ignored in searches through the * LdapTemplate. */ - private boolean ignorePartialResultException = false; + private boolean ignorePartialResultException; /** * Whether NameNotFoundException should be ignored in searches through the * LdapTemplate. */ - private boolean ignoreNameNotFoundException = false; + private boolean ignoreNameNotFoundException; /** * Whether SizeLimitExceededException should be ignored in searches through the diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapProperties.java index e4d8066f639..f169f39e670 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapProperties.java @@ -37,7 +37,7 @@ public class EmbeddedLdapProperties { /** * Embedded LDAP port. */ - private int port = 0; + private int port; /** * Embedded LDAP credentials. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailProperties.java index f4623d048a7..5a526b94a13 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mail/MailProperties.java @@ -151,7 +151,7 @@ public class MailProperties { * Whether to enable SSL support. If enabled, 'mail.(protocol).ssl.enable' * property is set to 'true'. */ - private boolean enabled = false; + private boolean enabled; /** * SSL bundle name. If set, 'mail.(protocol).ssl.socketFactory' property is set to diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java index 4a824ebc70b..02b13112ff4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java @@ -59,7 +59,7 @@ public class MongoProperties { /** * Mongo server port. Ignored if 'uri' is set. */ - private Integer port = null; + private Integer port; /** * Additional server hosts. Ignored if 'uri' is set or if 'host' is omitted. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/StandardMongoClientSettingsBuilderCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/StandardMongoClientSettingsBuilderCustomizer.java index bbdf0fce271..ec21b30a3d9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/StandardMongoClientSettingsBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/StandardMongoClientSettingsBuilderCustomizer.java @@ -45,7 +45,7 @@ public class StandardMongoClientSettingsBuilderCustomizer implements MongoClient private final SslBundles sslBundles; - private int order = 0; + private int order; public StandardMongoClientSettingsBuilderCustomizer(ConnectionString connectionString, UuidRepresentation uuidRepresentation, MongoProperties.Ssl ssl, SslBundles sslBundles) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mustache/MustacheProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mustache/MustacheProperties.java index 6644c4cd687..533433d7cfd 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mustache/MustacheProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mustache/MustacheProperties.java @@ -157,13 +157,13 @@ public class MustacheProperties { * Whether HttpServletRequest attributes are allowed to override (hide) controller * generated model attributes of the same name. */ - private boolean allowRequestOverride = false; + private boolean allowRequestOverride; /** * Whether HttpSession attributes are allowed to override (hide) controller * generated model attributes of the same name. */ - private boolean allowSessionOverride = false; + private boolean allowSessionOverride; /** * Whether to enable template caching. @@ -179,13 +179,13 @@ public class MustacheProperties { * Whether all request attributes should be added to the model prior to merging * with the template. */ - private boolean exposeRequestAttributes = false; + private boolean exposeRequestAttributes; /** * Whether all HttpSession attributes should be added to the model prior to * merging with the template. */ - private boolean exposeSessionAttributes = false; + private boolean exposeSessionAttributes; /** * Whether to expose a RequestContext for use by Spring's macro library, under the diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/neo4j/Neo4jProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/neo4j/Neo4jProperties.java index f4eebd69ff2..a037d4e09a4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/neo4j/Neo4jProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/neo4j/Neo4jProperties.java @@ -151,12 +151,12 @@ public class Neo4jProperties { /** * Whether to enable metrics. */ - private boolean metricsEnabled = false; + private boolean metricsEnabled; /** * Whether to log leaked sessions. */ - private boolean logLeakedSessions = false; + private boolean logLeakedSessions; /** * Maximum amount of connections in the connection pool towards a single database. @@ -236,7 +236,7 @@ public class Neo4jProperties { /** * Whether the driver should use encrypted traffic. */ - private boolean encrypted = false; + private boolean encrypted; /** * Trust strategy to use. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java index cc7cebb01e6..2ad1832edab 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java @@ -62,12 +62,12 @@ public class JpaProperties { /** * Whether to initialize the schema on startup. */ - private boolean generateDdl = false; + private boolean generateDdl; /** * Whether to enable logging of SQL statements. */ - private boolean showSql = false; + private boolean showSql; /** * Register OpenEntityManagerInViewInterceptor. Binds a JPA EntityManager to the diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/pulsar/PulsarProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/pulsar/PulsarProperties.java index 1bfff3808c9..131d14c727e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/pulsar/PulsarProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/pulsar/PulsarProperties.java @@ -369,7 +369,7 @@ public class PulsarProperties { * Whether to throw an exception if any failure is encountered during server * shutdown while enforcing stop policy on functions. */ - private boolean propagateStopFailures = false; + private boolean propagateStopFailures; public boolean isFailFast() { return this.failFast; @@ -588,13 +588,13 @@ public class PulsarProperties { /** * Priority level for shared subscription consumers. */ - private int priorityLevel = 0; + private int priorityLevel; /** * Whether to read messages from the compacted topic rather than the full message * backlog. */ - private boolean readCompacted = false; + private boolean readCompacted; /** * Dead letter policy to use. @@ -610,7 +610,7 @@ public class PulsarProperties { /** * Whether to auto retry messages. */ - private boolean retryEnable = false; + private boolean retryEnable; public String getName() { return this.name; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzProperties.java index fa2bc10f32f..82307f1bab1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzProperties.java @@ -61,12 +61,12 @@ public class QuartzProperties { /** * Whether to wait for running jobs to complete on shutdown. */ - private boolean waitForJobsToCompleteOnShutdown = false; + private boolean waitForJobsToCompleteOnShutdown; /** * Whether configured jobs should overwrite existing job definitions. */ - private boolean overwriteExistingJobs = false; + private boolean overwriteExistingJobs; /** * Additional Quartz Scheduler properties. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/r2dbc/R2dbcProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/r2dbc/R2dbcProperties.java index edd7309cd69..770428ea69c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/r2dbc/R2dbcProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/r2dbc/R2dbcProperties.java @@ -139,7 +139,7 @@ public class R2dbcProperties { /** * Minimal number of idle connections. */ - private int minIdle = 0; + private int minIdle; /** * Maximum amount of time that a connection is allowed to sit idle in the pool. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/server/servlet/OAuth2AuthorizationServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/server/servlet/OAuth2AuthorizationServerProperties.java index 48403ac2df3..a6af4e9d626 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/server/servlet/OAuth2AuthorizationServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/server/servlet/OAuth2AuthorizationServerProperties.java @@ -47,7 +47,7 @@ public class OAuth2AuthorizationServerProperties implements InitializingBean { * the issuer identifier enables supporting multiple issuers per host in a * multi-tenant hosting configuration. */ - private boolean multipleIssuersAllowed = false; + private boolean multipleIssuersAllowed; /** * Registered clients of the Authorization Server. @@ -273,12 +273,12 @@ public class OAuth2AuthorizationServerProperties implements InitializingBean { * Whether the client is required to provide a proof key challenge and verifier * when performing the Authorization Code Grant flow. */ - private boolean requireProofKey = false; + private boolean requireProofKey; /** * Whether authorization consent is required when the client requests access. */ - private boolean requireAuthorizationConsent = false; + private boolean requireAuthorizationConsent; /** * URL for the client's JSON Web Key Set. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/sql/init/SqlInitializationProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/sql/init/SqlInitializationProperties.java index dcfdf2c234d..f76d9f5c0b8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/sql/init/SqlInitializationProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/sql/init/SqlInitializationProperties.java @@ -63,7 +63,7 @@ public class SqlInitializationProperties { /** * Whether initialization should continue when an error occurs. */ - private boolean continueOnError = false; + private boolean continueOnError; /** * Statement separator in the schema and data scripts. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/AbstractTemplateViewResolverProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/AbstractTemplateViewResolverProperties.java index 8f81cc5d925..fb93853887a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/AbstractTemplateViewResolverProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/AbstractTemplateViewResolverProperties.java @@ -49,19 +49,19 @@ public abstract class AbstractTemplateViewResolverProperties extends AbstractVie * Whether all request attributes should be added to the model prior to merging with * the template. */ - private boolean exposeRequestAttributes = false; + private boolean exposeRequestAttributes; /** * Whether all HttpSession attributes should be added to the model prior to merging * with the template. */ - private boolean exposeSessionAttributes = false; + private boolean exposeSessionAttributes; /** * Whether HttpServletRequest attributes are allowed to override (hide) controller * generated model attributes of the same name. */ - private boolean allowRequestOverride = false; + private boolean allowRequestOverride; /** * Whether to expose a RequestContext for use by Spring's macro library, under the @@ -73,7 +73,7 @@ public abstract class AbstractTemplateViewResolverProperties extends AbstractVie * Whether HttpSession attributes are allowed to override (hide) controller generated * model attributes of the same name. */ - private boolean allowSessionOverride = false; + private boolean allowSessionOverride; protected AbstractTemplateViewResolverProperties(String defaultPrefix, String defaultSuffix) { this.prefix = defaultPrefix; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafProperties.java index a95bfeb5819..560d39d9d21 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafProperties.java @@ -104,7 +104,7 @@ public class ThymeleafProperties { * Whether hidden form inputs acting as markers for checkboxes should be rendered * before the checkbox element itself. */ - private boolean renderHiddenMarkersBeforeCheckboxes = false; + private boolean renderHiddenMarkersBeforeCheckboxes; /** * Whether to enable Thymeleaf view resolution for Web frameworks. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 397e77499b1..857ef7cc65f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -265,7 +265,7 @@ public class ServerProperties { /** * Whether to register the default Servlet with the container. */ - private boolean registerDefaultServlet = false; + private boolean registerDefaultServlet; @NestedConfigurationProperty private final Encoding encoding = new Encoding(); @@ -726,7 +726,7 @@ public class ServerProperties { /** * Enable access log. */ - private boolean enabled = false; + private boolean enabled; /** * Whether logging of the request will only be enabled if @@ -777,7 +777,7 @@ public class ServerProperties { * Whether to check for log file existence so it can be recreated if an * external process has renamed it. */ - private boolean checkExists = false; + private boolean checkExists; /** * Whether to enable access log rotation. @@ -788,7 +788,7 @@ public class ServerProperties { * Whether to defer inclusion of the date stamp in the file name until rotate * time. */ - private boolean renameOnRotate = false; + private boolean renameOnRotate; /** * Number of days to retain the access log files before they are removed. @@ -803,13 +803,13 @@ public class ServerProperties { /** * Whether to use IPv6 canonical representation format as defined by RFC 5952. */ - private boolean ipv6Canonical = false; + private boolean ipv6Canonical; /** * Set request attributes for the IP address, Hostname, protocol, and port * used for the request. */ - private boolean requestAttributesEnabled = false; + private boolean requestAttributesEnabled; /** * Whether to buffer output such that it is flushed only periodically. @@ -1286,7 +1286,7 @@ public class ServerProperties { /** * Enable access log. */ - private boolean enabled = false; + private boolean enabled; /** * Log format. @@ -1653,7 +1653,7 @@ public class ServerProperties { * application that requires it. Has no effect when server.undertow.decode-slash * is set. */ - private boolean allowEncodedSlash = false; + private boolean allowEncodedSlash; /** * Whether encoded slash characters (%2F) should be decoded. Decoding can cause @@ -1689,7 +1689,7 @@ public class ServerProperties { /** * Whether to preserve the path of a request when it is forwarded. */ - private boolean preservePathOnForward = false; + private boolean preservePathOnForward; private final Accesslog accesslog = new Accesslog(); @@ -1835,7 +1835,7 @@ public class ServerProperties { /** * Whether to enable the access log. */ - private boolean enabled = false; + private boolean enabled; /** * Format pattern for access logs. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebProperties.java index 70ebcabb41b..4add69a6e9d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebProperties.java @@ -99,7 +99,7 @@ public class WebProperties { */ private boolean addMappings = true; - private boolean customized = false; + private boolean customized; private final Chain chain = new Chain(); @@ -149,7 +149,7 @@ public class WebProperties { */ public static class Chain { - boolean customized = false; + boolean customized; /** * Whether to enable the Spring Resource Handling chain. By default, disabled @@ -167,7 +167,7 @@ public class WebProperties { * brotli). Checks for a resource name with the '.gz' or '.br' file * extensions. */ - private boolean compressed = false; + private boolean compressed; private final Strategy strategy = new Strategy(); @@ -243,7 +243,7 @@ public class WebProperties { */ public static class Content { - private boolean customized = false; + private boolean customized; /** * Whether to enable the content Version Strategy. @@ -284,7 +284,7 @@ public class WebProperties { */ public static class Fixed { - private boolean customized = false; + private boolean customized; /** * Whether to enable the fixed Version Strategy. @@ -343,7 +343,7 @@ public class WebProperties { */ public static class Cache { - private boolean customized = false; + private boolean customized; /** * Cache period for the resources served by the resource handler. If a @@ -395,7 +395,7 @@ public class WebProperties { */ public static class Cachecontrol { - private boolean customized = false; + private boolean customized; /** * Maximum time the response should be cached, in seconds if no duration diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxProperties.java index d6f3f8f7812..30d9ed214a4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxProperties.java @@ -147,7 +147,7 @@ public class WebFluxProperties { /** * Whether RFC 9457 Problem Details support should be enabled. */ - private boolean enabled = false; + private boolean enabled; public boolean isEnabled() { return this.enabled; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartProperties.java index 2029b0a2340..df775f23120 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartProperties.java @@ -78,13 +78,13 @@ public class MultipartProperties { * Whether to resolve the multipart request lazily at the time of file or parameter * access. */ - private boolean resolveLazily = false; + private boolean resolveLazily; /** * Whether to resolve the multipart request strictly complying with the Servlet * specification, only to be used for "multipart/form-data" requests. */ - private boolean strictServletCompliance = false; + private boolean strictServletCompliance; public boolean getEnabled() { return this.enabled; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java index f737abbc721..0a290b8f7e8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java @@ -49,7 +49,7 @@ public class WebMvcProperties { /** * Whether to dispatch TRACE requests to the FrameworkServlet doService method. */ - private boolean dispatchTraceRequest = false; + private boolean dispatchTraceRequest; /** * Whether to dispatch OPTIONS requests to the FrameworkServlet doService method. @@ -71,7 +71,7 @@ public class WebMvcProperties { * Whether to enable warn logging of exceptions resolved by a * "HandlerExceptionResolver", except for "DefaultHandlerExceptionResolver". */ - private boolean logResolvedException = false; + private boolean logResolvedException; /** * Path pattern used for static resources. @@ -304,7 +304,7 @@ public class WebMvcProperties { * Whether a request parameter ("format" by default) should be used to determine * the requested media type. */ - private boolean favorParameter = false; + private boolean favorParameter; /** * Map file extensions to media types for content negotiation. For instance, yml @@ -430,7 +430,7 @@ public class WebMvcProperties { /** * Whether RFC 9457 Problem Details support should be enabled. */ - private boolean enabled = false; + private boolean enabled; public boolean isEnabled() { return this.enabled; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java index 2491c1f12f6..e8672799dda 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java @@ -610,7 +610,7 @@ class BatchAutoConfigurationTests { Job discreteJob() { AbstractJob job = new AbstractJob("discreteRegisteredJob") { - private static int count = 0; + private static int count; @Override public Collection getStepNames() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/graphql/GraphQlAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/graphql/GraphQlAutoConfigurationTests.java index 8c5df42fd97..d5d41fbc375 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/graphql/GraphQlAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/graphql/GraphQlAutoConfigurationTests.java @@ -323,7 +323,7 @@ class GraphQlAutoConfigurationTests { public static class CustomRuntimeWiringConfigurer implements RuntimeWiringConfigurer { - public boolean applied = false; + public boolean applied; @Override public void configure(RuntimeWiring.Builder builder) { @@ -343,7 +343,7 @@ class GraphQlAutoConfigurationTests { public static class CustomGraphQlSourceBuilderCustomizer implements GraphQlSourceBuilderCustomizer { - public boolean applied = false; + public boolean applied; @Override public void customize(GraphQlSource.SchemaResourceBuilder builder) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java index dc9edd3ccb3..7b824150c40 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java @@ -150,7 +150,7 @@ class JmxAutoConfigurationTests { @ManagedResource public static class Counter { - private int counter = 0; + private int counter; @ManagedAttribute public int get() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ssl/FileWatcherTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ssl/FileWatcherTests.java index 17c93461b4a..8802c9a369c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ssl/FileWatcherTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ssl/FileWatcherTests.java @@ -336,7 +336,7 @@ class FileWatcherTests { private CountDownLatch latch = new CountDownLatch(1); - volatile boolean changed = false; + volatile boolean changed; @Override public void run() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java index ee56c534e04..10747762c95 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java @@ -970,7 +970,7 @@ class WebFluxAutoConfigurationTests { @Configuration(proxyBeanMethods = false) static class CustomRequestMappingHandlerAdapter { - private int handlerAdapters = 0; + private int handlerAdapters; @Bean WebFluxRegistrations webFluxRegistrationsHandlerAdapter() { @@ -1001,7 +1001,7 @@ class WebFluxAutoConfigurationTests { @Configuration(proxyBeanMethods = false) static class CustomRequestMappingHandlerMapping { - private int handlerMappings = 0; + private int handlerMappings; @Bean WebFluxRegistrations webFluxRegistrationsHandlerMapping() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorFactoryConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorFactoryConfigurationTests.java index b9b0fcfa8f5..046d430fd62 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorFactoryConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorFactoryConfigurationTests.java @@ -68,7 +68,7 @@ class ClientHttpConnectorFactoryConfigurationTests { static class CustomHttpClientMapper { - static boolean called = false; + static boolean called; @Bean ReactorNettyHttpClientMapper clientMapper() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java index 0103718118b..fc879df81f5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java @@ -1206,7 +1206,7 @@ class WebMvcAutoConfigurationTests { @Configuration(proxyBeanMethods = false) static class CustomRequestMappingHandlerAdapter { - private int handlerAdapters = 0; + private int handlerAdapters; @Bean WebMvcRegistrations webMvcRegistrationsHandlerAdapter() { @@ -1230,7 +1230,7 @@ class WebMvcAutoConfigurationTests { @Configuration(proxyBeanMethods = false) static class CustomExceptionHandlerExceptionResolver { - private int exceptionResolvers = 0; + private int exceptionResolvers; @Bean WebMvcRegistrations webMvcRegistrationsExceptionResolver() { diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/RestarterTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/RestarterTests.java index 2bb2ab7076d..b708b9f647b 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/RestarterTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/RestarterTests.java @@ -200,7 +200,7 @@ class RestarterTests { @EnableScheduling static class SampleApplication { - private int count = 0; + private int count; private static final AtomicBoolean restart = new AtomicBoolean(); @@ -228,7 +228,7 @@ class RestarterTests { static class CloseCountingApplicationListener implements ApplicationListener { - static int closed = 0; + static int closed; @Override public void onApplicationEvent(ContextClosedEvent event) { diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java index 08eaa83c3d4..4168419d512 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java @@ -48,10 +48,10 @@ import static org.assertj.core.api.Assertions.assertThat; abstract class AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests { @LocalServerPort - private int port = 0; + private int port; @Value("${value}") - private int value = 0; + private int value; @Autowired private ReactiveWebApplicationContext context; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java index 41cdab37151..7d3a23f4ca7 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java @@ -46,10 +46,10 @@ import static org.assertj.core.api.Assertions.assertThat; abstract class AbstractSpringBootTestWebServerWebEnvironmentTests { @LocalServerPort - private int port = 0; + private int port; @Value("${value}") - private int value = 0; + private int value; @Autowired private WebApplicationContext context; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentMockTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentMockTests.java index 36a4102cc84..41c20004682 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentMockTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentMockTests.java @@ -46,7 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat; class SpringBootTestWebEnvironmentMockTests { @Value("${value}") - private int value = 0; + private int value; @Autowired private WebApplicationContext context; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/ResetMocksTestExecutionListenerTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/ResetMocksTestExecutionListenerTests.java index 5563f2135d5..673b7285741 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/ResetMocksTestExecutionListenerTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/ResetMocksTestExecutionListenerTests.java @@ -181,7 +181,7 @@ class ResetMocksTestExecutionListenerTests { static class NonSingletonFactoryBean implements FactoryBean { - private int getObjectInvocations = 0; + private int getObjectInvocations; @Override public ExampleService getObject() { diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/scan/SimpleFactoryBean.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/scan/SimpleFactoryBean.java index b7ddaf8360f..7c1d9ca8b1a 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/scan/SimpleFactoryBean.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/scan/SimpleFactoryBean.java @@ -31,7 +31,7 @@ import org.springframework.stereotype.Component; @SuppressWarnings("rawtypes") public class SimpleFactoryBean implements FactoryBean { - private static boolean isInitializedEarly = false; + private static boolean isInitializedEarly; public SimpleFactoryBean() { isInitializedEarly = true; diff --git a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/ImportTestcontainersTests.java b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/ImportTestcontainersTests.java index ddd62c23049..d343e7eabaa 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/ImportTestcontainersTests.java +++ b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/ImportTestcontainersTests.java @@ -143,7 +143,7 @@ class ImportTestcontainersTests { @ImportTestcontainers static class NullContainer { - static PostgreSQLContainer container = null; + static PostgreSQLContainer container; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java index e0ba96e7039..bec2416432e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java @@ -82,7 +82,7 @@ public class DockerApi { private final SystemApi system; - private volatile ApiVersion apiVersion = null; + private volatile ApiVersion apiVersion; /** * Create a new {@link DockerApi} instance. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/socket/FileDescriptorTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/socket/FileDescriptorTests.java index 6f849a2c3f0..748551ea20a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/socket/FileDescriptorTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/socket/FileDescriptorTests.java @@ -31,7 +31,7 @@ class FileDescriptorTests { private final int sourceHandle = 123; - private int closedHandle = 0; + private int closedHandle; @Test void acquireReturnsHandle() throws Exception { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/CacheSpec.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/CacheSpec.java index e08b812e403..5039121731f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/CacheSpec.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/CacheSpec.java @@ -36,7 +36,7 @@ public class CacheSpec { private final ObjectFactory objectFactory; - private Cache cache = null; + private Cache cache; @Inject public CacheSpec(ObjectFactory objectFactory) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-classic/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-classic/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java index 558dcfd06ca..d7c6868f820 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-classic/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-classic/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java @@ -378,7 +378,7 @@ class JarFileEntries implements CentralDirectoryVisitor, Iterable { private final Runnable validator; - private int index = 0; + private int index; private EntryIterator(Runnable validator) { this.validator = validator; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/SizeCalculatingEntryWriter.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/SizeCalculatingEntryWriter.java index fe3688a335b..b7b0c85f30f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/SizeCalculatingEntryWriter.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/SizeCalculatingEntryWriter.java @@ -86,7 +86,7 @@ final class SizeCalculatingEntryWriter implements EntryWriter { */ private static class SizeCalculatingOutputStream extends OutputStream { - private int size = 0; + private int size; private File tempFile; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/VirtualDataBlock.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/VirtualDataBlock.java index 7a8f6caa934..18527ca33e8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/VirtualDataBlock.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/VirtualDataBlock.java @@ -34,7 +34,7 @@ class VirtualDataBlock implements DataBlock { private long size; - private volatile int lastReadPart = 0; + private volatile int lastReadPart; /** * Create a new {@link VirtualDataBlock} instance. The {@link #setParts(Collection)} diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationShutdownHook.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationShutdownHook.java index 9e5a9d9e6d0..676401ef18e 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationShutdownHook.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationShutdownHook.java @@ -63,7 +63,7 @@ class SpringApplicationShutdownHook implements Runnable { private final AtomicBoolean shutdownHookAdded = new AtomicBoolean(); - private volatile boolean shutdownHookAdditionEnabled = false; + private volatile boolean shutdownHookAdditionEnabled; private boolean inProgress; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootExceptionHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootExceptionHandler.java index 2e870065b53..d05c307766a 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootExceptionHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootExceptionHandler.java @@ -46,7 +46,7 @@ class SpringBootExceptionHandler implements UncaughtExceptionHandler { private final List loggedExceptions = new ArrayList<>(); - private int exitCode = 0; + private int exitCode; SpringBootExceptionHandler(UncaughtExceptionHandler parent) { this.parent = parent; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java index 7035318dd79..9999502499f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java @@ -191,7 +191,7 @@ public class LoggingApplicationListener implements GenericApplicationListener { private boolean parseArgs = true; - private LogLevel springBootLogging = null; + private LogLevel springBootLogging; @Override public boolean supportsEventType(ResolvableType resolvableType) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java index 28cade4f179..7688d59b955 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java @@ -318,7 +318,7 @@ class SpringIterableConfigurationPropertySource extends SpringConfigurationPrope private final ConfigurationPropertyName[] names; - private int index = 0; + private int index; ConfigurationPropertyNamesIterator(ConfigurationPropertyName[] names) { this.names = names; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/GracefulShutdown.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/GracefulShutdown.java index 0d535c6243f..9b3efdb7151 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/GracefulShutdown.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/GracefulShutdown.java @@ -45,7 +45,7 @@ final class GracefulShutdown { private final Supplier activeRequests; - private volatile boolean aborted = false; + private volatile boolean aborted; GracefulShutdown(Server server, Supplier activeRequests) { this.server = server; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/GracefulShutdown.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/GracefulShutdown.java index e1a7a17532a..69a3450c4bd 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/GracefulShutdown.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/GracefulShutdown.java @@ -44,7 +44,7 @@ final class GracefulShutdown { private final Tomcat tomcat; - private volatile boolean aborted = false; + private volatile boolean aborted; GracefulShutdown(Tomcat tomcat) { this.tomcat = tomcat; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/NestedJarResourceSet.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/NestedJarResourceSet.java index 75864f80b50..40a58d37543 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/NestedJarResourceSet.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/NestedJarResourceSet.java @@ -47,9 +47,9 @@ class NestedJarResourceSet extends AbstractSingleArchiveResourceSet { private final URL url; - private JarFile archive = null; + private JarFile archive; - private long archiveUseCount = 0; + private long archiveUseCount; private boolean useCaches; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java index 702f2dcb0f6..976a05022ca 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java @@ -73,7 +73,7 @@ public class UndertowWebServer implements WebServer { private Undertow undertow; - private volatile boolean started = false; + private volatile boolean started; private volatile GracefulShutdownHandler gracefulShutdown; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Compression.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Compression.java index 83ed8ed9e6b..9d72f8693a0 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Compression.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Compression.java @@ -33,7 +33,7 @@ public class Compression { private String[] mimeTypes = new String[] { "text/html", "text/xml", "text/plain", "text/css", "text/javascript", "application/javascript", "application/json", "application/xml" }; - private String[] excludedUserAgents = null; + private String[] excludedUserAgents; private DataSize minResponseSize = DataSize.ofKilobytes(2); diff --git a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java index bd22ac33811..c43f12be1ff 100644 --- a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java +++ b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java @@ -565,7 +565,7 @@ class PaketoBuilderTests { private static class DigestCapturingCondition extends Condition { - private static String digest = null; + private static String digest; DigestCapturingCondition() { super(predicate(), "a value starting with 'sha256:'"); diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeTimer.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeTimer.java index b400194a88c..2b90d0a4e78 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeTimer.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeTimer.java @@ -40,7 +40,7 @@ public final class SnakeTimer { private static final ConcurrentHashMap snakes = new ConcurrentHashMap<>(); - private static Timer gameTimer = null; + private static Timer gameTimer; private SnakeTimer() { } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeTimer.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeTimer.java index bfd9c41f918..2c4563cb58d 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeTimer.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeTimer.java @@ -40,7 +40,7 @@ public final class SnakeTimer { private static final ConcurrentHashMap snakes = new ConcurrentHashMap<>(); - private static Timer gameTimer = null; + private static Timer gameTimer; private SnakeTimer() { } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeTimer.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeTimer.java index 8d01c7f6d99..366c4b69784 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeTimer.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeTimer.java @@ -40,7 +40,7 @@ public final class SnakeTimer { private static final ConcurrentHashMap snakes = new ConcurrentHashMap<>(); - private static Timer gameTimer = null; + private static Timer gameTimer; private SnakeTimer() { } diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index 22731f7a60d..40117798128 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -13,6 +13,7 @@ +