diff --git a/src/main/java/org/apache/maven/shared/utils/cli/CommandLineUtils.java b/src/main/java/org/apache/maven/shared/utils/cli/CommandLineUtils.java index 2ffcfb24..65e88b29 100644 --- a/src/main/java/org/apache/maven/shared/utils/cli/CommandLineUtils.java +++ b/src/main/java/org/apache/maven/shared/utils/cli/CommandLineUtils.java @@ -584,8 +584,8 @@ else if ( " ".equals( nextTok ) ) } /** - * @param line The line - * @return The concatenate lines. + * @param line the lines + * @return the concatenated lines, quoted and escaped, separated by spaces */ public static String toString( String... line ) { @@ -595,7 +595,6 @@ public static String toString( String... line ) return ""; } - // path containing one or more elements final StringBuilder result = new StringBuilder(); for ( int i = 0; i < line.length; i++ ) { @@ -603,14 +602,7 @@ public static String toString( String... line ) { result.append( ' ' ); } - try - { - result.append( StringUtils.quoteAndEscape( line[i], '\"' ) ); - } - catch ( Exception e ) - { - System.err.println( "Error quoting argument: " + e.getMessage() ); - } + result.append( StringUtils.quoteAndEscape( line[i], '\"' ) ); } return result.toString(); }