From 1a081ce36c980c69e993d410428cc2fe51d13933 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Thu, 6 Sep 2018 20:34:33 +0200 Subject: [PATCH] Polish CommandCompleter --- .../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 4fbfec961ff5..c6810b65f02b 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 @@ private static class OptionHelpLine { 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(); }