From 6853e1adad6221341618e66fb549df3913aec88f Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Fri, 22 Jan 2021 06:09:58 -0500 Subject: [PATCH] remove unreachable catch block --- .../maven/shared/utils/cli/CommandLineUtils.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) 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(); }