From 4fc2806089b73513904336c19071e5ddc2036d25 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Thu, 6 Sep 2018 20:34:33 +0200 Subject: [PATCH] Polish CommandCompleter Closes gh-14339 --- .../boot/cli/command/shell/CommandCompleter.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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(); }