You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2021/01/22 11:10:20 UTC

[maven-shared-utils] branch toString created (now 6853e1a)

This is an automated email from the ASF dual-hosted git repository.

elharo pushed a change to branch toString
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git.


      at 6853e1a  remove unreachable catch block

This branch includes the following new commits:

     new 6853e1a  remove unreachable catch block

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-shared-utils] 01/01: remove unreachable catch block

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch toString
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git

commit 6853e1adad6221341618e66fb549df3913aec88f
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Fri Jan 22 06:09:58 2021 -0500

    remove unreachable catch block
---
 .../apache/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 2ffcfb2..65e88b2 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 @@ public abstract class CommandLineUtils
     }
 
     /**
-     * @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 abstract class CommandLineUtils
             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 abstract class CommandLineUtils
             {
                 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();
     }