You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/12/29 16:14:38 UTC

(commons-exec) 06/12: Only use this in ctors and setters

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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-exec.git

commit 32f9ba8c89d7f989b7d095c239fa20b969b33cb8
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Dec 29 11:01:08 2023 -0500

    Only use this in ctors and setters
---
 src/main/java/org/apache/commons/exec/CommandLine.java | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/commons/exec/CommandLine.java b/src/main/java/org/apache/commons/exec/CommandLine.java
index 4e789299..4d488ed5 100644
--- a/src/main/java/org/apache/commons/exec/CommandLine.java
+++ b/src/main/java/org/apache/commons/exec/CommandLine.java
@@ -229,7 +229,7 @@ public class CommandLine {
      * @throws IllegalArgumentException If argument contains both single and double quotes
      */
     public CommandLine addArgument(final String argument) {
-        return this.addArgument(argument, true);
+        return addArgument(argument, true);
     }
 
     /**
@@ -263,7 +263,7 @@ public class CommandLine {
      * @return The command line itself
      */
     public CommandLine addArguments(final String addArguments) {
-        return this.addArguments(addArguments, true);
+        return addArguments(addArguments, true);
     }
 
     /**
@@ -290,7 +290,7 @@ public class CommandLine {
      * @return The command line itself
      */
     public CommandLine addArguments(final String[] addArguments) {
-        return this.addArguments(addArguments, true);
+        return addArguments(addArguments, true);
     }
 
     /**
@@ -306,7 +306,6 @@ public class CommandLine {
                 addArgument(addArgument, handleQuoting);
             }
         }
-
         return this;
     }
 
@@ -317,7 +316,7 @@ public class CommandLine {
      * @return the expanded string
      */
     private String expandArgument(final String argument) {
-        final StringBuffer stringBuffer = StringUtils.stringSubstitution(argument, this.getSubstitutionMap(), true);
+        final StringBuffer stringBuffer = StringUtils.stringSubstitution(argument, getSubstitutionMap(), true);
         return stringBuffer.toString();
     }
 
@@ -414,7 +413,7 @@ public class CommandLine {
      */
     public String[] toStrings() {
         final String[] result = new String[arguments.size() + 1];
-        result[0] = this.getExecutable();
+        result[0] = getExecutable();
         System.arraycopy(getArguments(), 0, result, 1, result.length - 1);
         return result;
     }