Skip to content

Commit e6d5f5a

Browse files
izeyesnicoll
authored andcommitted
Polish
See gh-19995
1 parent afb6788 commit e6d5f5a

File tree

7 files changed

+13
-29
lines changed

7 files changed

+13
-29
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcTags.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private static String getPathInfo(HttpServletRequest request) {
161161
}
162162

163163
/**
164-
* Creates a {@code exception} tag based on the {@link Class#getSimpleName() simple
164+
* Creates an {@code exception} tag based on the {@link Class#getSimpleName() simple
165165
* name} of the class of the given {@code exception}.
166166
* @param exception the exception, may be {@code null}
167167
* @return the exception tag derived from the exception

spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ProjectGenerationRequest {
7171

7272
private String bootVersion;
7373

74-
private List<String> dependencies = new ArrayList<>();
74+
private final List<String> dependencies = new ArrayList<>();
7575

7676
/**
7777
* The URL of the service to use.

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class BootJar extends Jar implements BootArchive {
6969

7070
private static final String BOOT_INF_LAYERS = "BOOT-INF/layers";
7171

72-
private List<String> dependencies = new ArrayList<>();
72+
private final List<String> dependencies = new ArrayList<>();
7373

7474
/**
7575
* Creates a new {@code BootJar} task.
@@ -111,22 +111,11 @@ public void copy() {
111111
}
112112

113113
private File createClasspathIndex(List<String> dependencies) {
114-
try {
115-
StringWriter content = new StringWriter();
116-
BufferedWriter writer = new BufferedWriter(content);
117-
for (String dependency : dependencies) {
118-
writer.write(dependency);
119-
writer.write("\n");
120-
}
121-
writer.flush();
122-
File source = getProject().getResources().getText().fromString(content.toString()).asFile();
123-
File indexFile = new File(source.getParentFile(), "classpath.idx");
124-
source.renameTo(indexFile);
125-
return indexFile;
126-
}
127-
catch (IOException ex) {
128-
throw new RuntimeException("Failed to create classpath.idx", ex);
129-
}
114+
String content = dependencies.stream().collect(Collectors.joining("\n", "", "\n"));
115+
File source = getProject().getResources().getText().fromString(content).asFile();
116+
File indexFile = new File(source.getParentFile(), "classpath.idx");
117+
source.renameTo(indexFile);
118+
return indexFile;
130119
}
131120

132121
@Override

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,6 @@ void loaderIsWrittenFirstThenApplicationClassesThenLibraries() throws IOExceptio
411411
this.libPath + "third-library.jar");
412412
}
413413

414-
@Test
415-
void libEntriesAreStored() throws IOException {
416-
417-
}
418-
419414
protected File jarFile(String name) throws IOException {
420415
File file = newFile(name);
421416
try (JarOutputStream jar = new JarOutputStream(new FileOutputStream(file))) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ protected RunArguments resolveApplicationArguments() {
326326
/**
327327
* Provides access to the java binary executable, regardless of OS.
328328
* @return the java executable
329-
**/
329+
*/
330330
protected String getJavaExecutable() {
331331
Toolchain toolchain = this.toolchainManager.getToolchainFromBuildContext("jdk", this.session);
332332
String javaExecutable = (toolchain != null) ? toolchain.findTool("java") : null;

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public WebServiceTemplateBuilder setCheckConnectionForError(boolean checkConnect
329329
* @param messageFactory the message factory to use for creating messages
330330
* @return a new builder instance.
331331
* @see WebServiceTemplate#setMessageFactory(WebServiceMessageFactory)
332-
**/
332+
*/
333333
public WebServiceTemplateBuilder setWebServiceMessageFactory(WebServiceMessageFactory messageFactory) {
334334
Assert.notNull(messageFactory, "MessageFactory must not be null");
335335
return new WebServiceTemplateBuilder(this.detectHttpMessageSender, this.interceptors, this.internalCustomizers,
@@ -342,7 +342,7 @@ public WebServiceTemplateBuilder setWebServiceMessageFactory(WebServiceMessageFa
342342
* @param unmarshaller the message unmarshaller
343343
* @return a new builder instance.
344344
* @see WebServiceTemplate#setUnmarshaller(Unmarshaller)
345-
**/
345+
*/
346346
public WebServiceTemplateBuilder setUnmarshaller(Unmarshaller unmarshaller) {
347347
return new WebServiceTemplateBuilder(this.detectHttpMessageSender, this.interceptors, this.internalCustomizers,
348348
this.customizers, this.messageSenders, this.marshaller, unmarshaller, this.destinationProvider,
@@ -354,7 +354,7 @@ public WebServiceTemplateBuilder setUnmarshaller(Unmarshaller unmarshaller) {
354354
* @param marshaller the message marshaller
355355
* @return a new builder instance.
356356
* @see WebServiceTemplate#setMarshaller(Marshaller)
357-
**/
357+
*/
358358
public WebServiceTemplateBuilder setMarshaller(Marshaller marshaller) {
359359
return new WebServiceTemplateBuilder(this.detectHttpMessageSender, this.interceptors, this.internalCustomizers,
360360
this.customizers, this.messageSenders, marshaller, this.unmarshaller, this.destinationProvider,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636
@ClassPathExclusions("hibernate-validator-*.jar")
3737
@ClassPathOverrides("javax.validation:validation-api:2.0.1.Final")
38-
class JavaxApiValidationExceptionFailureAnalyzerTests2 {
38+
class JavaxApiValidationExceptionFailureAnalyzerTests {
3939

4040
@Test
4141
void validatedPropertiesTest() {

0 commit comments

Comments
 (0)