ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/mappers Mapper.java
Date Tue, 15 Jan 2002 09:51:10 GMT
donaldp     02/01/15 01:51:10

  Modified:    proposal/myrmidon/src/java/org/apache/antlib/xml
                        XMLValidateTask.java XSLTProcess.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        Available.java Java.java Javac.java
                        PathConvert.java Property.java Rmic.java
                        SQLExec.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc
                        DocletInfo.java Javadoc.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional
                        ANTLR.java Javah.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend
                        Depend.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb
                        BorlandGenerateClient.java EjbJar.java
                        GenericDeploymentTool.java IPlanetEjbcTask.java
                        WLRun.java WLStop.java WeblogicDeploymentTool.java
                        WebsphereDeploymentTool.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc
                        JJTree.java JavaCC.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jdepend
                        JDependTask.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp
                        JspC.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit
                        JUnitTask.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata
                        AbstractMetamataTask.java MParse.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka
                        CovReport.java Coverage.java
               proposal/myrmidon/src/main/org/apache/tools/ant/types
                        Path.java
               proposal/myrmidon/src/main/org/apache/tools/ant/util
                        FileUtils.java
               proposal/myrmidon/src/main/org/apache/tools/ant/util/mappers
                        Mapper.java
  Added:       proposal/myrmidon/src/main/org/apache/tools/ant/types
                        PathElement.java
  Log:
  Cleanup up Path object by makign PathElement a top level class and by removing the create() methods and replacing them wiuth adder methods.
  
  Also moved some of the static methods (particularly path parsing) into FileUtils).
  
  Revision  Changes    Path
  1.12      +4 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/xml/XMLValidateTask.java
  
  Index: XMLValidateTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/xml/XMLValidateTask.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XMLValidateTask.java	13 Jan 2002 07:33:23 -0000	1.11
  +++ XMLValidateTask.java	15 Jan 2002 09:51:07 -0000	1.12
  @@ -172,7 +172,10 @@
           {
               m_classpath = new Path();
           }
  -        return m_classpath.createPath();
  +        Path path1 = m_classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.12      +4 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/xml/XSLTProcess.java
  
  Index: XSLTProcess.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/xml/XSLTProcess.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XSLTProcess.java	13 Jan 2002 07:33:23 -0000	1.11
  +++ XSLTProcess.java	15 Jan 2002 09:51:07 -0000	1.12
  @@ -166,7 +166,10 @@
           {
               m_classpath = new Path();
           }
  -        return m_classpath.createPath();
  +        Path path1 = m_classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public XSLTParam createParam()
  
  
  
  1.16      +8 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java
  
  Index: Available.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Available.java	6 Jan 2002 01:59:28 -0000	1.15
  +++ Available.java	15 Jan 2002 09:51:07 -0000	1.16
  @@ -92,7 +92,10 @@
           {
               m_classpath = new Path();
           }
  -        return m_classpath.createPath();
  +        Path path1 = m_classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public Path createFilepath()
  @@ -102,7 +105,10 @@
           {
               m_filepath = new Path();
           }
  -        return m_filepath.createPath();
  +        Path path1 = m_filepath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public boolean eval()
  
  
  
  1.22      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Java.java
  
  Index: Java.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Java.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Java.java	12 Jan 2002 05:01:23 -0000	1.21
  +++ Java.java	15 Jan 2002 09:51:07 -0000	1.22
  @@ -117,7 +117,10 @@
       public Path createClasspath()
           throws TaskException
       {
  -        return m_cmdl.createClasspath().createPath();
  +        Path path1 = m_cmdl.createClasspath();
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.24      +16 -4     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Javac.java	13 Jan 2002 04:45:00 -0000	1.23
  +++ Javac.java	15 Jan 2002 09:51:07 -0000	1.24
  @@ -642,7 +642,10 @@
           {
               bootclasspath = new Path();
           }
  -        return bootclasspath.createPath();
  +        Path path1 = bootclasspath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  @@ -657,7 +660,10 @@
           {
               compileClasspath = new Path();
           }
  -        return compileClasspath.createPath();
  +        Path path1 = compileClasspath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  @@ -685,7 +691,10 @@
           {
               extdirs = new Path();
           }
  -        return extdirs.createPath();
  +        Path path1 = extdirs;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  @@ -700,7 +709,10 @@
           {
               src = new Path();
           }
  -        return src.createPath();
  +        Path path1 = src;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.11      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/PathConvert.java
  
  Index: PathConvert.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/PathConvert.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- PathConvert.java	13 Jan 2002 05:19:02 -0000	1.10
  +++ PathConvert.java	15 Jan 2002 09:51:07 -0000	1.11
  @@ -105,7 +105,10 @@
           {
               m_path = new Path();
           }
  -        return m_path.createPath();
  +        Path path1 = m_path;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public void execute()
  
  
  
  1.24      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Property.java
  
  Index: Property.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Property.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Property.java	6 Jan 2002 02:04:34 -0000	1.23
  +++ Property.java	15 Jan 2002 09:51:07 -0000	1.24
  @@ -75,7 +75,10 @@
           {
               m_classpath = new Path();
           }
  -        return m_classpath.createPath();
  +        Path path1 = m_classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public void execute()
  
  
  
  1.22      +8 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java
  
  Index: Rmic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Rmic.java	13 Jan 2002 04:45:00 -0000	1.21
  +++ Rmic.java	15 Jan 2002 09:51:07 -0000	1.22
  @@ -471,7 +471,10 @@
           {
               compileClasspath = new Path();
           }
  -        return compileClasspath.createPath();
  +        Path path1 = compileClasspath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  @@ -486,7 +489,10 @@
           {
               extdirs = new Path();
           }
  -        return extdirs.createPath();
  +        Path path1 = extdirs;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public void execute()
  
  
  
  1.19      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
  
  Index: SQLExec.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- SQLExec.java	13 Jan 2002 00:00:15 -0000	1.18
  +++ SQLExec.java	15 Jan 2002 09:51:07 -0000	1.19
  @@ -357,7 +357,10 @@
           {
               this.classpath = new Path();
           }
  -        return this.classpath.createPath();
  +        Path path1 = this.classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.5       +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/DocletInfo.java
  
  Index: DocletInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/DocletInfo.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DocletInfo.java	4 Jan 2002 09:25:13 -0000	1.4
  +++ DocletInfo.java	15 Jan 2002 09:51:07 -0000	1.5
  @@ -65,6 +65,9 @@
           {
               m_path = new Path();
           }
  -        return m_path.createPath();
  +        Path path1 = m_path;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   }
  
  
  
  1.13      +12 -3     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/Javadoc.java
  
  Index: Javadoc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/Javadoc.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Javadoc.java	12 Jan 2002 23:54:31 -0000	1.12
  +++ Javadoc.java	15 Jan 2002 09:51:08 -0000	1.13
  @@ -471,7 +471,10 @@
           {
               m_bootclasspath = new Path();
           }
  -        return m_bootclasspath.createPath();
  +        Path path1 = m_bootclasspath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public Path createClasspath()
  @@ -481,7 +484,10 @@
           {
               m_classpath = new Path();
           }
  -        return m_classpath.createPath();
  +        Path path1 = m_classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public DocletInfo createDoclet()
  @@ -511,7 +517,10 @@
           {
               m_sourcePath = new Path();
           }
  -        return m_sourcePath.createPath();
  +        Path path1 = m_sourcePath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public void execute()
  
  
  
  1.18      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java
  
  Index: ANTLR.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ANTLR.java	12 Jan 2002 05:00:16 -0000	1.17
  +++ ANTLR.java	15 Jan 2002 09:51:08 -0000	1.18
  @@ -92,7 +92,10 @@
        */
       public Path createClasspath()
       {
  -        return commandline.createClasspath().createPath();
  +        Path path1 = commandline.createClasspath();
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.17      +8 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java
  
  Index: Javah.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Javah.java	6 Jan 2002 02:16:24 -0000	1.16
  +++ Javah.java	15 Jan 2002 09:51:08 -0000	1.17
  @@ -155,7 +155,10 @@
           {
               m_bootclasspath = new Path();
           }
  -        return m_bootclasspath.createPath();
  +        Path path1 = m_bootclasspath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public ClassArgument createClass()
  @@ -172,7 +175,10 @@
           {
               m_classpath = new Path();
           }
  -        return m_classpath.createPath();
  +        Path path1 = m_classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.14      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java
  
  Index: Depend.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Depend.java	12 Jan 2002 23:50:43 -0000	1.13
  +++ Depend.java	15 Jan 2002 09:51:08 -0000	1.14
  @@ -174,7 +174,10 @@
           {
               dependClasspath = new Path();
           }
  -        return dependClasspath.createPath();
  +        Path path1 = dependClasspath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.14      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java
  
  Index: BorlandGenerateClient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- BorlandGenerateClient.java	13 Jan 2002 00:04:03 -0000	1.13
  +++ BorlandGenerateClient.java	15 Jan 2002 09:51:08 -0000	1.14
  @@ -92,7 +92,10 @@
           {
               this.classpath = new Path();
           }
  -        return this.classpath.createPath();
  +        Path path1 = this.classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.8       +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbJar.java
  
  Index: EjbJar.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbJar.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- EjbJar.java	13 Jan 2002 00:04:03 -0000	1.7
  +++ EjbJar.java	15 Jan 2002 09:51:08 -0000	1.8
  @@ -256,7 +256,10 @@
           {
               config.classpath = new Path();
           }
  -        return config.classpath.createPath();
  +        Path path1 = config.classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.14      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
  
  Index: GenericDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- GenericDeploymentTool.java	13 Jan 2002 00:04:03 -0000	1.13
  +++ GenericDeploymentTool.java	15 Jan 2002 09:51:08 -0000	1.14
  @@ -200,7 +200,10 @@
           {
               classpath = new Path();
           }
  -        return classpath.createPath();
  +        Path path1 = classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public void processDescriptor( String descriptorFileName, SAXParser saxParser )
  
  
  
  1.7       +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbcTask.java
  
  Index: IPlanetEjbcTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbcTask.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- IPlanetEjbcTask.java	30 Dec 2001 00:21:52 -0000	1.6
  +++ IPlanetEjbcTask.java	15 Jan 2002 09:51:08 -0000	1.7
  @@ -178,7 +178,10 @@
           {
               classpath = new Path();
           }
  -        return classpath.createPath();
  +        Path path1 = classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.9       +8 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WLRun.java
  
  Index: WLRun.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WLRun.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WLRun.java	30 Dec 2001 00:21:52 -0000	1.8
  +++ WLRun.java	15 Jan 2002 09:51:08 -0000	1.9
  @@ -239,7 +239,10 @@
           {
               classpath = new Path();
           }
  -        return classpath.createPath();
  +        Path path1 = classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  @@ -253,7 +256,10 @@
           {
               weblogicClasspath = new Path();
           }
  -        return weblogicClasspath.createPath();
  +        Path path1 = weblogicClasspath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.6       +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WLStop.java
  
  Index: WLStop.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WLStop.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WLStop.java	30 Dec 2001 00:21:52 -0000	1.5
  +++ WLStop.java	15 Jan 2002 09:51:08 -0000	1.6
  @@ -122,7 +122,10 @@
           {
               classpath = new Path();
           }
  -        return classpath.createPath();
  +        Path path1 = classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.14      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java
  
  Index: WeblogicDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- WeblogicDeploymentTool.java	6 Jan 2002 02:21:41 -0000	1.13
  +++ WeblogicDeploymentTool.java	15 Jan 2002 09:51:08 -0000	1.14
  @@ -298,7 +298,10 @@
           {
               wlClasspath = new Path();
           }
  -        return wlClasspath.createPath();
  +        Path path1 = wlClasspath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.14      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java
  
  Index: WebsphereDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- WebsphereDeploymentTool.java	6 Jan 2002 02:21:41 -0000	1.13
  +++ WebsphereDeploymentTool.java	15 Jan 2002 09:51:08 -0000	1.14
  @@ -378,7 +378,10 @@
           {
               wasClasspath = new Path();
           }
  -        return wasClasspath.createPath();
  +        Path path1 = wasClasspath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.17      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
  
  Index: JJTree.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- JJTree.java	6 Jan 2002 02:07:26 -0000	1.16
  +++ JJTree.java	15 Jan 2002 09:51:08 -0000	1.17
  @@ -17,6 +17,7 @@
   import org.apache.tools.ant.types.Argument;
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.Path;
  +import org.apache.tools.ant.types.PathElement;
   
   /**
    * Taskdef for the JJTree compiler compiler.
  @@ -174,7 +175,9 @@
               throw new TaskException( "Javacchome not set." );
           }
           final Path classpath = cmdl.createClasspath();
  -        classpath.createPathElement().setPath( javaccHome.getAbsolutePath() +
  +        final PathElement pathElement = new PathElement();
  +        classpath.addPathElement( pathElement );
  +        pathElement.setPath( javaccHome.getAbsolutePath() +
                                                  "/JavaCC.zip" );
           classpath.addJavaRuntime();
   
  
  
  
  1.12      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java
  
  Index: JavaCC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JavaCC.java	12 Jan 2002 23:51:47 -0000	1.11
  +++ JavaCC.java	15 Jan 2002 09:51:08 -0000	1.12
  @@ -18,6 +18,7 @@
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.Path;
  +import org.apache.tools.ant.types.PathElement;
   import org.apache.avalon.excalibur.util.StringUtil;
   
   /**
  @@ -228,7 +229,9 @@
               throw new TaskException( "Javacchome not set." );
           }
           final Path classpath = cmdl.createClasspath();
  -        classpath.createPathElement().setPath( javaccHome.getAbsolutePath() +
  +        final PathElement pathElement = new PathElement();
  +        classpath.addPathElement( pathElement );
  +        pathElement.setPath( javaccHome.getAbsolutePath() +
                                                  "/JavaCC.zip" );
           classpath.addJavaRuntime();
   
  
  
  
  1.18      +8 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  
  Index: JDependTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JDependTask.java	13 Jan 2002 05:10:57 -0000	1.17
  +++ JDependTask.java	15 Jan 2002 09:51:09 -0000	1.18
  @@ -131,7 +131,10 @@
           {
               m_compileClasspath = new Path();
           }
  -        return m_compileClasspath.createPath();
  +        Path path1 = m_compileClasspath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  @@ -156,7 +159,10 @@
           {
               m_sourcesPath = new Path();
           }
  -        return m_sourcesPath.createPath();
  +        Path path1 = m_sourcesPath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public void execute()
  
  
  
  1.15      +5 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- JspC.java	12 Jan 2002 23:52:15 -0000	1.14
  +++ JspC.java	15 Jan 2002 09:51:09 -0000	1.15
  @@ -56,7 +56,7 @@
    *      </a>
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
    * @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
  - * @version $Revision: 1.14 $ $Date: 2002/01/12 23:52:15 $
  + * @version $Revision: 1.15 $ $Date: 2002/01/15 09:51:09 $
    */
   public class JspC extends MatchingTask
   {
  @@ -300,7 +300,10 @@
       {
           if( classpath == null )
               classpath = new Path();
  -        return classpath.createPath();
  +        Path path1 = classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /*
  
  
  
  1.26      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  
  Index: JUnitTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- JUnitTask.java	14 Jan 2002 00:59:40 -0000	1.25
  +++ JUnitTask.java	15 Jan 2002 09:51:09 -0000	1.26
  @@ -348,7 +348,10 @@
        */
       public Path createClasspath()
       {
  -        return commandline.createClasspath().createPath();
  +        Path path1 = commandline.createClasspath();
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       /**
  
  
  
  1.17      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java
  
  Index: AbstractMetamataTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- AbstractMetamataTask.java	12 Jan 2002 23:52:39 -0000	1.16
  +++ AbstractMetamataTask.java	15 Jan 2002 09:51:10 -0000	1.17
  @@ -23,6 +23,7 @@
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.FileSet;
   import org.apache.tools.ant.types.Path;
  +import org.apache.tools.ant.types.PathElement;
   
   /**
    * Somewhat abstract framework to be used for other metama 2.0 tasks. This
  @@ -197,7 +198,9 @@
           // set the classpath as the jar file
           File jar = getMetamataJar( m_metamataHome );
           final Path classPath = m_cmdl.createClasspath();
  -        classPath.createPathElement().setLocation( jar );
  +        final PathElement pathElement = new PathElement();
  +        classPath.addPathElement( pathElement );
  +        pathElement.setLocation( jar );
   
           // set the metamata.home property
           final Argument vmArgs = m_cmdl.createVmArgument();
  
  
  
  1.16      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java
  
  Index: MParse.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- MParse.java	6 Jan 2002 02:29:20 -0000	1.15
  +++ MParse.java	15 Jan 2002 09:51:10 -0000	1.16
  @@ -19,6 +19,7 @@
   import org.apache.tools.ant.types.Argument;
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.Path;
  +import org.apache.tools.ant.types.PathElement;
   
   /**
    * Simple Metamata MParse task based on the original written by <a
  @@ -203,7 +204,9 @@
           final Path classPath = m_cmdl.createClasspath();
           for( int i = 0; i < jars.length; i++ )
           {
  -            classPath.createPathElement().setLocation( jars[ i ] );
  +            final PathElement pathElement = new PathElement();
  +            classPath.addPathElement( pathElement );
  +            pathElement.setLocation( jars[ i ] );
           }
   
           // set the metamata.home property
  
  
  
  1.16      +16 -4     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java
  
  Index: CovReport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- CovReport.java	6 Jan 2002 02:18:35 -0000	1.15
  +++ CovReport.java	15 Jan 2002 09:51:10 -0000	1.16
  @@ -203,7 +203,10 @@
           {
               coveragePath = new Path();
           }
  -        return coveragePath.createPath();
  +        Path path1 = coveragePath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public Reference createReference()
  @@ -221,7 +224,10 @@
           {
               sourcePath = new Path();
           }
  -        return sourcePath.createPath();
  +        Path path1 = sourcePath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public void execute()
  @@ -289,7 +295,10 @@
           if( sourcePath == null )
           {
               sourcePath = new Path();
  -            sourcePath.createPath().setLocation( getBaseDirectory() );
  +            Path path1 = sourcePath;
  +            final Path path = new Path();
  +            path1.addPath( path );
  +            path.setLocation( getBaseDirectory() );
           }
           v.add( "-sourcepath=" + sourcePath );
   
  @@ -362,7 +371,10 @@
               {
                   classPath = new Path();
               }
  -            return classPath.createPath();
  +            Path path1 = classPath;
  +            final Path path = new Path();
  +            path1.addPath( path );
  +            return path;
           }
   
           public ReportFilters createFilters()
  
  
  
  1.16      +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java
  
  Index: Coverage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Coverage.java	6 Jan 2002 02:19:34 -0000	1.15
  +++ Coverage.java	15 Jan 2002 09:51:10 -0000	1.16
  @@ -187,7 +187,10 @@
        */
       public Path createClasspath()
       {
  -        return cmdlJava.createClasspath().createPath();
  +        Path path1 = cmdlJava.createClasspath();
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   
       public Filters createFilters()
  
  
  
  1.17      +28 -133   jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Path.java
  
  Index: Path.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Path.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Path.java	13 Jan 2002 05:10:57 -0000	1.16
  +++ Path.java	15 Jan 2002 09:51:10 -0000	1.17
  @@ -12,7 +12,8 @@
   import java.net.URL;
   import java.util.ArrayList;
   import java.util.Locale;
  -import org.apache.avalon.excalibur.io.FileUtil;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.logger.Logger;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.ProjectComponent;
   import org.apache.tools.ant.util.FileUtils;
  @@ -54,7 +55,7 @@
   {
       public final static Path systemClasspath = createSystemClasspath();
   
  -    private ArrayList elements;
  +    private ArrayList m_elements;
   
       private static Path createSystemClasspath()
       {
  @@ -76,90 +77,20 @@
           throws TaskException
       {
           this();
  -        createPathElement().setPath( path );
  +        final PathElement pathElement = new PathElement();
  +        addPathElement( pathElement );
  +        pathElement.setPath( path );
       }
   
       public Path()
       {
  -        elements = new ArrayList();
  -    }
  -
  -    /**
  -     * Returns its argument with all file separator characters replaced so that
  -     * they match the local OS conventions.
  -     */
  -    protected static String translateFile( final String source )
  -    {
  -        if( source == null )
  -            return "";
  -
  -        final StringBuffer result = new StringBuffer( source );
  -        for( int i = 0; i < result.length(); i++ )
  -        {
  -            translateFileSep( result, i );
  -        }
  -
  -        return result.toString();
  -    }
  -
  -    /**
  -     * Splits a PATH (with : or ; as separators) into its parts.
  -     */
  -    protected String[] translatePath( final File baseDirectory, String source )
  -    {
  -        final ArrayList result = new ArrayList();
  -        if( source == null )
  -            return new String[ 0 ];
  -
  -        final String[] elements = FileUtils.parsePath( source );
  -        StringBuffer element = new StringBuffer();
  -        for( int i = 0; i < elements.length; i++ )
  -        {
  -            element.setLength( 0 );
  -            final String pathElement = elements[ i ];
  -            try
  -            {
  -                element.append( resolveFile( baseDirectory, pathElement ) );
  -            }
  -            catch( TaskException e )
  -            {
  -                final String message =
  -                    "Dropping path element " + pathElement + " as it is not valid relative to the project";
  -                getLogger().debug( message );
  -            }
  -
  -            for( int j = 0; j < element.length(); j++ )
  -            {
  -                translateFileSep( element, j );
  -            }
  -            result.add( element.toString() );
  -        }
  -
  -        return (String[])result.toArray( new String[ result.size() ] );
  -    }
  -
  -    /**
  -     * Translates all occurrences of / or \ to correct separator of the current
  -     * platform and returns whether it had to do any replacements.
  -     *
  -     * @param buffer Description of Parameter
  -     * @param pos Description of Parameter
  -     * @return Description of the Returned Value
  -     */
  -    private static boolean translateFileSep( StringBuffer buffer, int pos )
  -    {
  -        if( buffer.charAt( pos ) == '/' || buffer.charAt( pos ) == '\\' )
  -        {
  -            buffer.setCharAt( pos, File.separatorChar );
  -            return true;
  -        }
  -        return false;
  +        m_elements = new ArrayList();
       }
   
       /**
        * Adds a String to the ArrayList if it isn't already included.
        */
  -    private static void addUnlessPresent( final ArrayList list, final String entry )
  +    private void addUnlessPresent( final ArrayList list, final String entry )
       {
           if( !list.contains( entry ) )
           {
  @@ -168,22 +99,6 @@
       }
   
       /**
  -     * Resolve a filename with Project's help - if we know one that is. <p>
  -     *
  -     * Assume the filename is absolute if project is null.</p>
  -     */
  -    private static String resolveFile( final File baseDirectory, final String relativeName )
  -        throws TaskException
  -    {
  -        if( null != baseDirectory )
  -        {
  -            final File file = FileUtil.resolveFile( baseDirectory, relativeName );
  -            return file.getAbsolutePath();
  -        }
  -        return relativeName;
  -    }
  -
  -    /**
        * Adds a element definition to the path.
        *
        * @param location the location of the element to add (must not be <code>null</code>
  @@ -191,7 +106,9 @@
        */
       public void setLocation( final File location )
       {
  -        createPathElement().setLocation( location );
  +        final PathElement pathElement = new PathElement();
  +        addPathElement( pathElement );
  +        pathElement.setLocation( location );
       }
   
       /**
  @@ -201,7 +118,9 @@
        */
       public void setPath( String path )
       {
  -        createPathElement().setPath( path );
  +        final PathElement pathElement = new PathElement();
  +        addPathElement( pathElement );
  +        pathElement.setPath( path );
       }
   
       /**
  @@ -267,7 +186,7 @@
        */
       public void addFileset( final FileSet fileSet )
       {
  -        elements.add( fileSet );
  +        m_elements.add( fileSet );
       }
   
       /**
  @@ -334,9 +253,9 @@
           for( int i = 0; i < list.length; i++ )
           {
               final String file = list[ i ];
  -            if( elements.contains( file ) )
  +            if( m_elements.contains( file ) )
               {
  -                elements.add( file );
  +                m_elements.add( file );
               }
           }
       }
  @@ -414,21 +333,17 @@
        * @return Description of the Returned Value
        * @exception TaskException Description of Exception
        */
  -    public Path createPath()
  +    public void addPath( final Path path )
       {
  -        final Path other = new Path();
  -        elements.add( other );
  -        return other;
  +        m_elements.add( path );
       }
   
       /**
        * Creates the nested <code>&lt;pathelement&gt;</code> element.
        */
  -    public PathElement createPathElement()
  +    public void addPathElement( final PathElement pathElement )
       {
  -        final PathElement pathElement = new PathElement();
  -        elements.add( pathElement );
  -        return pathElement;
  +        m_elements.add( pathElement );
       }
   
       /**
  @@ -437,10 +352,10 @@
       public String[] list()
           throws TaskException
       {
  -        ArrayList result = new ArrayList( 2 * elements.size() );
  -        for( int i = 0; i < elements.size(); i++ )
  +        ArrayList result = new ArrayList( 2 * m_elements.size() );
  +        for( int i = 0; i < m_elements.size(); i++ )
           {
  -            Object o = elements.get( i );
  +            Object o = m_elements.get( i );
               if( o instanceof String )
               {
                   // obtained via append
  @@ -448,7 +363,9 @@
               }
               else if( o instanceof PathElement )
               {
  -                String[] parts = ( (PathElement)o ).getParts();
  +                final File baseDirectory = getBaseDirectory();
  +                final PathElement element = (PathElement)o;
  +                final String[] parts = element.getParts( baseDirectory, getLogger() );
                   if( parts == null )
                   {
                       throw new NullPointerException( "You must either set location or path on <pathelement>" );
  @@ -477,7 +394,7 @@
                   {
                       File f = new File( dir, s[ j ] );
                       String absolutePath = f.getAbsolutePath();
  -                    addUnlessPresent( result, translateFile( absolutePath ) );
  +                    addUnlessPresent( result, FileUtils.translateFile( absolutePath ) );
                   }
               }
           }
  @@ -552,26 +469,4 @@
           }
       }
   
  -    /**
  -     * Helper class, holds the nested <code>&lt;pathelement&gt;</code> values.
  -     */
  -    public class PathElement
  -    {
  -        private String[] m_parts;
  -
  -        public void setLocation( File loc )
  -        {
  -            m_parts = new String[]{translateFile( loc.getAbsolutePath() )};
  -        }
  -
  -        public void setPath( String path )
  -        {
  -            m_parts = translatePath( getProject().getBaseDir(), path );
  -        }
  -
  -        public String[] getParts()
  -        {
  -            return m_parts;
  -        }
  -    }
   }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/PathElement.java
  
  Index: PathElement.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.tools.ant.types;
  
  import java.io.File;
  import org.apache.tools.ant.util.FileUtils;
  import org.apache.avalon.framework.logger.Logger;
  
  /**
   * Helper class, holds the nested <code>&lt;pathelement&gt;</code> values.
   */
  public class PathElement
  {
      private String m_path;
  
      public void setLocation( final File location )
      {
          m_path = FileUtils.translateFile( location.getAbsolutePath() );
      }
  
      public void setPath( String path )
      {
          m_path = path;
      }
  
      protected String[] getParts( final File baseDirectory, final Logger logger )
      {
          return FileUtils.translatePath( baseDirectory, m_path, logger );
      }
  }
  
  
  
  1.14      +94 -2     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/FileUtils.java
  
  Index: FileUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/FileUtils.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- FileUtils.java	13 Jan 2002 05:10:57 -0000	1.13
  +++ FileUtils.java	15 Jan 2002 09:51:10 -0000	1.14
  @@ -15,9 +15,11 @@
   import java.io.FileReader;
   import java.io.FileWriter;
   import java.io.IOException;
  +import java.util.ArrayList;
   import java.util.Stack;
   import java.util.StringTokenizer;
  -import java.util.ArrayList;
  +import org.apache.avalon.excalibur.io.FileUtil;
  +import org.apache.avalon.framework.logger.Logger;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.types.FilterSetCollection;
   
  @@ -29,7 +31,7 @@
    * @author duncan@x180.com
    * @author <a href="mailto:conor@apache.org">Conor MacNeill</a>
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
  - * @version $Revision: 1.13 $
  + * @version $Revision: 1.14 $
    */
   public class FileUtils
   {
  @@ -376,6 +378,96 @@
   
           final String[] args = new String[ v.size() ];
           return (String[])v.toArray( args );
  +    }
  +
  +    /**
  +     * Returns its argument with all file separator characters replaced so that
  +     * they match the local OS conventions.
  +     */
  +    public static String translateFile( final String source )
  +    {
  +        if( source == null )
  +            return "";
  +
  +        final StringBuffer result = new StringBuffer( source );
  +        for( int i = 0; i < result.length(); i++ )
  +        {
  +            translateFileSep( result, i );
  +        }
  +
  +        return result.toString();
  +    }
  +
  +    /**
  +     * Translates all occurrences of / or \ to correct separator of the current
  +     * platform and returns whether it had to do any replacements.
  +     *
  +     * @param buffer Description of Parameter
  +     * @param pos Description of Parameter
  +     * @return Description of the Returned Value
  +     */
  +    public static boolean translateFileSep( StringBuffer buffer, int pos )
  +    {
  +        if( buffer.charAt( pos ) == '/' || buffer.charAt( pos ) == '\\' )
  +        {
  +            buffer.setCharAt( pos, File.separatorChar );
  +            return true;
  +        }
  +        return false;
  +    }
  +
  +    /**
  +     * Splits a PATH (with : or ; as separators) into its parts.
  +     */
  +    public static String[] translatePath( final File baseDirectory,
  +                                          String source,
  +                                          final Logger logger )
  +    {
  +        final ArrayList result = new ArrayList();
  +        if( source == null )
  +            return new String[ 0 ];
  +
  +        final String[] elements = parsePath( source );
  +        StringBuffer element = new StringBuffer();
  +        for( int i = 0; i < elements.length; i++ )
  +        {
  +            element.setLength( 0 );
  +            final String pathElement = elements[ i ];
  +            try
  +            {
  +                element.append( resolveFile( baseDirectory, pathElement ) );
  +            }
  +            catch( TaskException e )
  +            {
  +                final String message =
  +                    "Dropping path element " + pathElement + " as it is not valid relative to the project";
  +                logger.debug( message );
  +            }
  +
  +            for( int j = 0; j < element.length(); j++ )
  +            {
  +                translateFileSep( element, j );
  +            }
  +            result.add( element.toString() );
  +        }
  +
  +        return (String[])result.toArray( new String[ result.size() ] );
  +    }
  +
  +    /**
  +     * Resolve a filename with Project's help - if we know one that is. <p>
  +     *
  +     * Assume the filename is absolute if project is null.</p>
  +     */
  +    public static String resolveFile( final File baseDirectory, final String relativeName )
  +        throws TaskException
  +    {
  +        if( null != baseDirectory )
  +        {
  +            final File file = FileUtil.resolveFile( baseDirectory, relativeName );
  +            return file.getAbsolutePath();
  +        }
  +        return relativeName;
       }
   }
   
  
  
  
  1.2       +4 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/mappers/Mapper.java
  
  Index: Mapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/mappers/Mapper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Mapper.java	13 Jan 2002 05:23:18 -0000	1.1
  +++ Mapper.java	15 Jan 2002 09:51:10 -0000	1.2
  @@ -152,6 +152,9 @@
           {
               m_classpath = new Path();
           }
  -        return m_classpath.createPath();
  +        Path path1 = m_classpath;
  +        final Path path = new Path();
  +        path1.addPath( path );
  +        return path;
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message