From f0b4a655467dcd9d155667d290d078531e6d9ab5 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Tue, 27 Sep 2022 10:06:17 +0200 Subject: [PATCH] Avoid usage of StringBuffer where possible See gh-32519 --- .../autoconfigure/properties/AnnotationsPropertySource.java | 2 +- .../springframework/boot/loader/tools/DefaultLaunchScript.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java index 770bcaef04..f30495ea2e 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java @@ -111,7 +111,7 @@ public class AnnotationsPropertySource extends EnumerablePropertySource private String toKebabCase(String name) { Matcher matcher = CAMEL_CASE_PATTERN.matcher(name); - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); while (matcher.find()) { matcher.appendReplacement(result, matcher.group(1) + '-' + StringUtils.uncapitalize(matcher.group(2))); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/DefaultLaunchScript.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/DefaultLaunchScript.java index b70bf1b563..55b280e7b3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/DefaultLaunchScript.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/DefaultLaunchScript.java @@ -88,7 +88,7 @@ public class DefaultLaunchScript implements LaunchScript { } private String expandPlaceholders(String content, Map properties) throws IOException { - StringBuffer expanded = new StringBuffer(); + StringBuilder expanded = new StringBuilder(); Matcher matcher = PLACEHOLDER_PATTERN.matcher(content); while (matcher.find()) { String name = matcher.group(1);