From 17902c9cec8ec045b02b1983c4776039e8b481f5 Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sun, 21 Jan 2024 17:17:43 +0100 Subject: [PATCH 01/19] Remove unnecessary toString calls See gh-39259 --- .../boot/web/servlet/server/StaticResourceJarsTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/StaticResourceJarsTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/StaticResourceJarsTests.java index 231a20a205..8643e81a54 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/StaticResourceJarsTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/StaticResourceJarsTests.java @@ -95,7 +95,7 @@ class StaticResourceJarsTests { void doesNotCloseJarFromCachedConnection() throws Exception { File jarFile = createResourcesJar("test-resources.jar"); TrackedURLStreamHandler handler = new TrackedURLStreamHandler(true); - URL url = new URL("jar", null, 0, jarFile.toURI().toURL().toString() + "!/", handler); + URL url = new URL("jar", null, 0, jarFile.toURI().toURL() + "!/", handler); try { new StaticResourceJars().getUrlsFrom(url); assertThatNoException() @@ -110,7 +110,7 @@ class StaticResourceJarsTests { void closesJarFromNonCachedConnection() throws Exception { File jarFile = createResourcesJar("test-resources.jar"); TrackedURLStreamHandler handler = new TrackedURLStreamHandler(false); - URL url = new URL("jar", null, 0, jarFile.toURI().toURL().toString() + "!/", handler); + URL url = new URL("jar", null, 0, jarFile.toURI().toURL() + "!/", handler); new StaticResourceJars().getUrlsFrom(url); assertThatIllegalStateException() .isThrownBy(() -> ((JarURLConnection) handler.getConnection()).getJarFile().getComment()) From 9cdd0c3776d09587f93baf6261c621eae60faa09 Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sun, 21 Jan 2024 18:41:22 +0100 Subject: [PATCH 02/19] Remove unnecessary semicolons See gh-39259 --- .../actuate/autoconfigure/info/InfoContributorFallback.java | 2 +- .../metrics/export/signalfx/SignalFxProperties.java | 2 +- .../boot/actuate/autoconfigure/tracing/TracingProperties.java | 2 +- .../boot/autoconfigure/cassandra/CassandraProperties.java | 2 +- .../boot/autoconfigure/jackson/JacksonProperties.java | 2 +- .../org/springframework/boot/test/context/SpringBootTest.java | 2 +- .../org/springframework/boot/context/config/ConfigData.java | 2 +- .../boot/context/config/ConfigDataEnvironmentContributor.java | 2 +- .../boot/context/config/ConfigDataEnvironmentContributors.java | 2 +- .../boot/context/properties/bind/BindMethod.java | 2 +- .../springframework/boot/web/server/GracefulShutdownResult.java | 2 +- .../main/java/org/springframework/boot/web/server/Shutdown.java | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/info/InfoContributorFallback.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/info/InfoContributorFallback.java index 0f78db5cbe..b93e148b4d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/info/InfoContributorFallback.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/info/InfoContributorFallback.java @@ -37,6 +37,6 @@ public enum InfoContributorFallback { /** * Do not fall back, thereby disabling the info contributor. */ - DISABLE; + DISABLE } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxProperties.java index 3a5735537a..d1afe6fd8a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxProperties.java @@ -116,7 +116,7 @@ public class SignalFxProperties extends StepRegistryProperties { /** * Delta histogram. */ - DELTA; + DELTA } 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 ed1514872b..175ff03a81 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 @@ -268,7 +268,7 @@ public class TracingProperties { * B3 * multiple headers propagation. */ - B3_MULTI; + B3_MULTI } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java index bd25ed980f..dcc1b07a1c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java @@ -482,7 +482,7 @@ public class CassandraProperties { /** * No compression. */ - NONE; + NONE } 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 fe3a67e028..31e3da6200 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 @@ -224,7 +224,7 @@ public class JacksonProperties { * Refuse to decide implicit mode and instead throw an InvalidDefinitionException * for ambiguous cases. */ - EXPLICIT_ONLY; + EXPLICIT_ONLY } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java index 95a053363f..7a5cffa038 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java @@ -211,7 +211,7 @@ public @interface SpringBootTest { * that class does not have a main method, a test-specific * {@link SpringApplication} will be used. */ - WHEN_AVAILABLE; + WHEN_AVAILABLE } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java index a4a0cfad1d..1c68b25c43 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java @@ -281,7 +281,7 @@ public final class ConfigData { * profile specific sibling imports. * @since 2.4.5 */ - PROFILE_SPECIFIC; + PROFILE_SPECIFIC } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributor.java index 4311c48e05..d5ffe30834 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributor.java @@ -470,7 +470,7 @@ class ConfigDataEnvironmentContributor implements Iterable Date: Sun, 21 Jan 2024 18:42:27 +0100 Subject: [PATCH 03/19] Inline redundant if statements See gh-39259 --- .../org/springframework/boot/build/bom/BomPlugin.java | 4 +--- .../bom/bomr/version/AbstractDependencyVersion.java | 5 +---- .../bomr/version/ReleaseTrainDependencyVersion.java | 5 +---- .../CheckClasspathForProhibitedDependencies.java | 5 +---- .../CloudFoundryWebEndpointDiscoverer.java | 8 +++----- .../security/reactive/EndpointRequest.java | 4 +--- .../web/servlet/WebDriverContextCustomizer.java | 5 +---- .../mock/mockito/ResetMocksTestExecutionListener.java | 4 +--- .../boot/cli/command/core/HelpCommand.java | 5 +---- .../boot/configurationprocessor/metadata/Metadata.java | 10 ++-------- .../context/properties/migrator/PropertyMigration.java | 7 ++----- ...urationPropertiesCharSequenceToObjectConverter.java | 9 +++------ .../web/servlet/ServletContextInitializerBeans.java | 5 +---- ...beddedServerContainerInvocationContextProvider.java | 5 +---- .../liquibase/SampleLiquibaseApplicationTests.java | 4 +--- .../java/smoketest/websocket/jetty/snake/Location.java | 5 +---- .../smoketest/websocket/tomcat/snake/Location.java | 5 +---- .../smoketest/websocket/undertow/snake/Location.java | 5 +---- 18 files changed, 24 insertions(+), 76 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java index 6cbd5ae787..f4361dc3b7 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java @@ -291,9 +291,7 @@ public class BomPlugin implements Plugin { if ((node.name() instanceof QName qname) && name.equals(qname.getLocalPart())) { return true; } - if (name.equals(node.name())) { - return true; - } + return name.equals(node.name()); } return false; } diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/AbstractDependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/AbstractDependencyVersion.java index 4d17ceefc8..a595718ac7 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/AbstractDependencyVersion.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/AbstractDependencyVersion.java @@ -58,10 +58,7 @@ abstract class AbstractDependencyVersion implements DependencyVersion { return false; } AbstractDependencyVersion other = (AbstractDependencyVersion) obj; - if (!this.comparableVersion.equals(other.comparableVersion)) { - return false; - } - return true; + return this.comparableVersion.equals(other.comparableVersion); } @Override diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java index c9c79bcdc6..12328ee323 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java @@ -127,10 +127,7 @@ final class ReleaseTrainDependencyVersion implements DependencyVersion { return false; } ReleaseTrainDependencyVersion other = (ReleaseTrainDependencyVersion) obj; - if (!this.original.equals(other.original)) { - return false; - } - return true; + return this.original.equals(other.original); } @Override diff --git a/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java b/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java index 548344b731..dc976b2eef 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java @@ -100,10 +100,7 @@ public class CheckClasspathForProhibitedDependencies extends DefaultTask { if (group.equals("org.apache.geronimo.specs")) { return true; } - if (group.equals("com.sun.activation")) { - return true; - } - return false; + return group.equals("com.sun.activation"); } } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java index 173bcbe9e9..5bb1638333 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java @@ -65,11 +65,9 @@ public class CloudFoundryWebEndpointDiscoverer extends WebEndpointDiscoverer { @Override protected boolean isExtensionTypeExposed(Class extensionBeanType) { - if (isHealthEndpointExtension(extensionBeanType) && !isCloudFoundryHealthEndpointExtension(extensionBeanType)) { - // Filter regular health endpoint extensions so a CF version can replace them - return false; - } - return true; + // Filter regular health endpoint extensions so a CF version can replace them + return !isHealthEndpointExtension(extensionBeanType) + || isCloudFoundryHealthEndpointExtension(extensionBeanType); } private boolean isHealthEndpointExtension(Class extensionBeanType) { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java index 050613f1fc..4efc65d05c 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java @@ -136,9 +136,7 @@ public final class EndpointRequest { return true; } String managementContextId = applicationContext.getParent().getId() + ":management"; - if (!managementContextId.equals(applicationContext.getId())) { - return true; - } + return !managementContextId.equals(applicationContext.getId()); } return false; } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverContextCustomizer.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverContextCustomizer.java index 5a7420207d..d79d79d4b8 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverContextCustomizer.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverContextCustomizer.java @@ -39,10 +39,7 @@ class WebDriverContextCustomizer implements ContextCustomizer { if (obj == this) { return true; } - if (obj == null || obj.getClass() != getClass()) { - return false; - } - return true; + return obj != null && obj.getClass() == getClass(); } @Override diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/ResetMocksTestExecutionListener.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/ResetMocksTestExecutionListener.java index b353cd41c6..1c2957d72a 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/ResetMocksTestExecutionListener.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/ResetMocksTestExecutionListener.java @@ -119,9 +119,7 @@ public class ResetMocksTestExecutionListener extends AbstractTestExecutionListen String factoryBeanName = BeanFactory.FACTORY_BEAN_PREFIX + name; if (beanFactory.containsBean(factoryBeanName)) { FactoryBean factoryBean = (FactoryBean) beanFactory.getBean(factoryBeanName); - if (!factoryBean.isSingleton()) { - return false; - } + return factoryBean.isSingleton(); } return true; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HelpCommand.java b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HelpCommand.java index 63291a6b7b..4f4b513b6f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HelpCommand.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HelpCommand.java @@ -81,10 +81,7 @@ public class HelpCommand extends AbstractCommand { } private boolean isHelpShown(Command command) { - if (command instanceof HelpCommand || command instanceof HintCommand) { - return false; - } - return true; + return !(command instanceof HelpCommand) && !(command instanceof HintCommand); } @Override diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/Metadata.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/Metadata.java index 0930084cf4..d65b8dd4ec 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/Metadata.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/Metadata.java @@ -157,10 +157,7 @@ public final class Metadata { if (this.deprecation == null && itemMetadata.getDeprecation() != null) { return false; } - if (this.deprecation != null && !this.deprecation.equals(itemMetadata.getDeprecation())) { - return false; - } - return true; + return this.deprecation == null || this.deprecation.equals(itemMetadata.getDeprecation()); } public MetadataItemCondition ofType(Class dataType) { @@ -348,10 +345,7 @@ public final class Metadata { if (this.value != null && !this.value.equals(valueHint.getValue())) { return false; } - if (this.description != null && !this.description.equals(valueHint.getDescription())) { - return false; - } - return true; + return this.description == null || this.description.equals(valueHint.getDescription()); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertyMigration.java b/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertyMigration.java index 9364679469..24f9410052 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertyMigration.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertyMigration.java @@ -85,11 +85,8 @@ class PropertyMigration { if (replacementType.equals(currentType)) { return true; } - if (replacementType.equals(Duration.class.getName()) - && (currentType.equals(Long.class.getName()) || currentType.equals(Integer.class.getName()))) { - return true; - } - return false; + return replacementType.equals(Duration.class.getName()) + && (currentType.equals(Long.class.getName()) || currentType.equals(Integer.class.getName())); } private static String determineType(ConfigurationMetadataProperty metadata) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesCharSequenceToObjectConverter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesCharSequenceToObjectConverter.java index c97e882102..c89ce7a3a6 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesCharSequenceToObjectConverter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesCharSequenceToObjectConverter.java @@ -90,12 +90,9 @@ final class ConfigurationPropertiesCharSequenceToObjectConverter implements Cond return true; } } - if ((targetType.isArray() || targetType.isCollection()) && !targetType.equals(BYTE_ARRAY)) { - // StringToArrayConverter / StringToCollectionConverter are better than - // ObjectToArrayConverter / ObjectToCollectionConverter - return true; - } - return false; + // StringToArrayConverter / StringToCollectionConverter are better than + // ObjectToArrayConverter / ObjectToCollectionConverter + return (targetType.isArray() || targetType.isCollection()) && !targetType.equals(BYTE_ARRAY); } @Override diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java index e771b5ce26..07a5933faf 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java @@ -332,10 +332,7 @@ public class ServletContextInitializerBeans extends AbstractCollection Date: Sun, 21 Jan 2024 18:44:32 +0100 Subject: [PATCH 04/19] Simplify conditionals See gh-39259 --- .../endpoint/invoke/reflect/OperationMethodParameter.java | 2 +- .../boot/devtools/restart/classloader/ClassLoaderFile.java | 2 +- .../OverrideAutoConfigurationContextCustomizerFactory.java | 2 +- .../boot/loader/net/protocol/jar/JarUrlConnection.java | 6 +++--- .../NotConstructorBoundInjectionFailureAnalyzer.java | 4 ++-- .../properties/bind/DefaultBindConstructorProvider.java | 2 +- .../boot/logging/log4j2/SpringProfileArbiter.java | 2 +- .../boot/web/embedded/tomcat/NestedJarResourceSet.java | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameter.java index a4fa71ebe6..fdda353e31 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameter.java @@ -68,7 +68,7 @@ class OperationMethodParameter implements OperationParameter { if (!ObjectUtils.isEmpty(this.parameter.getAnnotationsByType(Nullable.class))) { return false; } - return (jsr305Present) ? new Jsr305().isMandatory(this.parameter) : true; + return !jsr305Present || new Jsr305().isMandatory(this.parameter); } @Override diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java index d39c569e5e..3073b528f4 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java @@ -55,7 +55,7 @@ public class ClassLoaderFile implements Serializable { */ public ClassLoaderFile(Kind kind, long lastModified, byte[] contents) { Assert.notNull(kind, "Kind must not be null"); - Assert.isTrue((kind != Kind.DELETED) ? contents != null : contents == null, + Assert.isTrue((kind != Kind.DELETED) == (contents != null), () -> "Contents must " + ((kind != Kind.DELETED) ? "not " : "") + "be null"); this.kind = kind; this.lastModified = lastModified; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationContextCustomizerFactory.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationContextCustomizerFactory.java index 664e1e035d..06817411d5 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationContextCustomizerFactory.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationContextCustomizerFactory.java @@ -44,7 +44,7 @@ class OverrideAutoConfigurationContextCustomizerFactory implements ContextCustom } OverrideAutoConfiguration overrideAutoConfiguration = TestContextAnnotationUtils.findMergedAnnotation(testClass, OverrideAutoConfiguration.class); - boolean enabled = (overrideAutoConfiguration != null) ? overrideAutoConfiguration.enabled() : true; + boolean enabled = overrideAutoConfiguration == null || overrideAutoConfiguration.enabled(); return !enabled ? new DisableAutoConfigurationContextCustomizer() : null; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrlConnection.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrlConnection.java index c39bd37a44..2177dae7f1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrlConnection.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrlConnection.java @@ -207,7 +207,7 @@ final class JarUrlConnection extends java.net.JarURLConnection { @Override public boolean getAllowUserInteraction() { - return (this.jarFileConnection != null) ? this.jarFileConnection.getAllowUserInteraction() : false; + return this.jarFileConnection != null && this.jarFileConnection.getAllowUserInteraction(); } @Override @@ -219,7 +219,7 @@ final class JarUrlConnection extends java.net.JarURLConnection { @Override public boolean getUseCaches() { - return (this.jarFileConnection != null) ? this.jarFileConnection.getUseCaches() : true; + return this.jarFileConnection == null || this.jarFileConnection.getUseCaches(); } @Override @@ -231,7 +231,7 @@ final class JarUrlConnection extends java.net.JarURLConnection { @Override public boolean getDefaultUseCaches() { - return (this.jarFileConnection != null) ? this.jarFileConnection.getDefaultUseCaches() : true; + return this.jarFileConnection == null || this.jarFileConnection.getDefaultUseCaches(); } @Override diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/NotConstructorBoundInjectionFailureAnalyzer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/NotConstructorBoundInjectionFailureAnalyzer.java index 228aa5ed48..548eb266ba 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/NotConstructorBoundInjectionFailureAnalyzer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/NotConstructorBoundInjectionFailureAnalyzer.java @@ -61,8 +61,8 @@ class NotConstructorBoundInjectionFailureAnalyzer } private boolean isConstructorBindingConfigurationProperties(InjectionPoint injectionPoint) { - return (injectionPoint != null && injectionPoint.getMember() instanceof Constructor constructor) - ? isConstructorBindingConfigurationProperties(constructor) : false; + return injectionPoint != null && injectionPoint.getMember() instanceof Constructor constructor + && isConstructorBindingConfigurationProperties(constructor); } private boolean isConstructorBindingConfigurationProperties(Constructor constructor) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java index 609b8ebccc..a81d38cfd6 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java @@ -127,7 +127,7 @@ class DefaultBindConstructorProvider implements BindConstructorProvider { return true; } Class userClass = ClassUtils.getUserClass(type); - return (userClass != type) ? isAutowiredPresent(userClass) : false; + return userClass != type && isAutowiredPresent(userClass); } private static Constructor[] getCandidateConstructors(Class type) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java index 6aa7f5421a..461f529f0f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java @@ -53,7 +53,7 @@ final class SpringProfileArbiter implements Arbiter { @Override public boolean isCondition() { - return (this.environment != null) ? this.environment.acceptsProfiles(this.profiles) : false; + return this.environment != null && this.environment.acceptsProfiles(this.profiles); } @PluginBuilderFactory 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 0f1be9560a..77cee0c6a6 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 @@ -124,7 +124,7 @@ class NestedJarResourceSet extends AbstractSingleArchiveResourceSet { // JarFile.isMultiRelease() is final so we must go to the manifest Manifest manifest = getManifest(); Attributes attributes = (manifest != null) ? manifest.getMainAttributes() : null; - this.multiRelease = (attributes != null) ? attributes.containsKey(MULTI_RELEASE) : false; + this.multiRelease = attributes != null && attributes.containsKey(MULTI_RELEASE); } } } From ddb769bf7f144fa365c46533ca58c12bbab94042 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 23 Jan 2024 08:54:52 -0800 Subject: [PATCH 05/19] Polish 'Simplify conditionals' See gh-39259 --- .../endpoint/invoke/reflect/OperationMethodParameter.java | 5 ++++- .../devtools/restart/classloader/ClassLoaderFile.java | 8 ++++++-- ...OverrideAutoConfigurationContextCustomizerFactory.java | 2 +- .../boot/loader/net/protocol/jar/JarUrlConnection.java | 6 +++--- .../properties/bind/DefaultBindConstructorProvider.java | 2 +- .../boot/logging/log4j2/SpringProfileArbiter.java | 2 +- .../boot/web/embedded/tomcat/NestedJarResourceSet.java | 2 +- 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameter.java index fdda353e31..6b3e038859 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameter.java @@ -68,7 +68,10 @@ class OperationMethodParameter implements OperationParameter { if (!ObjectUtils.isEmpty(this.parameter.getAnnotationsByType(Nullable.class))) { return false; } - return !jsr305Present || new Jsr305().isMandatory(this.parameter); + if (jsr305Present) { + return new Jsr305().isMandatory(this.parameter); + } + return true; } @Override diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java index 3073b528f4..9972ee7646 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java @@ -55,8 +55,12 @@ public class ClassLoaderFile implements Serializable { */ public ClassLoaderFile(Kind kind, long lastModified, byte[] contents) { Assert.notNull(kind, "Kind must not be null"); - Assert.isTrue((kind != Kind.DELETED) == (contents != null), - () -> "Contents must " + ((kind != Kind.DELETED) ? "not " : "") + "be null"); + if (kind == Kind.DELETED) { + Assert.isTrue(contents == null, "Contents must be null"); + } + else { + Assert.isTrue(contents != null, "Contents must not be null"); + } this.kind = kind; this.lastModified = lastModified; this.contents = contents; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationContextCustomizerFactory.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationContextCustomizerFactory.java index 06817411d5..5b7ab2976b 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationContextCustomizerFactory.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationContextCustomizerFactory.java @@ -44,7 +44,7 @@ class OverrideAutoConfigurationContextCustomizerFactory implements ContextCustom } OverrideAutoConfiguration overrideAutoConfiguration = TestContextAnnotationUtils.findMergedAnnotation(testClass, OverrideAutoConfiguration.class); - boolean enabled = overrideAutoConfiguration == null || overrideAutoConfiguration.enabled(); + boolean enabled = (overrideAutoConfiguration == null) || overrideAutoConfiguration.enabled(); return !enabled ? new DisableAutoConfigurationContextCustomizer() : null; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrlConnection.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrlConnection.java index 2177dae7f1..edc18cd44e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrlConnection.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrlConnection.java @@ -207,7 +207,7 @@ final class JarUrlConnection extends java.net.JarURLConnection { @Override public boolean getAllowUserInteraction() { - return this.jarFileConnection != null && this.jarFileConnection.getAllowUserInteraction(); + return (this.jarFileConnection != null) && this.jarFileConnection.getAllowUserInteraction(); } @Override @@ -219,7 +219,7 @@ final class JarUrlConnection extends java.net.JarURLConnection { @Override public boolean getUseCaches() { - return this.jarFileConnection == null || this.jarFileConnection.getUseCaches(); + return (this.jarFileConnection == null) || this.jarFileConnection.getUseCaches(); } @Override @@ -231,7 +231,7 @@ final class JarUrlConnection extends java.net.JarURLConnection { @Override public boolean getDefaultUseCaches() { - return this.jarFileConnection == null || this.jarFileConnection.getDefaultUseCaches(); + return (this.jarFileConnection == null) || this.jarFileConnection.getDefaultUseCaches(); } @Override diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java index a81d38cfd6..33da909ac8 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java @@ -127,7 +127,7 @@ class DefaultBindConstructorProvider implements BindConstructorProvider { return true; } Class userClass = ClassUtils.getUserClass(type); - return userClass != type && isAutowiredPresent(userClass); + return (userClass != type) && isAutowiredPresent(userClass); } private static Constructor[] getCandidateConstructors(Class type) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java index 461f529f0f..65dcd3e2d5 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java @@ -53,7 +53,7 @@ final class SpringProfileArbiter implements Arbiter { @Override public boolean isCondition() { - return this.environment != null && this.environment.acceptsProfiles(this.profiles); + return (this.environment != null) && this.environment.acceptsProfiles(this.profiles); } @PluginBuilderFactory 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 77cee0c6a6..a0a003d2ac 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 @@ -124,7 +124,7 @@ class NestedJarResourceSet extends AbstractSingleArchiveResourceSet { // JarFile.isMultiRelease() is final so we must go to the manifest Manifest manifest = getManifest(); Attributes attributes = (manifest != null) ? manifest.getMainAttributes() : null; - this.multiRelease = attributes != null && attributes.containsKey(MULTI_RELEASE); + this.multiRelease = (attributes != null) && attributes.containsKey(MULTI_RELEASE); } } } From fe38cb3b4a4cff997c7e70b4063b51da0f2a019d Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sun, 21 Jan 2024 18:45:31 +0100 Subject: [PATCH 06/19] Use string.repeat() See gh-39259 --- .../org/springframework/boot/loader/zip/ZipStringTests.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/zip/ZipStringTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/zip/ZipStringTests.java index 0716d65aac..0bcdc5f956 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/zip/ZipStringTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/zip/ZipStringTests.java @@ -168,9 +168,7 @@ class ZipStringTests { @Test void zipStringWhenMultiCodePointAtBufferBoundary() throws Exception { StringBuilder source = new StringBuilder(); - for (int i = 0; i < ZipString.BUFFER_SIZE - 1; i++) { - source.append("A"); - } + source.append("A".repeat(ZipString.BUFFER_SIZE - 1)); source.append("\u1EFF"); String charSequence = source.toString(); source.append("suffix"); From 06265ee617dbbfa3e3ebe2cec7233258bc3644f4 Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sun, 21 Jan 2024 18:47:43 +0100 Subject: [PATCH 07/19] Use pattern variables See gh-39259 --- .../bom/bomr/version/ReleaseTrainDependencyVersion.java | 6 ++---- .../properties/migrator/PropertiesMigrationReporter.java | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java index 12328ee323..fc999a2526 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java @@ -64,10 +64,9 @@ final class ReleaseTrainDependencyVersion implements DependencyVersion { @Override public boolean isUpgrade(DependencyVersion candidate, boolean movingToSnapshots) { - if (!(candidate instanceof ReleaseTrainDependencyVersion)) { + if (!(candidate instanceof ReleaseTrainDependencyVersion candidateReleaseTrain)) { return true; } - ReleaseTrainDependencyVersion candidateReleaseTrain = (ReleaseTrainDependencyVersion) candidate; int comparison = this.releaseTrain.compareTo(candidateReleaseTrain.releaseTrain); if (comparison != 0) { return comparison < 0; @@ -88,10 +87,9 @@ final class ReleaseTrainDependencyVersion implements DependencyVersion { @Override public boolean isSnapshotFor(DependencyVersion candidate) { - if (!isSnapshot() || !(candidate instanceof ReleaseTrainDependencyVersion)) { + if (!isSnapshot() || !(candidate instanceof ReleaseTrainDependencyVersion candidateReleaseTrain)) { return false; } - ReleaseTrainDependencyVersion candidateReleaseTrain = (ReleaseTrainDependencyVersion) candidate; return this.releaseTrain.equals(candidateReleaseTrain.releaseTrain); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java b/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java index 85603a7bb0..9872c6ecd3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java @@ -127,8 +127,7 @@ class PropertiesMigrationReporter { new PropertyMigration(match, metadata, determineReplacementMetadata(metadata), false)); } // Prefix match for maps - if (isMapType(metadata) && propertySource instanceof IterableConfigurationPropertySource) { - IterableConfigurationPropertySource iterableSource = (IterableConfigurationPropertySource) propertySource; + if (isMapType(metadata) && propertySource instanceof IterableConfigurationPropertySource iterableSource) { iterableSource.stream() .filter(metadataName::isAncestorOf) .map(propertySource::getConfigurationProperty) From e40f49d173fedc1f3309da0075ab6a5a64b84dfc Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 23 Jan 2024 09:01:43 -0800 Subject: [PATCH 08/19] Polish 'Use pattern variables' See gh-39259 --- .../version/ReleaseTrainDependencyVersion.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java index fc999a2526..6c1e5f3d17 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java @@ -64,21 +64,25 @@ final class ReleaseTrainDependencyVersion implements DependencyVersion { @Override public boolean isUpgrade(DependencyVersion candidate, boolean movingToSnapshots) { - if (!(candidate instanceof ReleaseTrainDependencyVersion candidateReleaseTrain)) { - return true; + if (candidate instanceof ReleaseTrainDependencyVersion candidateReleaseTrain) { + return isUpgrade(candidateReleaseTrain, movingToSnapshots); } - int comparison = this.releaseTrain.compareTo(candidateReleaseTrain.releaseTrain); + return true; + } + + private boolean isUpgrade(ReleaseTrainDependencyVersion candidate, boolean movingToSnapshots) { + int comparison = this.releaseTrain.compareTo(candidate.releaseTrain); if (comparison != 0) { return comparison < 0; } - if (movingToSnapshots && !isSnapshot() && candidateReleaseTrain.isSnapshot()) { + if (movingToSnapshots && !isSnapshot() && candidate.isSnapshot()) { return true; } - comparison = this.type.compareTo(candidateReleaseTrain.type); + comparison = this.type.compareTo(candidate.type); if (comparison != 0) { return comparison < 0; } - return Integer.compare(this.version, candidateReleaseTrain.version) < 0; + return Integer.compare(this.version, candidate.version) < 0; } private boolean isSnapshot() { From 74a7fbea9d8d1633e7ff4b39d994f27039a697f7 Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sun, 21 Jan 2024 18:49:51 +0100 Subject: [PATCH 09/19] Remove redundant boxing See gh-39259 --- .../main/java/smoketest/websocket/jetty/snake/Snake.java | 6 +++--- .../java/smoketest/websocket/jetty/snake/SnakeTimer.java | 4 ++-- .../websocket/jetty/snake/SnakeWebSocketHandler.java | 4 ++-- .../main/java/smoketest/websocket/tomcat/snake/Snake.java | 6 +++--- .../java/smoketest/websocket/tomcat/snake/SnakeTimer.java | 4 ++-- .../websocket/tomcat/snake/SnakeWebSocketHandler.java | 4 ++-- .../main/java/smoketest/websocket/undertow/snake/Snake.java | 6 +++--- .../java/smoketest/websocket/undertow/snake/SnakeTimer.java | 4 ++-- .../websocket/undertow/snake/SnakeWebSocketHandler.java | 4 ++-- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/Snake.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/Snake.java index 0206f06e94..82372c4d24 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/Snake.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/Snake.java @@ -136,12 +136,12 @@ public class Snake { public String getLocationsJson() { synchronized (this.monitor) { StringBuilder sb = new StringBuilder(); - sb.append(String.format("{x: %d, y: %d}", Integer.valueOf(this.head.x), Integer.valueOf(this.head.y))); + sb.append(String.format("{x: %d, y: %d}", this.head.x, this.head.y)); for (Location location : this.tail) { sb.append(','); - sb.append(String.format("{x: %d, y: %d}", Integer.valueOf(location.x), Integer.valueOf(location.y))); + sb.append(String.format("{x: %d, y: %d}", location.x, location.y)); } - return String.format("{'id':%d,'body':[%s]}", Integer.valueOf(this.id), sb); + return String.format("{'id':%d,'body':[%s]}", this.id, sb); } } 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 8a50a492ce..f7a8871e37 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 @@ -50,7 +50,7 @@ public final class SnakeTimer { if (snakes.isEmpty()) { startTimer(); } - snakes.put(Integer.valueOf(snake.getId()), snake); + snakes.put(snake.getId(), snake); } } @@ -60,7 +60,7 @@ public final class SnakeTimer { public static void removeSnake(Snake snake) { synchronized (MONITOR) { - snakes.remove(Integer.valueOf(snake.getId())); + snakes.remove(snake.getId()); if (snakes.isEmpty()) { stopTimer(); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java index dc5ba84e84..515e71b133 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java @@ -69,7 +69,7 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler { StringBuilder sb = new StringBuilder(); for (Iterator iterator = SnakeTimer.getSnakes().iterator(); iterator.hasNext();) { Snake snake = iterator.next(); - sb.append(String.format("{id: %d, color: '%s'}", Integer.valueOf(snake.getId()), snake.getHexColor())); + sb.append(String.format("{id: %d, color: '%s'}", snake.getId(), snake.getHexColor())); if (iterator.hasNext()) { sb.append(','); } @@ -97,7 +97,7 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler { @Override public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception { SnakeTimer.removeSnake(this.snake); - SnakeTimer.broadcast(String.format("{'type': 'leave', 'id': %d}", Integer.valueOf(this.id))); + SnakeTimer.broadcast(String.format("{'type': 'leave', 'id': %d}", this.id)); } } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/Snake.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/Snake.java index e69ff6918d..dbedf53168 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/Snake.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/Snake.java @@ -136,12 +136,12 @@ public class Snake { public String getLocationsJson() { synchronized (this.monitor) { StringBuilder sb = new StringBuilder(); - sb.append(String.format("{x: %d, y: %d}", Integer.valueOf(this.head.x), Integer.valueOf(this.head.y))); + sb.append(String.format("{x: %d, y: %d}", this.head.x, this.head.y)); for (Location location : this.tail) { sb.append(','); - sb.append(String.format("{x: %d, y: %d}", Integer.valueOf(location.x), Integer.valueOf(location.y))); + sb.append(String.format("{x: %d, y: %d}", location.x, location.y)); } - return String.format("{'id':%d,'body':[%s]}", Integer.valueOf(this.id), sb); + return String.format("{'id':%d,'body':[%s]}", this.id, sb); } } 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 0d95ec921d..c50bb9fc29 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 @@ -50,7 +50,7 @@ public final class SnakeTimer { if (snakes.isEmpty()) { startTimer(); } - snakes.put(Integer.valueOf(snake.getId()), snake); + snakes.put(snake.getId(), snake); } } @@ -60,7 +60,7 @@ public final class SnakeTimer { public static void removeSnake(Snake snake) { synchronized (MONITOR) { - snakes.remove(Integer.valueOf(snake.getId())); + snakes.remove(snake.getId()); if (snakes.isEmpty()) { stopTimer(); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java index e69a489bc3..a5dd6a1aab 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java @@ -69,7 +69,7 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler { StringBuilder sb = new StringBuilder(); for (Iterator iterator = SnakeTimer.getSnakes().iterator(); iterator.hasNext();) { Snake snake = iterator.next(); - sb.append(String.format("{id: %d, color: '%s'}", Integer.valueOf(snake.getId()), snake.getHexColor())); + sb.append(String.format("{id: %d, color: '%s'}", snake.getId(), snake.getHexColor())); if (iterator.hasNext()) { sb.append(','); } @@ -97,7 +97,7 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler { @Override public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception { SnakeTimer.removeSnake(this.snake); - SnakeTimer.broadcast(String.format("{'type': 'leave', 'id': %d}", Integer.valueOf(this.id))); + SnakeTimer.broadcast(String.format("{'type': 'leave', 'id': %d}", this.id)); } } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/Snake.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/Snake.java index a9718ead23..55eb35d38d 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/Snake.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/Snake.java @@ -136,12 +136,12 @@ public class Snake { public String getLocationsJson() { synchronized (this.monitor) { StringBuilder sb = new StringBuilder(); - sb.append(String.format("{x: %d, y: %d}", Integer.valueOf(this.head.x), Integer.valueOf(this.head.y))); + sb.append(String.format("{x: %d, y: %d}", this.head.x, this.head.y)); for (Location location : this.tail) { sb.append(','); - sb.append(String.format("{x: %d, y: %d}", Integer.valueOf(location.x), Integer.valueOf(location.y))); + sb.append(String.format("{x: %d, y: %d}", location.x, location.y)); } - return String.format("{'id':%d,'body':[%s]}", Integer.valueOf(this.id), sb); + return String.format("{'id':%d,'body':[%s]}", this.id, sb); } } 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 bb6314e0da..520c485329 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 @@ -50,7 +50,7 @@ public final class SnakeTimer { if (snakes.isEmpty()) { startTimer(); } - snakes.put(Integer.valueOf(snake.getId()), snake); + snakes.put(snake.getId(), snake); } } @@ -60,7 +60,7 @@ public final class SnakeTimer { public static void removeSnake(Snake snake) { synchronized (MONITOR) { - snakes.remove(Integer.valueOf(snake.getId())); + snakes.remove(snake.getId()); if (snakes.isEmpty()) { stopTimer(); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java index da2a326584..6d2553da59 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java @@ -69,7 +69,7 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler { StringBuilder sb = new StringBuilder(); for (Iterator iterator = SnakeTimer.getSnakes().iterator(); iterator.hasNext();) { Snake snake = iterator.next(); - sb.append(String.format("{id: %d, color: '%s'}", Integer.valueOf(snake.getId()), snake.getHexColor())); + sb.append(String.format("{id: %d, color: '%s'}", snake.getId(), snake.getHexColor())); if (iterator.hasNext()) { sb.append(','); } @@ -97,7 +97,7 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler { @Override public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception { SnakeTimer.removeSnake(this.snake); - SnakeTimer.broadcast(String.format("{'type': 'leave', 'id': %d}", Integer.valueOf(this.id))); + SnakeTimer.broadcast(String.format("{'type': 'leave', 'id': %d}", this.id)); } } From ac5a08a49bc62ca079ced99bb97ad76116db38fb Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sun, 21 Jan 2024 18:51:26 +0100 Subject: [PATCH 10/19] Avoid redundant boxing See gh-39259 --- .../boot/actuate/autoconfigure/metrics/MeterValue.java | 2 +- ...nfigurationPropertiesCharSequenceToObjectConverterTests.java | 2 +- .../boot/convert/CharSequenceToObjectConverterTests.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterValue.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterValue.java index d475f8c5d6..3b00fd6be4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterValue.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterValue.java @@ -90,7 +90,7 @@ public final class MeterValue { if (duration != null) { return new MeterValue(duration); } - return new MeterValue(Double.valueOf(value)); + return new MeterValue(Double.parseDouble(value)); } /** diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesCharSequenceToObjectConverterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesCharSequenceToObjectConverterTests.java index 3a81830df6..3b9c12c26b 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesCharSequenceToObjectConverterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesCharSequenceToObjectConverterTests.java @@ -108,7 +108,7 @@ class ConfigurationPropertiesCharSequenceToObjectConverterTests { @Override public Long convert(CharSequence source) { - return Long.valueOf(source.toString()) + 1; + return Long.parseLong(source.toString()) + 1; } } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/CharSequenceToObjectConverterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/CharSequenceToObjectConverterTests.java index 49269b03e5..73b4348655 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/CharSequenceToObjectConverterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/CharSequenceToObjectConverterTests.java @@ -104,7 +104,7 @@ class CharSequenceToObjectConverterTests { @Override public Long convert(CharSequence source) { - return Long.valueOf(source.toString()) + 1; + return Long.parseLong(source.toString()) + 1; } } From cb26c31dd60c8b810339c2dddd4dd33c7ee0f682 Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sun, 21 Jan 2024 18:53:14 +0100 Subject: [PATCH 11/19] Replace explicit type with diamond operator See gh-39259 --- .../boot/gradle/plugin/ApplicationPluginAction.java | 2 +- .../boot/web/servlet/DynamicRegistrationBeanTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java index a4df28854a..3ba91dda77 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java @@ -130,7 +130,7 @@ final class ApplicationPluginAction implements PluginApplicationAction { if (GradleVersion.current().compareTo(GradleVersion.version("8.3")) >= 0) { try { Method filePermissions = copySpec.getClass().getMethod("filePermissions", Action.class); - filePermissions.invoke(copySpec, new Action() { + filePermissions.invoke(copySpec, new Action<>() { @Override public void execute(Object filePermissions) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DynamicRegistrationBeanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DynamicRegistrationBeanTests.java index 70d598c95e..37f91191e8 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DynamicRegistrationBeanTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DynamicRegistrationBeanTests.java @@ -50,7 +50,7 @@ class DynamicRegistrationBeanTests { } private static DynamicRegistrationBean createBean() { - return new DynamicRegistrationBean() { + return new DynamicRegistrationBean<>() { @Override protected Dynamic addRegistration(String description, ServletContext servletContext) { return null; From 316b415e95fed05c20eb33879151f7eb7f8781a9 Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sun, 21 Jan 2024 18:54:01 +0100 Subject: [PATCH 12/19] Use try with resources instead of try-finally See gh-39259 --- .../springframework/boot/loader/jar/NestedJarFileTests.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/NestedJarFileTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/NestedJarFileTests.java index 40a59c7baa..bcbd8a47f5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/NestedJarFileTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/NestedJarFileTests.java @@ -413,7 +413,7 @@ class NestedJarFileTests { } private List collectComments(JarFile jarFile) throws IOException { - try { + try (jarFile) { List comments = new ArrayList<>(); Enumeration entries = jarFile.entries(); while (entries.hasMoreElements()) { @@ -424,9 +424,6 @@ class NestedJarFileTests { } return comments; } - finally { - jarFile.close(); - } } } From 0613034e195ce55f684af11b3e4b71d62bf9b0bf Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sun, 21 Jan 2024 20:03:16 +0100 Subject: [PATCH 13/19] Replace multiple ifs with switch See gh-39259 --- .../jetty/snake/SnakeWebSocketHandler.java | 16 +++++----------- .../tomcat/snake/SnakeWebSocketHandler.java | 16 +++++----------- .../undertow/snake/SnakeWebSocketHandler.java | 16 +++++----------- 3 files changed, 15 insertions(+), 33 deletions(-) diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java index 515e71b133..e79eb2bdb4 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java @@ -80,17 +80,11 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler { @Override protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception { String payload = message.getPayload(); - if ("west".equals(payload)) { - this.snake.setDirection(Direction.WEST); - } - else if ("north".equals(payload)) { - this.snake.setDirection(Direction.NORTH); - } - else if ("east".equals(payload)) { - this.snake.setDirection(Direction.EAST); - } - else if ("south".equals(payload)) { - this.snake.setDirection(Direction.SOUTH); + switch (payload) { + case "west" -> this.snake.setDirection(Direction.WEST); + case "north" -> this.snake.setDirection(Direction.NORTH); + case "east" -> this.snake.setDirection(Direction.EAST); + case "south" -> this.snake.setDirection(Direction.SOUTH); } } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java index a5dd6a1aab..70c6162d79 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java @@ -80,17 +80,11 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler { @Override protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception { String payload = message.getPayload(); - if ("west".equals(payload)) { - this.snake.setDirection(Direction.WEST); - } - else if ("north".equals(payload)) { - this.snake.setDirection(Direction.NORTH); - } - else if ("east".equals(payload)) { - this.snake.setDirection(Direction.EAST); - } - else if ("south".equals(payload)) { - this.snake.setDirection(Direction.SOUTH); + switch (payload) { + case "west" -> this.snake.setDirection(Direction.WEST); + case "north" -> this.snake.setDirection(Direction.NORTH); + case "east" -> this.snake.setDirection(Direction.EAST); + case "south" -> this.snake.setDirection(Direction.SOUTH); } } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java index 6d2553da59..fbe606e411 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java @@ -80,17 +80,11 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler { @Override protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception { String payload = message.getPayload(); - if ("west".equals(payload)) { - this.snake.setDirection(Direction.WEST); - } - else if ("north".equals(payload)) { - this.snake.setDirection(Direction.NORTH); - } - else if ("east".equals(payload)) { - this.snake.setDirection(Direction.EAST); - } - else if ("south".equals(payload)) { - this.snake.setDirection(Direction.SOUTH); + switch (payload) { + case "west" -> this.snake.setDirection(Direction.WEST); + case "north" -> this.snake.setDirection(Direction.NORTH); + case "east" -> this.snake.setDirection(Direction.EAST); + case "south" -> this.snake.setDirection(Direction.SOUTH); } } From d3c97adf7913a3b9e36f18466521bcf3fde40005 Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sun, 21 Jan 2024 20:05:06 +0100 Subject: [PATCH 14/19] Remove redundant array creation See gh-39259 --- .../boot/buildpack/platform/socket/BsdDomainSocket.java | 2 +- .../boot/buildpack/platform/socket/LinuxDomainSocket.java | 2 +- .../boot/jarmode/layertools/ExtractCommandTests.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/BsdDomainSocket.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/BsdDomainSocket.java index 4fdfeea642..6105373c99 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/BsdDomainSocket.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/BsdDomainSocket.java @@ -75,7 +75,7 @@ class BsdDomainSocket extends DomainSocket { @Override protected List getFieldOrder() { - return Arrays.asList(new String[] { "sunLen", "sunFamily", "sunPath" }); + return Arrays.asList("sunLen", "sunFamily", "sunPath"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/LinuxDomainSocket.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/LinuxDomainSocket.java index 24950d6c9f..09bd1549fc 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/LinuxDomainSocket.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/LinuxDomainSocket.java @@ -72,7 +72,7 @@ class LinuxDomainSocket extends DomainSocket { @Override protected List getFieldOrder() { - return Arrays.asList(new String[] { "sunFamily", "sunPath" }); + return Arrays.asList("sunFamily", "sunPath"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java b/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java index 1ec5a39214..b4e418a679 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java @@ -103,7 +103,7 @@ class ExtractCommandTests { private void timeAttributes(File file) { try { BasicFileAttributes basicAttributes = Files - .getFileAttributeView(file.toPath(), BasicFileAttributeView.class, new LinkOption[0]) + .getFileAttributeView(file.toPath(), BasicFileAttributeView.class) .readAttributes(); assertThat(basicAttributes.lastModifiedTime().to(TimeUnit.SECONDS)) .isEqualTo(LAST_MODIFIED_TIME.to(TimeUnit.SECONDS)); From 15f1e8536bd1ddc7780a4a2c5a5be00cf0fa0a4a Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 23 Jan 2024 09:37:19 -0800 Subject: [PATCH 15/19] Polish 'Remove redundant array creation' See gh-39259 --- .../boot/jarmode/layertools/ExtractCommandTests.java | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java b/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java index b4e418a679..249cfaef8c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java @@ -22,7 +22,6 @@ import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.nio.file.Files; -import java.nio.file.LinkOption; import java.nio.file.attribute.BasicFileAttributeView; import java.nio.file.attribute.BasicFileAttributes; import java.nio.file.attribute.FileTime; From 7f4aaacf42a157cee1e16cf77fa6cd5da3265103 Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sun, 21 Jan 2024 20:06:20 +0100 Subject: [PATCH 16/19] Simplify stream chain operations See gh-39259 --- .../boot/build/bom/bomr/UpgradeDependencies.java | 4 ++-- .../boot/loader/tools/AbstractPackagerTests.java | 2 +- .../boot/testsupport/junit/DisabledOnOsCondition.java | 2 +- .../properties/IncompatibleConfigurationFailureAnalyzer.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java index d85817e36d..13ba197ccf 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java @@ -242,9 +242,9 @@ public abstract class UpgradeDependencies extends DefaultTask { } private boolean isNotProhibited(Library library, DependencyVersion candidate) { - return !library.getProhibitedVersions() + return library.getProhibitedVersions() .stream() - .anyMatch((prohibited) -> prohibited.isProhibited(candidate.toString())); + .noneMatch((prohibited) -> prohibited.isProhibited(candidate.toString())); } private List matchingLibraries() { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java index 1193ce3595..25baeca887 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java @@ -651,7 +651,7 @@ abstract class AbstractPackagerTests

{ expected.add("\\Q" + libraryTwo.getName() + "\\E"); expected.add("^/META-INF/native-image/.*"); assertThat(getPackagedEntryContent("META-INF/native-image/argfile")) - .isEqualTo(expected.stream().collect(Collectors.joining("\n")) + "\n"); + .isEqualTo(String.join("\n", expected) + "\n"); } private File createLibraryJar() throws IOException { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java index 32a08b0e88..542bca5d5b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java @@ -53,7 +53,7 @@ class DisabledOnOsCondition implements ExecutionCondition { String architecture = System.getProperty("os.arch"); String os = System.getProperty("os.name"); boolean onDisabledOs = Arrays.stream(annotation.os()).anyMatch(OS::isCurrentOs); - boolean onDisabledArchitecture = Arrays.stream(annotation.architecture()).anyMatch(architecture::equals); + boolean onDisabledArchitecture = Arrays.asList(annotation.architecture()).contains(architecture); if (onDisabledOs && onDisabledArchitecture) { String reason = annotation.disabledReason().isEmpty() ? String.format("Disabled on OS = %s, architecture = %s", os, architecture) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/IncompatibleConfigurationFailureAnalyzer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/IncompatibleConfigurationFailureAnalyzer.java index 8df1d1e237..b00ada8691 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/IncompatibleConfigurationFailureAnalyzer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/IncompatibleConfigurationFailureAnalyzer.java @@ -32,7 +32,7 @@ class IncompatibleConfigurationFailureAnalyzer extends AbstractFailureAnalyzer Date: Tue, 23 Jan 2024 09:40:26 -0800 Subject: [PATCH 17/19] Polish 'Simplify stream chain operations' See gh-39259 --- .../properties/IncompatibleConfigurationFailureAnalyzer.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/IncompatibleConfigurationFailureAnalyzer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/IncompatibleConfigurationFailureAnalyzer.java index b00ada8691..11128e1844 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/IncompatibleConfigurationFailureAnalyzer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/IncompatibleConfigurationFailureAnalyzer.java @@ -16,8 +16,6 @@ package org.springframework.boot.context.properties; -import java.util.stream.Collectors; - import org.springframework.boot.diagnostics.AbstractFailureAnalyzer; import org.springframework.boot.diagnostics.FailureAnalysis; From 24e0864105d5d051afc29e0238595bda66a5e876 Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sun, 21 Jan 2024 20:14:48 +0100 Subject: [PATCH 18/19] Replace !Optional.isPresent with Optional.isEmpty See gh-39259 --- .../boot/build/bom/bomr/UpgradeDependencies.java | 2 +- .../boot/testsupport/junit/DisabledOnOsCondition.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java index 13ba197ccf..19e897cb82 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java @@ -194,7 +194,7 @@ public abstract class UpgradeDependencies extends DefaultTask { java.util.Optional matchingMilestone = milestones.stream() .filter((milestone) -> milestone.getName().equals(getMilestone().get())) .findFirst(); - if (!matchingMilestone.isPresent()) { + if (matchingMilestone.isEmpty()) { throw new InvalidUserDataException("Unknown milestone: " + getMilestone().get()); } return matchingMilestone.get(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java index 542bca5d5b..c3cad58fc3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java @@ -37,7 +37,7 @@ class DisabledOnOsCondition implements ExecutionCondition { @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { - if (!context.getElement().isPresent()) { + if (context.getElement().isEmpty()) { return ConditionEvaluationResult.enabled("No element for @DisabledOnOs found"); } MergedAnnotation annotation = MergedAnnotations From 8f1a330dd5f256a7588a96fb1814fe59d3471e17 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 23 Jan 2024 09:10:52 -0800 Subject: [PATCH 19/19] Update copyright header of cleaned up code See gh-39259 --- .../main/java/org/springframework/boot/build/bom/BomPlugin.java | 2 +- .../boot/build/bom/bomr/version/AbstractDependencyVersion.java | 2 +- .../build/bom/bomr/version/ReleaseTrainDependencyVersion.java | 2 +- .../classpath/CheckClasspathForProhibitedDependencies.java | 2 +- .../cloudfoundry/CloudFoundryWebEndpointDiscoverer.java | 2 +- .../actuate/autoconfigure/info/InfoContributorFallback.java | 2 +- .../boot/actuate/autoconfigure/metrics/MeterValue.java | 2 +- .../metrics/export/signalfx/SignalFxProperties.java | 2 +- .../autoconfigure/security/reactive/EndpointRequest.java | 2 +- .../boot/autoconfigure/cassandra/CassandraProperties.java | 2 +- .../boot/autoconfigure/jackson/JacksonProperties.java | 2 +- .../boot/devtools/restart/classloader/ClassLoaderFile.java | 2 +- .../autoconfigure/web/servlet/WebDriverContextCustomizer.java | 2 +- .../org/springframework/boot/test/context/SpringBootTest.java | 2 +- .../boot/test/mock/mockito/ResetMocksTestExecutionListener.java | 2 +- .../boot/buildpack/platform/socket/BsdDomainSocket.java | 2 +- .../boot/buildpack/platform/socket/LinuxDomainSocket.java | 2 +- .../org/springframework/boot/cli/command/core/HelpCommand.java | 2 +- .../boot/configurationprocessor/metadata/Metadata.java | 2 +- .../boot/gradle/plugin/ApplicationPluginAction.java | 2 +- .../boot/loader/tools/AbstractPackagerTests.java | 2 +- .../org/springframework/boot/loader/zip/ZipStringTests.java | 2 +- .../properties/migrator/PropertiesMigrationReporter.java | 2 +- .../boot/context/properties/migrator/PropertyMigration.java | 2 +- .../boot/testsupport/junit/DisabledOnOsCondition.java | 2 +- .../org/springframework/boot/context/config/ConfigData.java | 2 +- .../boot/context/config/ConfigDataEnvironmentContributor.java | 2 +- .../boot/context/config/ConfigDataEnvironmentContributors.java | 2 +- .../properties/IncompatibleConfigurationFailureAnalyzer.java | 2 +- .../properties/NotConstructorBoundInjectionFailureAnalyzer.java | 2 +- .../boot/context/properties/bind/BindMethod.java | 2 +- .../context/properties/bind/DefaultBindConstructorProvider.java | 2 +- .../boot/logging/log4j2/SpringProfileArbiter.java | 2 +- .../boot/web/embedded/tomcat/NestedJarResourceSet.java | 2 +- .../springframework/boot/web/server/GracefulShutdownResult.java | 2 +- .../main/java/org/springframework/boot/web/server/Shutdown.java | 2 +- .../boot/convert/CharSequenceToObjectConverterTests.java | 2 +- .../boot/web/servlet/DynamicRegistrationBeanTests.java | 2 +- .../boot/web/servlet/server/StaticResourceJarsTests.java | 2 +- .../EmbeddedServerContainerInvocationContextProvider.java | 2 +- .../smoketest/liquibase/SampleLiquibaseApplicationTests.java | 2 +- .../src/main/java/smoketest/websocket/jetty/snake/Location.java | 2 +- .../src/main/java/smoketest/websocket/jetty/snake/Snake.java | 2 +- .../main/java/smoketest/websocket/jetty/snake/SnakeTimer.java | 2 +- .../smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java | 2 +- .../main/java/smoketest/websocket/tomcat/snake/Location.java | 2 +- .../src/main/java/smoketest/websocket/tomcat/snake/Snake.java | 2 +- .../main/java/smoketest/websocket/tomcat/snake/SnakeTimer.java | 2 +- .../smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java | 2 +- .../main/java/smoketest/websocket/undertow/snake/Location.java | 2 +- .../src/main/java/smoketest/websocket/undertow/snake/Snake.java | 2 +- .../java/smoketest/websocket/undertow/snake/SnakeTimer.java | 2 +- .../websocket/undertow/snake/SnakeWebSocketHandler.java | 2 +- 53 files changed, 53 insertions(+), 53 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java index f4361dc3b7..0cc7b41890 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/AbstractDependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/AbstractDependencyVersion.java index a595718ac7..d0c74aa2da 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/AbstractDependencyVersion.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/AbstractDependencyVersion.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java index 6c1e5f3d17..e43c1b05d9 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java b/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java index dc976b2eef..abc1098e8d 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java index 5bb1638333..c401f5cf78 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/info/InfoContributorFallback.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/info/InfoContributorFallback.java index b93e148b4d..ce03c3f76a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/info/InfoContributorFallback.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/info/InfoContributorFallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterValue.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterValue.java index 3b00fd6be4..fa429ca765 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterValue.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxProperties.java index d1afe6fd8a..0b9555b9ae 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java index 4efc65d05c..bed3b8f5c0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java index dcc1b07a1c..f2f8cae7e3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. 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 31e3da6200..46162768d4 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java index 9972ee7646..46df7df0d3 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverContextCustomizer.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverContextCustomizer.java index d79d79d4b8..e0c178db3e 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverContextCustomizer.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverContextCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java index 7a5cffa038..41cb55b155 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/ResetMocksTestExecutionListener.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/ResetMocksTestExecutionListener.java index 1c2957d72a..4aedbd3e48 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/ResetMocksTestExecutionListener.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/ResetMocksTestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/BsdDomainSocket.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/BsdDomainSocket.java index 6105373c99..37b597250d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/BsdDomainSocket.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/BsdDomainSocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/LinuxDomainSocket.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/LinuxDomainSocket.java index 09bd1549fc..13490f17fa 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/LinuxDomainSocket.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/LinuxDomainSocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HelpCommand.java b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HelpCommand.java index 4f4b513b6f..6cae752f3f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HelpCommand.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HelpCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/Metadata.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/Metadata.java index d65b8dd4ec..0f4fcb10fd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/Metadata.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/Metadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java index 3ba91dda77..7b29a32685 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java index 25baeca887..7dce78edaf 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/zip/ZipStringTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/zip/ZipStringTests.java index 0bcdc5f956..1f35622d82 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/zip/ZipStringTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/zip/ZipStringTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java b/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java index 9872c6ecd3..c1f7e61796 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertyMigration.java b/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertyMigration.java index 24f9410052..ab69d82130 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertyMigration.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertyMigration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java index c3cad58fc3..3d1f6dc6b3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java index 1c68b25c43..1a9dcf068c 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributor.java index d5ffe30834..dc2dcd45aa 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributors.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributors.java index 1e39978594..ca6bf96784 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributors.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributors.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/IncompatibleConfigurationFailureAnalyzer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/IncompatibleConfigurationFailureAnalyzer.java index 11128e1844..fad96a5812 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/IncompatibleConfigurationFailureAnalyzer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/IncompatibleConfigurationFailureAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/NotConstructorBoundInjectionFailureAnalyzer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/NotConstructorBoundInjectionFailureAnalyzer.java index 548eb266ba..c7c48fe4ca 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/NotConstructorBoundInjectionFailureAnalyzer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/NotConstructorBoundInjectionFailureAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindMethod.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindMethod.java index fe3664449c..0277907965 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindMethod.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java index 33da909ac8..de23e928a2 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DefaultBindConstructorProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java index 65dcd3e2d5..03e9e24947 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. 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 a0a003d2ac..47a9f5b571 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/GracefulShutdownResult.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/GracefulShutdownResult.java index 4cc7eaa1f6..67b2c5e61f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/GracefulShutdownResult.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/GracefulShutdownResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Shutdown.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Shutdown.java index 739234260d..caa22eac98 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Shutdown.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Shutdown.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/CharSequenceToObjectConverterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/CharSequenceToObjectConverterTests.java index 73b4348655..10382dd4e0 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/CharSequenceToObjectConverterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/CharSequenceToObjectConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DynamicRegistrationBeanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DynamicRegistrationBeanTests.java index 37f91191e8..033792e4d9 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DynamicRegistrationBeanTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DynamicRegistrationBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/StaticResourceJarsTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/StaticResourceJarsTests.java index 8643e81a54..050cbb4477 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/StaticResourceJarsTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/StaticResourceJarsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/intTest/java/org/springframework/boot/context/embedded/EmbeddedServerContainerInvocationContextProvider.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/intTest/java/org/springframework/boot/context/embedded/EmbeddedServerContainerInvocationContextProvider.java index 135b677d42..4ed867e3ee 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/intTest/java/org/springframework/boot/context/embedded/EmbeddedServerContainerInvocationContextProvider.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/intTest/java/org/springframework/boot/context/embedded/EmbeddedServerContainerInvocationContextProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/src/test/java/smoketest/liquibase/SampleLiquibaseApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/src/test/java/smoketest/liquibase/SampleLiquibaseApplicationTests.java index b0df8bb338..72038526d3 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/src/test/java/smoketest/liquibase/SampleLiquibaseApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/src/test/java/smoketest/liquibase/SampleLiquibaseApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/Location.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/Location.java index 02390e3a11..563235703d 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/Location.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/Location.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/Snake.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/Snake.java index 82372c4d24..2376d9028b 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/Snake.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/Snake.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. 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 f7a8871e37..8620bb6d02 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java index e79eb2bdb4..625a5c7dfe 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/Location.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/Location.java index 21550e2ba8..62aca98c75 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/Location.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/Location.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/Snake.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/Snake.java index dbedf53168..e20044600c 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/Snake.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/Snake.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. 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 c50bb9fc29..7eef150190 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java index 70c6162d79..2080c9d23a 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/Location.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/Location.java index 16050be98e..d7b3e06c8a 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/Location.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/Location.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/Snake.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/Snake.java index 55eb35d38d..f0d2f29752 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/Snake.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/Snake.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. 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 520c485329..d04b82c8e2 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java index fbe606e411..18b1216cb6 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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.