diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/CommandCompleter.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/CommandCompleter.java index 4fbfec961f..c6810b65f0 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/CommandCompleter.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/CommandCompleter.java @@ -127,12 +127,7 @@ public class CommandCompleter extends StringsCompleter { private final String usage; OptionHelpLine(OptionHelp optionHelp) { - StringBuilder options = new StringBuilder(); - for (String option : optionHelp.getOptions()) { - options.append((options.length() != 0) ? ", " : ""); - options.append(option); - } - this.options = options.toString(); + this.options = String.join(", ", optionHelp.getOptions()); this.usage = optionHelp.getUsageHelp(); }