diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTags.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTags.java index d6b89e809db2..e4643e6df565 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTags.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTags.java @@ -161,7 +161,7 @@ private static String getPathInfo(HttpServletRequest request) { } /** - * Creates a {@code exception} tag based on the {@link Class#getSimpleName() simple + * Creates an {@code exception} tag based on the {@link Class#getSimpleName() simple * name} of the class of the given {@code exception}. * @param exception the exception, may be {@code null} * @return the exception tag derived from the exception diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java index 8063f03968bb..d82f130cb3b4 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java @@ -71,7 +71,7 @@ class ProjectGenerationRequest { private String bootVersion; - private List dependencies = new ArrayList<>(); + private final List dependencies = new ArrayList<>(); /** * The URL of the service to use. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java index 2ab4948e3ff6..ff7a5302e375 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java @@ -69,7 +69,7 @@ public class BootJar extends Jar implements BootArchive { private static final String BOOT_INF_LAYERS = "BOOT-INF/layers"; - private List dependencies = new ArrayList<>(); + private final List dependencies = new ArrayList<>(); /** * Creates a new {@code BootJar} task. @@ -111,22 +111,11 @@ public void copy() { } private File createClasspathIndex(List dependencies) { - try { - StringWriter content = new StringWriter(); - BufferedWriter writer = new BufferedWriter(content); - for (String dependency : dependencies) { - writer.write(dependency); - writer.write("\n"); - } - writer.flush(); - File source = getProject().getResources().getText().fromString(content.toString()).asFile(); - File indexFile = new File(source.getParentFile(), "classpath.idx"); - source.renameTo(indexFile); - return indexFile; - } - catch (IOException ex) { - throw new RuntimeException("Failed to create classpath.idx", ex); - } + String content = dependencies.stream().collect(Collectors.joining("\n", "", "\n")); + File source = getProject().getResources().getText().fromString(content).asFile(); + File indexFile = new File(source.getParentFile(), "classpath.idx"); + source.renameTo(indexFile); + return indexFile; } @Override diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java index ffffa2f585fa..ccc150c8ca2e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java @@ -411,11 +411,6 @@ void loaderIsWrittenFirstThenApplicationClassesThenLibraries() throws IOExceptio this.libPath + "third-library.jar"); } - @Test - void libEntriesAreStored() throws IOException { - - } - protected File jarFile(String name) throws IOException { File file = newFile(name); try (JarOutputStream jar = new JarOutputStream(new FileOutputStream(file))) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java index e3f0da820c47..d02c77aee9b0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java @@ -326,7 +326,7 @@ protected RunArguments resolveApplicationArguments() { /** * Provides access to the java binary executable, regardless of OS. * @return the java executable - **/ + */ protected String getJavaExecutable() { Toolchain toolchain = this.toolchainManager.getToolchainFromBuildContext("jdk", this.session); String javaExecutable = (toolchain != null) ? toolchain.findTool("java") : null; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java index 6a48e646ef8f..4fa95f0d0070 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java @@ -329,7 +329,7 @@ public WebServiceTemplateBuilder setCheckConnectionForError(boolean checkConnect * @param messageFactory the message factory to use for creating messages * @return a new builder instance. * @see WebServiceTemplate#setMessageFactory(WebServiceMessageFactory) - **/ + */ public WebServiceTemplateBuilder setWebServiceMessageFactory(WebServiceMessageFactory messageFactory) { Assert.notNull(messageFactory, "MessageFactory must not be null"); return new WebServiceTemplateBuilder(this.detectHttpMessageSender, this.interceptors, this.internalCustomizers, @@ -342,7 +342,7 @@ public WebServiceTemplateBuilder setWebServiceMessageFactory(WebServiceMessageFa * @param unmarshaller the message unmarshaller * @return a new builder instance. * @see WebServiceTemplate#setUnmarshaller(Unmarshaller) - **/ + */ public WebServiceTemplateBuilder setUnmarshaller(Unmarshaller unmarshaller) { return new WebServiceTemplateBuilder(this.detectHttpMessageSender, this.interceptors, this.internalCustomizers, this.customizers, this.messageSenders, this.marshaller, unmarshaller, this.destinationProvider, @@ -354,7 +354,7 @@ public WebServiceTemplateBuilder setUnmarshaller(Unmarshaller unmarshaller) { * @param marshaller the message marshaller * @return a new builder instance. * @see WebServiceTemplate#setMarshaller(Marshaller) - **/ + */ public WebServiceTemplateBuilder setMarshaller(Marshaller marshaller) { return new WebServiceTemplateBuilder(this.detectHttpMessageSender, this.interceptors, this.internalCustomizers, this.customizers, this.messageSenders, marshaller, this.unmarshaller, this.destinationProvider, diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/JavaxApiValidationExceptionFailureAnalyzerTests2.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/JavaxApiValidationExceptionFailureAnalyzerTests.java similarity index 97% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/JavaxApiValidationExceptionFailureAnalyzerTests2.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/JavaxApiValidationExceptionFailureAnalyzerTests.java index 39a794d85c08..a1fa0b7b42cb 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/JavaxApiValidationExceptionFailureAnalyzerTests2.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/JavaxApiValidationExceptionFailureAnalyzerTests.java @@ -35,7 +35,7 @@ */ @ClassPathExclusions("hibernate-validator-*.jar") @ClassPathOverrides("javax.validation:validation-api:2.0.1.Final") -class JavaxApiValidationExceptionFailureAnalyzerTests2 { +class JavaxApiValidationExceptionFailureAnalyzerTests { @Test void validatedPropertiesTest() {