From cb9e021fa9d964e3856b88f682c3882d9f3c5e46 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 1 Dec 2016 12:09:41 +0100 Subject: [PATCH 1/4] Polish --- .../ValidationAutoConfigurationWithoutValidatorTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationWithoutValidatorTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationWithoutValidatorTests.java index c1522641d9..963c2f3787 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationWithoutValidatorTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationWithoutValidatorTests.java @@ -28,7 +28,7 @@ import org.springframework.validation.beanvalidation.MethodValidationPostProcess import static org.assertj.core.api.Assertions.assertThat; /** - * Test for {{@link ValidationAutoConfiguration} when no JSR-303 provider is available. + * Test for {@link ValidationAutoConfiguration} when no JSR-303 provider is available. * * @author Stephane Nicoll */ From ac10f6585132192cbbb009ee6b0c395f703c9e4f Mon Sep 17 00:00:00 2001 From: Nicklas Holm Date: Thu, 1 Dec 2016 08:02:44 +0100 Subject: [PATCH 2/4] Fix typo Closes gh-7541 --- .../boot/web/support/SpringBootServletInitializer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot/src/main/java/org/springframework/boot/web/support/SpringBootServletInitializer.java b/spring-boot/src/main/java/org/springframework/boot/web/support/SpringBootServletInitializer.java index 1bed45a303..f184798f21 100644 --- a/spring-boot/src/main/java/org/springframework/boot/web/support/SpringBootServletInitializer.java +++ b/spring-boot/src/main/java/org/springframework/boot/web/support/SpringBootServletInitializer.java @@ -162,7 +162,7 @@ public abstract class SpringBootServletInitializer implements WebApplicationInit } /** - * Configure the application. Normally all you would need to do it add sources (e.g. + * Configure the application. Normally all you would need to do is add sources (e.g. * config classes) because other settings have sensible defaults. You might choose * (for instance) to add default command line arguments, or set an active Spring * profile. From 3a7969b8bbf86af66f064dd6020693c08c76c73b Mon Sep 17 00:00:00 2001 From: Oscar Utbult Date: Wed, 30 Nov 2016 22:18:37 +0100 Subject: [PATCH 3/4] Remove redundant StringBuilder Closes gh-7538 --- .../springframework/boot/loader/PropertiesLauncher.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) mode change 100644 => 100755 spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java old mode 100644 new mode 100755 index 7bc2911fa7..059a9be1e6 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java @@ -536,11 +536,8 @@ public class PropertiesLauncher extends Launcher { return builder.toString(); } - private static Object capitalize(String str) { - StringBuilder sb = new StringBuilder(str.length()); - sb.append(Character.toUpperCase(str.charAt(0))); - sb.append(str.substring(1)); - return sb.toString(); + private static String capitalize(String str) { + return Character.toUpperCase(str.charAt(0)) + str.substring(1); } private void log(String message) { From 0a1009bc421268d797d2b153733bf12667c78eff Mon Sep 17 00:00:00 2001 From: Oscar Utbult Date: Wed, 30 Nov 2016 23:49:34 +0100 Subject: [PATCH 4/4] Use addAll instead of manual array to collection copy Closes gh-7539 --- .../boot/devtools/restart/server/RestartServer.java | 5 ++--- .../ConfigurationWarningsApplicationContextInitializer.java | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) mode change 100644 => 100755 spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/RestartServer.java mode change 100644 => 100755 spring-boot/src/main/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializer.java diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/RestartServer.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/RestartServer.java old mode 100644 new mode 100755 index 3d5244200e..49dcf3db61 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/RestartServer.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/RestartServer.java @@ -20,6 +20,7 @@ import java.io.File; import java.io.IOException; import java.net.URL; import java.net.URLClassLoader; +import java.util.Collections; import java.util.LinkedHashSet; import java.util.Map.Entry; import java.util.Set; @@ -141,9 +142,7 @@ public class RestartServer { ClassLoader classLoader = this.classLoader; while (classLoader != null) { if (classLoader instanceof URLClassLoader) { - for (URL url : ((URLClassLoader) classLoader).getURLs()) { - urls.add(url); - } + Collections.addAll(urls, ((URLClassLoader) classLoader).getURLs()); } classLoader = classLoader.getParent(); } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializer.java b/spring-boot/src/main/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializer.java old mode 100644 new mode 100755 index 37122198d6..bc61b1f561 --- a/spring-boot/src/main/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializer.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializer.java @@ -183,9 +183,7 @@ public class ConfigurationWarningsApplicationContextInitializer private void addPackages(Set packages, String[] values) { if (values != null) { - for (String value : values) { - packages.add(value); - } + Collections.addAll(packages, values); } }