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/03 02:24:19 UTC

(maven-shared-utils) branch MSHARED-1261 created (now bbacca1)

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

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


      at bbacca1  Remove Cloneable

This branch includes the following new commits:

     new bbacca1  Remove Cloneable

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 Cloneable

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

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

commit bbacca1d163efcacb3e7d55387789d555275f8d5
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Mon Feb 2 20:23:59 2026 -0600

    Remove Cloneable
---
 .../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;
     }