Skip to content

Commit 2143d70

Browse files
committed
Polish boolean members that can use the default false value
1 parent a6f54ec commit 2143d70

File tree

23 files changed

+46
-46
lines changed

23 files changed

+46
-46
lines changed

buildSrc/src/main/java/org/springframework/boot/build/bom/BomExtension.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public static class LibraryHandler {
186186

187187
private final AlignWithHandler alignWith;
188188

189-
private boolean considerSnapshots = false;
189+
private boolean considerSnapshots;
190190

191191
private String version;
192192

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/liquibase/LiquibaseEndpointAutoConfigurationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -87,7 +87,7 @@ static class DataSourceClosingLiquibaseConfiguration {
8787
SpringLiquibase liquibase() {
8888
return new DataSourceClosingSpringLiquibase() {
8989

90-
private boolean propertiesSet = false;
90+
private boolean propertiesSet;
9191

9292
@Override
9393
public void setCloseDataSourceOnceMigrated(boolean closeDataSourceOnceMigrated) {

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jms/JmsHealthIndicatorTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -117,7 +117,7 @@ void whenConnectionStartIsUnresponsiveStatusIsDown() throws JMSException {
117117

118118
private static final class UnresponsiveStartAnswer implements Answer<Void> {
119119

120-
private boolean connectionClosed = false;
120+
private boolean connectionClosed;
121121

122122
private final Object monitor = new Object();
123123

spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -116,7 +116,7 @@ public class Restarter {
116116

117117
private final UncaughtExceptionHandler exceptionHandler;
118118

119-
private boolean finished = false;
119+
private boolean finished;
120120

121121
private final List<ConfigurableApplicationContext> rootContexts = new CopyOnWriteArrayList<>();
122122

spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/AbstractApplicationContextRunner.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -472,9 +472,9 @@ protected static final class RunnerConfiguration<C extends ConfigurableApplicati
472472

473473
private final Supplier<C> contextFactory;
474474

475-
private boolean allowBeanDefinitionOverriding = false;
475+
private boolean allowBeanDefinitionOverriding;
476476

477-
private boolean allowCircularReferences = false;
477+
private boolean allowCircularReferences;
478478

479479
private List<ApplicationContextInitializer<? super C>> initializers = Collections.emptyList();
480480

spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -68,7 +68,7 @@ public class MockServerRestClientCustomizer implements RestClientCustomizer {
6868

6969
private final Supplier<? extends RequestExpectationManager> expectationManagerSupplier;
7070

71-
private boolean bufferContent = false;
71+
private boolean bufferContent;
7272

7373
public MockServerRestClientCustomizer() {
7474
this(SimpleRequestExpectationManager::new);

spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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 class MockServerRestTemplateCustomizer implements RestTemplateCustomizer
7070

7171
private boolean detectRootUri = true;
7272

73-
private boolean bufferContent = false;
73+
private boolean bufferContent;
7474

7575
public MockServerRestTemplateCustomizer() {
7676
this(SimpleRequestExpectationManager::new);

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Phase.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -39,7 +39,7 @@ class Phase {
3939

4040
private final boolean verboseLogging;
4141

42-
private boolean daemonAccess = false;
42+
private boolean daemonAccess;
4343

4444
private final List<String> args = new ArrayList<>();
4545

spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleBuild.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -67,7 +67,7 @@ public class GradleBuild {
6767

6868
private final List<String> expectedDeprecationMessages = new ArrayList<>();
6969

70-
private boolean configurationCache = false;
70+
private boolean configurationCache;
7171

7272
private final Map<String, String> scriptProperties = new HashMap<>();
7373

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
8787
* @since 1.0.0
8888
*/
8989
@Parameter(property = "spring-boot.run.addResources", defaultValue = "false")
90-
private boolean addResources = false;
90+
private boolean addResources;
9191

9292
/**
9393
* Path to agent jars.
@@ -101,7 +101,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
101101
* @since 1.0.0
102102
*/
103103
@Parameter(property = "spring-boot.run.noverify")
104-
private boolean noverify = false;
104+
private boolean noverify;
105105

106106
/**
107107
* Current working directory to use for the application. If not specified, basedir

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ public class SpringApplication {
248248

249249
private boolean allowCircularReferences;
250250

251-
private boolean isCustomEnvironment = false;
251+
private boolean isCustomEnvironment;
252252

253-
private boolean lazyInitialization = false;
253+
private boolean lazyInitialization;
254254

255255
private String environmentPrefix;
256256

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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,9 +61,9 @@ public class SpringApplicationAdminMXBeanRegistrar implements ApplicationContext
6161

6262
private final ObjectName objectName;
6363

64-
private boolean ready = false;
64+
private boolean ready;
6565

66-
private boolean embeddedWebApplication = false;
66+
private boolean embeddedWebApplication;
6767

6868
public SpringApplicationAdminMXBeanRegistrar(String name) throws MalformedObjectNameException {
6969
this.objectName = new ObjectName(name);

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -92,7 +92,7 @@ public class SpringApplicationBuilder {
9292

9393
private boolean registerShutdownHookApplied;
9494

95-
private boolean configuredAsChild = false;
95+
private boolean configuredAsChild;
9696

9797
public SpringApplicationBuilder(Class<?>... sources) {
9898
this(null, sources);

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/sql/init/AbstractScriptDatabaseInitializer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -188,7 +188,7 @@ public static class Scripts implements Iterable<Resource> {
188188

189189
private final List<Resource> resources;
190190

191-
private boolean continueOnError = false;
191+
private boolean continueOnError;
192192

193193
private String separator = ";";
194194

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/sql/init/DatabaseInitializationSettings.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -31,7 +31,7 @@ public class DatabaseInitializationSettings {
3131

3232
private List<String> dataLocations;
3333

34-
private boolean continueOnError = false;
34+
private boolean continueOnError;
3535

3636
private String separator = ";";
3737

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -104,7 +104,7 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac
104104

105105
private boolean eagerFilterInit = true;
106106

107-
private boolean preservePathOnForward = false;
107+
private boolean preservePathOnForward;
108108

109109
/**
110110
* Create a new {@link UndertowServletWebServerFactory} instance.

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServerFactoryDelegate.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -69,7 +69,7 @@ class UndertowWebServerFactoryDelegate {
6969

7070
private String accessLogSuffix;
7171

72-
private boolean accessLogEnabled = false;
72+
private boolean accessLogEnabled;
7373

7474
private boolean accessLogRotate = true;
7575

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Compression.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -28,7 +28,7 @@
2828
*/
2929
public class Compression {
3030

31-
private boolean enabled = false;
31+
private boolean enabled;
3232

3333
private String[] mimeTypes = new String[] { "text/html", "text/xml", "text/plain", "text/css", "text/javascript",
3434
"application/javascript", "application/json", "application/xml" };

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Http2.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -24,7 +24,7 @@
2424
*/
2525
public class Http2 {
2626

27-
private boolean enabled = false;
27+
private boolean enabled;
2828

2929
/**
3030
* Return whether to enable HTTP/2 support, if the current environment supports it.

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -55,7 +55,7 @@ public abstract class AbstractFilterRegistrationBean<T extends Filter> extends D
5555

5656
private EnumSet<DispatcherType> dispatcherTypes;
5757

58-
private boolean matchAfter = false;
58+
private boolean matchAfter;
5959

6060
/**
6161
* Create a new instance to be registered with the specified

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -68,7 +68,7 @@ public abstract class AbstractServletWebServerFactory extends AbstractConfigurab
6868

6969
private Session session = new Session();
7070

71-
private boolean registerDefaultServlet = false;
71+
private boolean registerDefaultServlet;
7272

7373
private MimeMappings mimeMappings = MimeMappings.lazyCopy(MimeMappings.DEFAULT);
7474

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -314,7 +314,7 @@ private static class ErrorWrapperResponse extends HttpServletResponseWrapper {
314314

315315
private String message;
316316

317-
private boolean hasErrorToSend = false;
317+
private boolean hasErrorToSend;
318318

319319
ErrorWrapperResponse(HttpServletResponse response) {
320320
super(response);

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ void registerShutdownHook(Runnable shutdownHook) {
691691

692692
static final class TestCleanupLoggingSystem extends LoggingSystem {
693693

694-
private boolean cleanedUp = false;
694+
private boolean cleanedUp;
695695

696696
TestCleanupLoggingSystem(ClassLoader classLoader) {
697697
}

0 commit comments

Comments
 (0)