diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/util/ResourceUtils.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/util/ResourceUtils.java index 7f80f08f26..f3c8e4320e 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/util/ResourceUtils.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/util/ResourceUtils.java @@ -102,7 +102,7 @@ public abstract class ResourceUtils { List result = new ArrayList<>(); for (Resource resource : resources) { if (resource.exists()) { - if (resource.getURI().getScheme().equals("file") && resource.getFile().isDirectory()) { + if ("file".equals(resource.getURI().getScheme()) && resource.getFile().isDirectory()) { result.addAll(getChildFiles(resource)); continue; } @@ -124,7 +124,7 @@ public abstract class ResourceUtils { } private static String absolutePath(Resource resource) throws IOException { - if (!resource.getURI().getScheme().equals("file")) { + if (!"file".equals(resource.getURI().getScheme())) { return resource.getURL().toExternalForm(); } return resource.getFile().getAbsoluteFile().toURI().toString(); diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsWebTestClientBuilderCustomizer.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsWebTestClientBuilderCustomizer.java index 5c034717f9..3c4d141a5f 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsWebTestClientBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsWebTestClientBuilderCustomizer.java @@ -61,7 +61,7 @@ class RestDocsWebTestClientBuilderCustomizer implements WebTestClientBuilderCust if (port == null) { return true; } - return (scheme.equals("http") && port == 80) || (scheme.equals("https") && port == 443); + return ("http".equals(scheme) && port == 80) || ("https".equals(scheme) && port == 443); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LoaderZipEntries.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LoaderZipEntries.java index 24c6f9c323..5b70aab234 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LoaderZipEntries.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LoaderZipEntries.java @@ -50,7 +50,7 @@ class LoaderZipEntries { getClass().getResourceAsStream("/META-INF/loader/spring-boot-loader.jar"))) { java.util.zip.ZipEntry entry = loaderJar.getNextEntry(); while (entry != null) { - if (entry.isDirectory() && !entry.getName().equals("META-INF/")) { + if (entry.isDirectory() && !"META-INF/".equals(entry.getName())) { writeDirectory(new ZipArchiveEntry(entry), zipOutputStream); writtenDirectoriesSpec.add(entry); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java index f13c1659b9..3bbbf3e8b5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java @@ -369,12 +369,12 @@ public class Repackager { @Override public JarArchiveEntry transform(JarArchiveEntry entry) { - if (entry.getName().equals("META-INF/INDEX.LIST")) { + if ("META-INF/INDEX.LIST".equals(entry.getName())) { return null; } - if ((entry.getName().startsWith("META-INF/") && !entry.getName().equals("META-INF/aop.xml") + if ((entry.getName().startsWith("META-INF/") && !"META-INF/aop.xml".equals(entry.getName()) && !entry.getName().endsWith(".kotlin_module")) || entry.getName().startsWith("BOOT-INF/") - || entry.getName().equals("module-info.class")) { + || "module-info.class".equals(entry.getName())) { return entry; } JarArchiveEntry renamedEntry = new JarArchiveEntry(this.namePrefix + entry.getName());