Browse Source

Polish boolean members that can use the default `false` value

pull/45202/head
Phillip Webb 8 months ago
parent
commit
2143d702f2
  1. 2
      buildSrc/src/main/java/org/springframework/boot/build/bom/BomExtension.java
  2. 4
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/liquibase/LiquibaseEndpointAutoConfigurationTests.java
  3. 4
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jms/JmsHealthIndicatorTests.java
  4. 4
      spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java
  5. 6
      spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/AbstractApplicationContextRunner.java
  6. 4
      spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizer.java
  7. 4
      spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizer.java
  8. 4
      spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Phase.java
  9. 4
      spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleBuild.java
  10. 4
      spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java
  11. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
  12. 6
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java
  13. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java
  14. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/sql/init/AbstractScriptDatabaseInitializer.java
  15. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/sql/init/DatabaseInitializationSettings.java
  16. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java
  17. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServerFactoryDelegate.java
  18. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Compression.java
  19. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Http2.java
  20. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java
  21. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactory.java
  22. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java
  23. 2
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerTests.java

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

@ -186,7 +186,7 @@ public class BomExtension { @@ -186,7 +186,7 @@ public class BomExtension {
private final AlignWithHandler alignWith;
private boolean considerSnapshots = false;
private boolean considerSnapshots;
private String version;

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -87,7 +87,7 @@ class LiquibaseEndpointAutoConfigurationTests { @@ -87,7 +87,7 @@ class LiquibaseEndpointAutoConfigurationTests {
SpringLiquibase liquibase() {
return new DataSourceClosingSpringLiquibase() {
private boolean propertiesSet = false;
private boolean propertiesSet;
@Override
public void setCloseDataSourceOnceMigrated(boolean closeDataSourceOnceMigrated) {

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -117,7 +117,7 @@ class JmsHealthIndicatorTests { @@ -117,7 +117,7 @@ class JmsHealthIndicatorTests {
private static final class UnresponsiveStartAnswer implements Answer<Void> {
private boolean connectionClosed = false;
private boolean connectionClosed;
private final Object monitor = new Object();

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -116,7 +116,7 @@ public class Restarter { @@ -116,7 +116,7 @@ public class Restarter {
private final UncaughtExceptionHandler exceptionHandler;
private boolean finished = false;
private boolean finished;
private final List<ConfigurableApplicationContext> rootContexts = new CopyOnWriteArrayList<>();

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -472,9 +472,9 @@ public abstract class AbstractApplicationContextRunner<SELF extends AbstractAppl @@ -472,9 +472,9 @@ public abstract class AbstractApplicationContextRunner<SELF extends AbstractAppl
private final Supplier<C> contextFactory;
private boolean allowBeanDefinitionOverriding = false;
private boolean allowBeanDefinitionOverriding;
private boolean allowCircularReferences = false;
private boolean allowCircularReferences;
private List<ApplicationContextInitializer<? super C>> initializers = Collections.emptyList();

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -68,7 +68,7 @@ public class MockServerRestClientCustomizer implements RestClientCustomizer { @@ -68,7 +68,7 @@ public class MockServerRestClientCustomizer implements RestClientCustomizer {
private final Supplier<? extends RequestExpectationManager> expectationManagerSupplier;
private boolean bufferContent = false;
private boolean bufferContent;
public MockServerRestClientCustomizer() {
this(SimpleRequestExpectationManager::new);

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -70,7 +70,7 @@ public class MockServerRestTemplateCustomizer implements RestTemplateCustomizer @@ -70,7 +70,7 @@ public class MockServerRestTemplateCustomizer implements RestTemplateCustomizer
private boolean detectRootUri = true;
private boolean bufferContent = false;
private boolean bufferContent;
public MockServerRestTemplateCustomizer() {
this(SimpleRequestExpectationManager::new);

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -39,7 +39,7 @@ class Phase { @@ -39,7 +39,7 @@ class Phase {
private final boolean verboseLogging;
private boolean daemonAccess = false;
private boolean daemonAccess;
private final List<String> args = new ArrayList<>();

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -67,7 +67,7 @@ public class GradleBuild { @@ -67,7 +67,7 @@ public class GradleBuild {
private final List<String> expectedDeprecationMessages = new ArrayList<>();
private boolean configurationCache = false;
private boolean configurationCache;
private final Map<String, String> scriptProperties = new HashMap<>();

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

@ -87,7 +87,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo { @@ -87,7 +87,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
* @since 1.0.0
*/
@Parameter(property = "spring-boot.run.addResources", defaultValue = "false")
private boolean addResources = false;
private boolean addResources;
/**
* Path to agent jars.
@ -101,7 +101,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo { @@ -101,7 +101,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
* @since 1.0.0
*/
@Parameter(property = "spring-boot.run.noverify")
private boolean noverify = false;
private boolean noverify;
/**
* Current working directory to use for the application. If not specified, basedir

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

@ -248,9 +248,9 @@ public class SpringApplication { @@ -248,9 +248,9 @@ public class SpringApplication {
private boolean allowCircularReferences;
private boolean isCustomEnvironment = false;
private boolean isCustomEnvironment;
private boolean lazyInitialization = false;
private boolean lazyInitialization;
private String environmentPrefix;

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -61,9 +61,9 @@ public class SpringApplicationAdminMXBeanRegistrar implements ApplicationContext @@ -61,9 +61,9 @@ public class SpringApplicationAdminMXBeanRegistrar implements ApplicationContext
private final ObjectName objectName;
private boolean ready = false;
private boolean ready;
private boolean embeddedWebApplication = false;
private boolean embeddedWebApplication;
public SpringApplicationAdminMXBeanRegistrar(String name) throws MalformedObjectNameException {
this.objectName = new ObjectName(name);

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -92,7 +92,7 @@ public class SpringApplicationBuilder { @@ -92,7 +92,7 @@ public class SpringApplicationBuilder {
private boolean registerShutdownHookApplied;
private boolean configuredAsChild = false;
private boolean configuredAsChild;
public SpringApplicationBuilder(Class<?>... sources) {
this(null, sources);

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -188,7 +188,7 @@ public abstract class AbstractScriptDatabaseInitializer implements ResourceLoade @@ -188,7 +188,7 @@ public abstract class AbstractScriptDatabaseInitializer implements ResourceLoade
private final List<Resource> resources;
private boolean continueOnError = false;
private boolean continueOnError;
private String separator = ";";

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -31,7 +31,7 @@ public class DatabaseInitializationSettings { @@ -31,7 +31,7 @@ public class DatabaseInitializationSettings {
private List<String> dataLocations;
private boolean continueOnError = false;
private boolean continueOnError;
private String separator = ";";

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -104,7 +104,7 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac @@ -104,7 +104,7 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac
private boolean eagerFilterInit = true;
private boolean preservePathOnForward = false;
private boolean preservePathOnForward;
/**
* Create a new {@link UndertowServletWebServerFactory} instance.

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -69,7 +69,7 @@ class UndertowWebServerFactoryDelegate { @@ -69,7 +69,7 @@ class UndertowWebServerFactoryDelegate {
private String accessLogSuffix;
private boolean accessLogEnabled = false;
private boolean accessLogEnabled;
private boolean accessLogRotate = true;

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -28,7 +28,7 @@ import org.springframework.util.unit.DataSize; @@ -28,7 +28,7 @@ import org.springframework.util.unit.DataSize;
*/
public class Compression {
private boolean enabled = false;
private boolean enabled;
private String[] mimeTypes = new String[] { "text/html", "text/xml", "text/plain", "text/css", "text/javascript",
"application/javascript", "application/json", "application/xml" };

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -24,7 +24,7 @@ package org.springframework.boot.web.server; @@ -24,7 +24,7 @@ package org.springframework.boot.web.server;
*/
public class Http2 {
private boolean enabled = false;
private boolean enabled;
/**
* Return whether to enable HTTP/2 support, if the current environment supports it.

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* 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 @@ -55,7 +55,7 @@ public abstract class AbstractFilterRegistrationBean<T extends Filter> extends D
private EnumSet<DispatcherType> dispatcherTypes;
private boolean matchAfter = false;
private boolean matchAfter;
/**
* Create a new instance to be registered with the specified

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -68,7 +68,7 @@ public abstract class AbstractServletWebServerFactory extends AbstractConfigurab @@ -68,7 +68,7 @@ public abstract class AbstractServletWebServerFactory extends AbstractConfigurab
private Session session = new Session();
private boolean registerDefaultServlet = false;
private boolean registerDefaultServlet;
private MimeMappings mimeMappings = MimeMappings.lazyCopy(MimeMappings.DEFAULT);

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -314,7 +314,7 @@ public class ErrorPageFilter implements Filter, ErrorPageRegistry, Ordered { @@ -314,7 +314,7 @@ public class ErrorPageFilter implements Filter, ErrorPageRegistry, Ordered {
private String message;
private boolean hasErrorToSend = false;
private boolean hasErrorToSend;
ErrorWrapperResponse(HttpServletResponse response) {
super(response);

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

@ -691,7 +691,7 @@ class LoggingApplicationListenerTests { @@ -691,7 +691,7 @@ class LoggingApplicationListenerTests {
static final class TestCleanupLoggingSystem extends LoggingSystem {
private boolean cleanedUp = false;
private boolean cleanedUp;
TestCleanupLoggingSystem(ClassLoader classLoader) {
}

Loading…
Cancel
Save