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:31:32 UTC
[maven-shared-utils] 01/01: clean up comments
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch comment
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git
commit 5a89f40f16f322a2a917f159f3c0f8ed13b978f0
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Fri Jan 22 06:31:19 2021 -0500
clean up comments
---
.../apache/maven/shared/utils/cli/Commandline.java | 86 +++++++++++-----------
1 file changed, 44 insertions(+), 42 deletions(-)
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java b/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java
index db13770..951b44a 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java
@@ -70,16 +70,15 @@ public class Commandline
{
private final List<Arg> arguments = new Vector<Arg>();
- //protected Vector envVars = new Vector();
- // synchronized added to preserve synchronize of Vector class
private final Map<String, String> envVars = Collections.synchronizedMap( new LinkedHashMap<String, String>() );
private Shell shell;
/**
* Create a new command line object.
- * Shell is autodetected from operating system
- * @param shell The shell instance.
+ * Shell is autodetected from operating system.
+ *
+ * @param shell the shell instance
*/
public Commandline( Shell shell )
{
@@ -88,9 +87,9 @@ public class Commandline
/**
* Create a new command line object.
- * Shell is autodetected from operating system
+ * Shell is autodetected from operating system.
*
- * @param toProcess The command to process
+ * @param toProcess the command to process
*/
public Commandline( String toProcess ) throws CommandLineException
{
@@ -108,7 +107,7 @@ public class Commandline
/**
* Create a new command line object.
- * Shell is autodetected from operating system
+ * Shell is autodetected from operating system.
*/
public Commandline()
{
@@ -146,7 +145,7 @@ public class Commandline
* argument class. This method calls
* <code>this.createArgument(false)</code>.</p>
*
- * @return the argument object.
+ * @return the argument object
*/
public Arg createArg()
{
@@ -154,14 +153,14 @@ public class Commandline
}
/**
- * Creates an argument object and adds it to our list of args.
- * <p/>
+ * Creates an argument object and adds it to the list of args.
+ *
* <p>Each commandline object has at most one instance of the
* argument class.</p>
*
* @param insertAtStart if true, the argument is inserted at the
- * beginning of the list of args, otherwise it is appended.
- * @return The arguments.
+ * beginning of the list of args. Otherwise it is appended.
+ * @return the arguments
*/
public Arg createArg( boolean insertAtStart )
{
@@ -179,7 +178,8 @@ public class Commandline
/**
* Sets the executable to run.
- * @param executable The executable.
+ *
+ * @param executable the executable
*/
public void setExecutable( String executable )
{
@@ -187,7 +187,7 @@ public class Commandline
}
/**
- * @return The executable.
+ * @return the executable
*/
public String getExecutable()
{
@@ -196,7 +196,7 @@ public class Commandline
}
/**
- * @param line The arguments.
+ * @param line the arguments
*/
public void addArguments( String... line )
{
@@ -207,9 +207,10 @@ public class Commandline
}
/**
- * Add an environment variable
- * @param name The name of the environment variable.
- * @param value The appropriate value.
+ * Add an environment variable.
+ *
+ * @param name the name of the environment variable
+ * @param value the appropriate value
*/
public void addEnvironment( String name, String value )
{
@@ -218,7 +219,7 @@ public class Commandline
}
/**
- * Add system environment variables
+ * Add system environment variables.
*/
public void addSystemEnvironment()
{
@@ -235,8 +236,9 @@ public class Commandline
}
/**
- * Return the list of environment variables
- * @return an array of all environment variables.
+ * Return the list of environment variables.
+ *
+ * @return an array of all environment variables
*/
public String[] getEnvironmentVariables()
{
@@ -254,7 +256,8 @@ public class Commandline
/**
* Returns the executable and all defined arguments.
- * @return an array of all arguments incl. executable.
+ *
+ * @return an array of all arguments including the executable
*/
public String[] getCommandline()
{
@@ -272,7 +275,7 @@ public class Commandline
}
/**
- * @return the shell, executable and all defined arguments without masking any arguments.
+ * @return the shell, executable and all defined arguments without masking any arguments
*/
private String[] getShellCommandline()
{
@@ -280,7 +283,7 @@ public class Commandline
}
/**
- * @param mask flag to mask any arguments (having his {@code mask} field to {@code true}).
+ * @param mask flag to mask any arguments (having his {@code mask} field to {@code true})
* @return the shell, executable and all defined arguments with masking some arguments if
* {@code mask} parameter is on
*/
@@ -302,10 +305,10 @@ public class Commandline
/**
* Returns all arguments defined by <code>addLine</code>,
- * <code>addValue</code> or the argument object.
+ * <code>addValue</code>, or the argument object.
*
- * @param mask flag to mask any arguments (having his {@code mask} field to {@code true}).
- * @return an array of arguments.
+ * @param mask flag to mask any arguments (having his {@code mask} field to {@code true})
+ * @return an array of arguments
*/
public String[] getArguments( boolean mask )
{
@@ -355,7 +358,8 @@ public class Commandline
/**
* Sets working directory.
- * @param path The to be set as working directory.
+ *
+ * @param path the working directory
*/
public void setWorkingDirectory( String path )
{
@@ -363,8 +367,9 @@ public class Commandline
}
/**
- * Sets execution directory.
- * @param workingDirectory The working directory.
+ * Sets working directory.
+ *
+ * @param workingDirectory the working directory
*/
public void setWorkingDirectory( File workingDirectory )
{
@@ -372,7 +377,7 @@ public class Commandline
}
/**
- * @return The working directory.
+ * @return the working directory
*/
public File getWorkingDirectory()
{
@@ -388,17 +393,16 @@ public class Commandline
}
/**
- * Executes the command.
- * @return The process.
- * @throws CommandLineException in case of errors.
+ * Execute the command.
+ *
+ * @return the process
+ * @throws CommandLineException in case of errors
*/
public Process execute()
throws CommandLineException
{
Process process;
- //addEnvironment( "MAVEN_TEST_ENVAR", "MAVEN_TEST_ENVAR_VALUE" );
-
String[] environment = getEnvironmentVariables();
File workingDir = shell.getWorkingDirectory();
@@ -434,7 +438,7 @@ public class Commandline
}
/**
- * Allows to set the shell to be used in this command line.
+ * Set the shell to be used for this command line.
*
* @param shell the shell
*/
@@ -445,16 +449,14 @@ public class Commandline
/**
* Get the shell to be used in this command line.
- * @return the shell.
+ *
+ * @return the shell
*/
public Shell getShell()
{
return shell;
}
- /**
- *
- */
public static class Argument
implements Arg
{
@@ -510,7 +512,7 @@ public class Commandline
}
/**
- * @return The parts.
+ * @return the parts
*/
private String[] getParts()
{