diff --git a/buildSrc/src/main/java/org/springframework/boot/build/antora/AntoraAsciidocAttributes.java b/buildSrc/src/main/java/org/springframework/boot/build/antora/AntoraAsciidocAttributes.java index ce341653e7b5..3d5bec724ae7 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/antora/AntoraAsciidocAttributes.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/antora/AntoraAsciidocAttributes.java @@ -56,7 +56,7 @@ public class AntoraAsciidocAttributes { public AntoraAsciidocAttributes(Project project, BomExtension dependencyBom, Map dependencyVersions) { this.version = String.valueOf(project.getVersion()); - this.latestVersion = Boolean.valueOf(String.valueOf(project.findProperty("latestVersion"))); + this.latestVersion = Boolean.parseBoolean(String.valueOf(project.findProperty("latestVersion"))); this.artifactRelease = ArtifactRelease.forProject(project); this.libraries = dependencyBom.getLibraries(); this.dependencyVersions = dependencyVersions; 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 abc1098e8d37..aad903cc1886 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 @@ -70,36 +70,24 @@ public void checkForProhibitedDependencies() { private boolean prohibited(ModuleVersionIdentifier id) { String group = id.getGroup(); - if (group.equals("javax.batch")) { - return false; - } - if (group.equals("javax.cache")) { - return false; - } - if (group.equals("javax.money")) { - return false; - } - if (group.equals("org.codehaus.groovy")) { - return true; - } - if (group.equals("org.eclipse.jetty.toolchain")) { - return true; + switch (group) { + case "javax.batch", "javax.cache", "javax.money" -> { + return false; + } + case "commons-logging", "org.codehaus.groovy", "org.eclipse.jetty.toolchain", + "org.apache.geronimo.specs" -> { + return true; + } } if (group.startsWith("javax")) { return true; } - if (group.equals("commons-logging")) { - return true; - } if (group.equals("org.slf4j") && id.getName().equals("jcl-over-slf4j")) { return true; } if (group.startsWith("org.jboss.spec")) { return true; } - if (group.equals("org.apache.geronimo.specs")) { - return true; - } return group.equals("com.sun.activation"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionForkParameterizedTests.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionForkParameterizedTests.java index 2a1bc4f47e55..2e94dcd3ecbe 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionForkParameterizedTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionForkParameterizedTests.java @@ -37,14 +37,10 @@ class ModifiedClassPathExtensionForkParameterizedTests { @ParameterizedTest @ValueSource(strings = { "one", "two", "three" }) void testIsInvokedOnceForEachArgument(String argument) { - if (argument.equals("one")) { - assertThat(arguments).isEmpty(); - } - else if (argument.equals("two")) { - assertThat(arguments).doesNotContain("two", "three"); - } - else if (argument.equals("three")) { - assertThat(arguments).doesNotContain("three"); + switch (argument) { + case "one" -> assertThat(arguments).isEmpty(); + case "two" -> assertThat(arguments).doesNotContain("two", "three"); + case "three" -> assertThat(arguments).doesNotContain("three"); } arguments.add(argument); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystemProperties.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystemProperties.java index a39c8afbdb0a..51a03bb308e5 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystemProperties.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystemProperties.java @@ -219,7 +219,7 @@ private PropertyResolver getPropertyResolver() { if (this.environment instanceof ConfigurableEnvironment configurableEnvironment) { PropertySourcesPropertyResolver resolver = new PropertySourcesPropertyResolver( configurableEnvironment.getPropertySources()); - resolver.setConversionService(((ConfigurableEnvironment) this.environment).getConversionService()); + resolver.setConversionService(configurableEnvironment.getConversionService()); resolver.setIgnoreUnresolvableNestedPlaceholders(true); return resolver; } 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 47a9f5b5711e..6e6606c6a677 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 @@ -128,7 +128,7 @@ protected boolean isMultiRelease() { } } } - return this.multiRelease.booleanValue(); + return this.multiRelease; } @Override