diff --git a/src/main/java/com/beust/jcommander/JCommander.java b/src/main/java/com/beust/jcommander/JCommander.java index 714b6647..71b34ec8 100644 --- a/src/main/java/com/beust/jcommander/JCommander.java +++ b/src/main/java/com/beust/jcommander/JCommander.java @@ -363,7 +363,7 @@ public void parseWithoutValidation(String... args) { private void parse(boolean validate, String... args) { StringBuilder sb = new StringBuilder("Parsing \""); - sb.append(Strings.join(" ", args)).append("\"\n with:").append(Strings.join(" ", objects.toArray())); + sb.append(String.join(" ", args)).append("\"\n with:").append(Strings.join(" ", objects.toArray())); p(sb.toString()); if (descriptions == null) createDescriptions(); @@ -394,9 +394,9 @@ private void validateOptions() { if (!requiredFields.isEmpty()) { List missingFields = new ArrayList<>(); requiredFields.values().forEach(pd -> - missingFields.add("[" + Strings.join(" | ", pd.getParameter().names()) + "]") + missingFields.add("[" + String.join(" | ", pd.getParameter().names()) + "]") ); - String message = Strings.join(", ", missingFields); + String message = String.join(", ", missingFields); throw new ParameterException("The following " + pluralize(requiredFields.size(), "option is required: ", "options are required: ") + message); diff --git a/src/main/java/com/beust/jcommander/Strings.java b/src/main/java/com/beust/jcommander/Strings.java index 74b84e80..423af768 100644 --- a/src/main/java/com/beust/jcommander/Strings.java +++ b/src/main/java/com/beust/jcommander/Strings.java @@ -14,6 +14,7 @@ public static boolean startsWith(String s, String with, boolean isCaseSensitive) return isCaseSensitive ? s.startsWith(with) : s.toLowerCase().startsWith(with.toLowerCase()); } + @Deprecated(forRemoval = true, since = "3.0.0") public static String join(String delimiter, List args) { return String.join(delimiter, args); }