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 2026/02/06 21:15:28 UTC

(maven-shared-utils) branch master updated: Remove Cloneable (#365)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new d7bfb27  Remove Cloneable (#365)
d7bfb27 is described below

commit d7bfb27d0bd769f956087dc5b9f890093c891c4b
Author: Elliotte Rusty Harold <el...@users.noreply.github.com>
AuthorDate: Fri Feb 6 21:15:23 2026 +0000

    Remove Cloneable (#365)
---
 .../org/apache/maven/shared/utils/cli/Commandline.java     | 11 +----------
 .../org/apache/maven/shared/utils/cli/shell/Shell.java     | 14 +-------------
 2 files changed, 2 insertions(+), 23 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 02e1ec4..c1f763e 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
@@ -61,7 +61,7 @@ import org.apache.maven.shared.utils.cli.shell.Shell;
  * @author thomas.haas@softwired-inc.com
  * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
  */
-public class Commandline implements Cloneable {
+public class Commandline {
     private final List<Arg> arguments = new Vector<>();
 
     private final Map<String, String> envVars = Collections.synchronizedMap(new LinkedHashMap<>());
@@ -302,15 +302,6 @@ public class Commandline implements Cloneable {
         return StringUtils.join(getShellCommandline(true), " ");
     }
 
-    /**
-     * Do not call. Always throws an UnsupportedOperationException.
-     *
-     * @throws UnsupportedOperationException
-     */
-    public Object clone() {
-        throw new UnsupportedOperationException("Do we ever clone a commandline?");
-    }
-
     /**
      * Sets working directory.
      *
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java b/src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
index e991e5c..c03d768 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
@@ -36,7 +36,7 @@ import org.apache.maven.shared.utils.StringUtils;
  *
  * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
  */
-public class Shell implements Cloneable {
+public class Shell {
     private static final char[] DEFAULT_QUOTING_TRIGGER_CHARS = {' '};
 
     private String shellCommand;
@@ -331,18 +331,6 @@ public class Shell implements Cloneable {
         return workingDir;
     }
 
-    /**
-     * {@inheritDoc}
-     */
-    public Object clone() {
-        throw new RuntimeException("Do we ever clone this?");
-        /*        Shell shell = new Shell();
-        shell.setExecutable( getExecutable() );
-        shell.setWorkingDirectory( getWorkingDirectory() );
-        shell.setShellArgs( getShellArgs() );
-        return shell;*/
-    }
-
     void setSingleQuotedArgumentEscaped(boolean singleQuotedArgumentEscaped) {
         this.singleQuotedArgumentEscaped = singleQuotedArgumentEscaped;
     }