From 998ccbe7dd5094b9df3849c2c8103d23a6137813 Mon Sep 17 00:00:00 2001 From: Markus KARG Date: Mon, 23 Dec 2024 17:05:20 +0000 Subject: [PATCH] Removing StringBuilder in a case where it would be slower than String+ operator --- src/main/java/com/beust/jcommander/JCommander.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/beust/jcommander/JCommander.java b/src/main/java/com/beust/jcommander/JCommander.java index 71b34ec8..827a3d8e 100644 --- a/src/main/java/com/beust/jcommander/JCommander.java +++ b/src/main/java/com/beust/jcommander/JCommander.java @@ -362,9 +362,8 @@ public void parseWithoutValidation(String... args) { } private void parse(boolean validate, String... args) { - StringBuilder sb = new StringBuilder("Parsing \""); - sb.append(String.join(" ", args)).append("\"\n with:").append(Strings.join(" ", objects.toArray())); - p(sb.toString()); + p("Parsing \"" + + String.join(" ", args) + "\"\n with:" + Strings.join(" ", objects.toArray())); if (descriptions == null) createDescriptions(); initializeDefaultValues();