diff --git a/src/main/java/org/apache/maven/shared/utils/StringUtils.java b/src/main/java/org/apache/maven/shared/utils/StringUtils.java index 1d046d3f..0cd9e048 100644 --- a/src/main/java/org/apache/maven/shared/utils/StringUtils.java +++ b/src/main/java/org/apache/maven/shared/utils/StringUtils.java @@ -455,7 +455,7 @@ public static String mid(String str, int pos, int len) { * @param str the String to parse * @return an array of parsed Strings * @deprecated use java.lang.String.split() instead. Be careful when migrating. - * String.split()) splits on a regular expression so while it can + * String.split() splits on a regular expression so while it can * do anything this method does, it is not a drop-in replacement. */ @NonNull @@ -470,7 +470,7 @@ public static String[] split(@NonNull String str) { * @return the resulting array * @see #split(String, String, int) * @deprecated use java.lang.String.split() instead. Be careful when migrating. - * String.split()) splits on a regular expression so while it can + * String.split() splits on a regular expression so while it can * do anything this method does, it is not a drop-in replacement. */ @NonNull @@ -497,7 +497,7 @@ public static String[] split(@NonNull String text, @Nullable String separator) { * array. A zero or negative value implies no limit. * @return an array of parsed Strings * @deprecated use java.lang.String.split() instead. Be careful when migrating. - * String.split()) splits on a regular expression so while it can + * String.split() splits on a regular expression so while it can * do anything this method does, it is not a drop-in replacement. */ @NonNull @@ -550,7 +550,10 @@ public static String[] split(@NonNull String str, @Nullable String separator, in * * @param array the array of values to concatenate * @return the concatenated string + * @deprecated use java.lang.String.join() or + * Arrays.stream(array).map(Object::toString).collect(Collectors.joining("")) instead */ + @Deprecated @NonNull public static String concatenate(@NonNull Object... array) { return join(array, ""); @@ -566,7 +569,8 @@ public static String concatenate(@NonNull Object... array) { * @param array the array of values to join together * @param separator the separator character to use * @return the joined String - * @deprecated use java.lang.String.join() instead + * @deprecated use java.lang.String.join() or + * Arrays.stream(array).map(Object::toString).collect(Collectors.joining(separator)) instead */ @Deprecated @NonNull @@ -597,7 +601,7 @@ public static String join(@NonNull Object[] array, @Nullable String separator) { * @param iterator the Iterator of values to join together * @param separator the separator character to use * @return the joined String - * @deprecated use java.lang.String.join() instead + * @deprecated use java.lang.String.join() instead */ @Deprecated @NonNull