ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types Commandline.java CommandlineJava.java Path.java
Date Wed, 09 Aug 2000 06:20:31 GMT
bodewig     00/08/08 23:20:31

  Modified:    src/main/org/apache/tools/ant/types Commandline.java
                        CommandlineJava.java Path.java
  Log:
  Added some (deep) clone methods.
  
  Revision  Changes    Path
  1.7       +8 -1      jakarta-ant/src/main/org/apache/tools/ant/types/Commandline.java
  
  Index: Commandline.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/Commandline.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Commandline.java	2000/08/07 13:58:35	1.6
  +++ Commandline.java	2000/08/09 06:20:30	1.7
  @@ -82,7 +82,7 @@
    * @author thomas.haas@softwired-inc.com
    * @author <a href="mailto:stefan.bodewig@megabit.net">Stefan Bodewig</a> 
    */
  -public class Commandline {
  +public class Commandline implements Clonable {
   
       private Vector arguments = new Vector();
       private String executable = null;
  @@ -333,6 +333,13 @@
   
       public int size() {
           return getCommandline().length;
  +    }
  +
  +    public Object clone() {
  +        Commandline c = new Commandline();
  +        c.setExecutable(executable);
  +        c.addArguments(getArguments());
  +        return c;
       }
   
   }
  
  
  
  1.4       +10 -1     jakarta-ant/src/main/org/apache/tools/ant/types/CommandlineJava.java
  
  Index: CommandlineJava.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/CommandlineJava.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CommandlineJava.java	2000/07/31 12:09:32	1.3
  +++ CommandlineJava.java	2000/08/09 06:20:30	1.4
  @@ -60,7 +60,7 @@
    *
    * @author thomas.haas@softwired-inc.com
    */
  -public class CommandlineJava {
  +public class CommandlineJava implements Cloneable {
   
       private Commandline vmCommand = new Commandline();
       private Commandline javaCommand = new Commandline();
  @@ -150,5 +150,14 @@
   
       public Path getClasspath() {
           return classpath;
  +    }
  +
  +    public Object clone() {
  +        CommandlineJava c = new CommandlineJava();
  +        c.vmCommand = (Commandline) vmCommand.clone();
  +        c.javaCommand = (Commandline) javaCommand.clone();
  +        c.classpath = (Path) classpath.clone();
  +        c.vmVersion = vmVersion;
  +        return c;
       }
   }
  
  
  
  1.5       +7 -1      jakarta-ant/src/main/org/apache/tools/ant/types/Path.java
  
  Index: Path.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/Path.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Path.java	2000/08/08 07:26:05	1.4
  +++ Path.java	2000/08/09 06:20:30	1.5
  @@ -93,7 +93,7 @@
    * @author <a href="mailto:stefan.bodewig@megabit.net">Stefan Bodewig</a> 
    */
   
  -public class Path {
  +public class Path implements Cloneable {
   
       private Vector elements;
       private Project project;
  @@ -307,6 +307,12 @@
        */
       public int size() {
           return list().length;
  +    }
  +
  +    public Object clone() {
  +        Path p = new Path(project);
  +        p.append(this);
  +        return p;
       }
   
       private static String resolveFile(Project project, String relativeName) {
  
  
  

Mime
View raw message