Merge pull request #75 from apache/err
libraries should not communicate directly with the end user
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/Arg.java b/src/main/java/org/apache/maven/shared/utils/cli/Arg.java
index e0eccf3..094cbba 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/Arg.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/Arg.java
@@ -27,24 +27,24 @@
public interface Arg
{
/**
- * @param value Set the value.
+ * @param value the value to be set
*/
void setValue( String value );
/**
- * @param line The line of arguments.
+ * @param line the line of arguments
*/
void setLine( String line ) throws CommandLineException;
/**
- * @param value The file to be set.
+ * @param file the file to be set
*/
- void setFile( File value );
+ void setFile( File file );
/**
- * To mask the argument value when a command line ask to print his arguments.
+ * Whether to hide the argument value when a command line prints the arguments.
*
- * @param mask new state of the {@code maks} property
+ * @param mask new state of the {@code mask} property
* @since 0.6
*/
void setMask( boolean mask );
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 @@
}
/**
- * @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 @@
return "";
}
- // path containing one or more elements
final StringBuilder result = new StringBuilder();
for ( int i = 0; i < line.length; i++ )
{
@@ -603,14 +602,7 @@
{
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();
}