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/taskdefs/text ReplaceRegExp.java Substitution.java
Date Fri, 04 Jan 2002 09:25:13 GMT
donaldp     02/01/04 01:25:13

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        Available.java DependSet.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/depend
                        Depend.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb
                        BorlandGenerateClient.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp
                        JspC.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/security
                        GenerateKey.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text
                        ReplaceRegExp.java Substitution.java
  Log:
  Removed cruft from tasks that manually worked with references rather than letting the container
handle it.
  
  Revision  Changes    Path
  1.14      +0 -7      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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Available.java	30 Dec 2001 09:25:50 -0000	1.13
  +++ Available.java	4 Jan 2002 09:25:12 -0000	1.14
  @@ -15,7 +15,6 @@
   import org.apache.tools.ant.taskdefs.condition.Condition;
   import org.apache.tools.ant.types.EnumeratedAttribute;
   import org.apache.tools.ant.types.Path;
  -import org.apache.tools.ant.types.Reference;
   
   /**
    * Will set the given property if the requested resource is available at
  @@ -53,12 +52,6 @@
           throws TaskException
       {
           createClasspath().append( classpath );
  -    }
  -
  -    public void setClasspathRef( Reference r )
  -        throws TaskException
  -    {
  -        createClasspath().setRefid( r );
       }
   
       public void setFile( String file )
  
  
  
  1.9       +5 -5      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/DependSet.java
  
  Index: DependSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/DependSet.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DependSet.java	1 Jan 2002 09:13:45 -0000	1.8
  +++ DependSet.java	4 Jan 2002 09:25:12 -0000	1.9
  @@ -59,7 +59,7 @@
    *
    *
    * @author <a href="mailto:cstrong@arielpartners.com">Craeg Strong</a>
  - * @version $Revision: 1.8 $ $Date: 2002/01/01 09:13:45 $
  + * @version $Revision: 1.9 $ $Date: 2002/01/04 09:25:12 $
    */
   public class DependSet extends MatchingTask
   {
  @@ -179,12 +179,12 @@
           {
   
               FileList targetFL = (FileList)enumTargetLists.next();
  -            String[] targetFiles = targetFL.getFiles( getProject() );
  +            String[] targetFiles = targetFL.getFiles();
   
               for( int i = 0; i < targetFiles.length; i++ )
               {
   
  -                File dest = new File( targetFL.getDir( getProject() ), targetFiles[ i ]
);
  +                File dest = new File( targetFL.getDir(), targetFiles[ i ] );
                   if( !dest.exists() )
                   {
                       getLogger().debug( targetFiles[ i ] + " does not exist." );
  @@ -250,12 +250,12 @@
               {
   
                   FileList sourceFL = (FileList)enumSourceLists.next();
  -                String[] sourceFiles = sourceFL.getFiles( getProject() );
  +                String[] sourceFiles = sourceFL.getFiles();
   
                   int i = 0;
                   do
                   {
  -                    File src = new File( sourceFL.getDir( getProject() ), sourceFiles[
i ] );
  +                    File src = new File( sourceFL.getDir(), sourceFiles[ i ] );
   
                       if( src.lastModified() > now )
                       {
  
  
  
  1.19      +0 -12     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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Java.java	30 Dec 2001 10:46:58 -0000	1.18
  +++ Java.java	4 Jan 2002 09:25:12 -0000	1.19
  @@ -20,7 +20,6 @@
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.EnvironmentVariable;
   import org.apache.tools.ant.types.Path;
  -import org.apache.tools.ant.types.Reference;
   
   /**
    * This task acts as a loader for java applications but allows to use the same
  @@ -65,17 +64,6 @@
           throws TaskException
       {
           createClasspath().append( s );
  -    }
  -
  -    /**
  -     * Adds a reference to a CLASSPATH defined elsewhere.
  -     *
  -     * @param r The new ClasspathRef value
  -     */
  -    public void setClasspathRef( Reference r )
  -        throws TaskException
  -    {
  -        createClasspath().setRefid( r );
       }
   
       /**
  
  
  
  1.19      +0 -23     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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Javac.java	30 Dec 2001 10:46:58 -0000	1.18
  +++ Javac.java	4 Jan 2002 09:25:12 -0000	1.19
  @@ -18,7 +18,6 @@
   import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory;
   import org.apache.tools.ant.types.Argument;
   import org.apache.tools.ant.types.Path;
  -import org.apache.tools.ant.types.Reference;
   import org.apache.tools.ant.util.GlobPatternMapper;
   import org.apache.tools.ant.util.SourceFileScanner;
   
  @@ -89,17 +88,6 @@
       private String target;
   
       /**
  -     * Adds a reference to a CLASSPATH defined elsewhere.
  -     *
  -     * @param r The new BootClasspathRef value
  -     */
  -    public void setBootClasspathRef( Reference r )
  -        throws TaskException
  -    {
  -        createBootclasspath().setRefid( r );
  -    }
  -
  -    /**
        * Sets the bootclasspath that will be used to compile the classes against.
        *
        * @param bootclasspath The new Bootclasspath value
  @@ -133,17 +121,6 @@
           {
               compileClasspath.append( classpath );
           }
  -    }
  -
  -    /**
  -     * Adds a reference to a CLASSPATH defined elsewhere.
  -     *
  -     * @param r The new ClasspathRef value
  -     */
  -    public void setClasspathRef( Reference r )
  -        throws TaskException
  -    {
  -        createClasspath().setRefid( r );
       }
   
       /**
  
  
  
  1.9       +0 -22     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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PathConvert.java	30 Dec 2001 00:21:51 -0000	1.8
  +++ PathConvert.java	4 Jan 2002 09:25:12 -0000	1.9
  @@ -11,7 +11,6 @@
   import java.util.ArrayList;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Task;
  -import org.apache.tools.ant.types.FileSet;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.Reference;
   
  @@ -160,27 +159,6 @@
           throws TaskException
       {
           // If we are a reference, the create a Path from the reference
  -        if( isReference() )
  -        {
  -            path = new Path().createPath();
  -
  -            Object obj = refid.getReferencedObject( getProject() );
  -
  -            if( obj instanceof Path )
  -            {
  -                path.setRefid( refid );
  -            }
  -            else if( obj instanceof FileSet )
  -            {
  -                FileSet fs = (FileSet)obj;
  -                path.addFileset( fs );
  -            }
  -            else
  -            {
  -                throw new TaskException( "'refid' does not refer to a path or fileset"
);
  -            }
  -        }
  -
           validateSetup();// validate our setup
   
           // Currently, we deal with only two path formats: Unix and Windows
  
  
  
  1.21      +0 -6      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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Property.java	30 Dec 2001 03:33:58 -0000	1.20
  +++ Property.java	4 Jan 2002 09:25:12 -0000	1.21
  @@ -55,12 +55,6 @@
           }
       }
   
  -    public void setClasspathRef( Reference r )
  -        throws TaskException
  -    {
  -        createClasspath().setRefid( r );
  -    }
  -
       public void setEnvironment( String env )
       {
           m_env = env;
  
  
  
  1.18      +0 -12     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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Rmic.java	30 Dec 2001 03:33:58 -0000	1.17
  +++ Rmic.java	4 Jan 2002 09:25:12 -0000	1.18
  @@ -18,7 +18,6 @@
   import org.apache.tools.ant.taskdefs.rmic.RmicAdapter;
   import org.apache.tools.ant.taskdefs.rmic.RmicAdapterFactory;
   import org.apache.tools.ant.types.Path;
  -import org.apache.tools.ant.types.Reference;
   import org.apache.tools.ant.util.FileNameMapper;
   import org.apache.tools.ant.util.SourceFileScanner;
   
  @@ -118,17 +117,6 @@
           {
               compileClasspath.append( classpath );
           }
  -    }
  -
  -    /**
  -     * Adds a reference to a CLASSPATH defined elsewhere.
  -     *
  -     * @param r The new ClasspathRef value
  -     */
  -    public void setClasspathRef( Reference r )
  -        throws TaskException
  -    {
  -        createClasspath().setRefid( r );
       }
   
       /**
  
  
  
  1.16      +0 -12     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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- SQLExec.java	1 Jan 2002 09:13:45 -0000	1.15
  +++ SQLExec.java	4 Jan 2002 09:25:12 -0000	1.16
  @@ -37,7 +37,6 @@
   import org.apache.tools.ant.types.EnumeratedAttribute;
   import org.apache.tools.ant.types.FileSet;
   import org.apache.tools.ant.types.Path;
  -import org.apache.tools.ant.types.Reference;
   
   /**
    * Reads in a text file containing SQL statements seperated with semicolons and
  @@ -178,17 +177,6 @@
           {
               this.classpath.append( classpath );
           }
  -    }
  -
  -    /**
  -     * Set the classpath for loading the driver using the classpath reference.
  -     *
  -     * @param r The new ClasspathRef value
  -     */
  -    public void setClasspathRef( Reference r )
  -        throws TaskException
  -    {
  -        createClasspath().setRefid( r );
       }
   
       /**
  
  
  
  1.4       +0 -12     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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DocletInfo.java	30 Dec 2001 00:21:51 -0000	1.3
  +++ DocletInfo.java	4 Jan 2002 09:25:13 -0000	1.4
  @@ -11,7 +11,6 @@
   import java.util.Iterator;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.types.Path;
  -import org.apache.tools.ant.types.Reference;
   
   public class DocletInfo
   {
  @@ -35,17 +34,6 @@
           {
               m_path.append( path );
           }
  -    }
  -
  -    /**
  -     * Adds a reference to a CLASSPATH defined elsewhere.
  -     *
  -     * @param r The new PathRef value
  -     */
  -    public void setPathRef( final Reference reference )
  -        throws TaskException
  -    {
  -        createPath().setRefid( reference );
       }
   
       public String getName()
  
  
  
  1.9       +0 -44     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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Javadoc.java	1 Jan 2002 09:13:46 -0000	1.8
  +++ Javadoc.java	4 Jan 2002 09:25:13 -0000	1.9
  @@ -23,7 +23,6 @@
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.FileSet;
   import org.apache.tools.ant.types.Path;
  -import org.apache.tools.ant.types.Reference;
   
   /**
    * This task makes it easy to generate Javadoc documentation for a collection of
  @@ -102,17 +101,6 @@
           m_author = src;
       }
   
  -    /**
  -     * Adds a reference to a CLASSPATH defined elsewhere.
  -     *
  -     * @param r The new BootClasspathRef value
  -     */
  -    public void setBootClasspathRef( Reference r )
  -        throws TaskException
  -    {
  -        createBootclasspath().setRefid( r );
  -    }
  -
       public void setBootclasspath( Path src )
           throws TaskException
       {
  @@ -152,17 +140,6 @@
       }
   
       /**
  -     * Adds a reference to a CLASSPATH defined elsewhere.
  -     *
  -     * @param r The new ClasspathRef value
  -     */
  -    public void setClasspathRef( Reference r )
  -        throws TaskException
  -    {
  -        createClasspath().setRefid( r );
  -    }
  -
  -    /**
        * Sets whether default exclusions should be used or not.
        *
        * @param useDefaultExcludes "true"|"on"|"yes" when default exclusions
  @@ -205,16 +182,6 @@
           m_doclet.setPath( src );
       }
   
  -    public void setDocletPathRef( Reference r )
  -        throws TaskException
  -    {
  -        if( m_doclet == null )
  -        {
  -            m_doclet = new DocletInfo();
  -        }
  -        m_doclet.createPath().setRefid( r );
  -    }
  -
       public void setDoctitle( String src )
       {
           Html h = new Html();
  @@ -415,17 +382,6 @@
           {
               m_sourcePath.append( src );
           }
  -    }
  -
  -    /**
  -     * Adds a reference to a CLASSPATH defined elsewhere.
  -     *
  -     * @param r The new SourcepathRef value
  -     */
  -    public void setSourcepathRef( Reference r )
  -        throws TaskException
  -    {
  -        createSourcepath().setRefid( r );
       }
   
       public void setSplitindex( boolean b )
  
  
  
  1.12      +0 -12     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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Depend.java	30 Dec 2001 03:33:58 -0000	1.11
  +++ Depend.java	4 Jan 2002 09:25:13 -0000	1.12
  @@ -24,7 +24,6 @@
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.taskdefs.MatchingTask;
   import org.apache.tools.ant.types.Path;
  -import org.apache.tools.ant.types.Reference;
   
   /**
    * Generate a dependency file for a given set of classes
  @@ -115,17 +114,6 @@
           {
               dependClasspath.append( classpath );
           }
  -    }
  -
  -    /**
  -     * Adds a reference to a CLASSPATH defined elsewhere.
  -     *
  -     * @param r The new ClasspathRef value
  -     */
  -    public void setClasspathRef( Reference r )
  -        throws TaskException
  -    {
  -        createClasspath().setRefid( r );
       }
   
       public void setClosure( boolean closure )
  
  
  
  1.11      +0 -7      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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- BorlandGenerateClient.java	30 Dec 2001 00:21:52 -0000	1.10
  +++ BorlandGenerateClient.java	4 Jan 2002 09:25:13 -0000	1.11
  @@ -13,7 +13,6 @@
   import org.apache.tools.ant.taskdefs.Java;
   import org.apache.tools.ant.taskdefs.exec.ExecTask;
   import org.apache.tools.ant.types.Path;
  -import org.apache.tools.ant.types.Reference;
   
   /**
    * BorlandGenerateClient is dedicated to the Borland Application Server 4.5 This
  @@ -64,12 +63,6 @@
           {
               this.classpath.append( classpath );
           }
  -    }
  -
  -    public void setClasspathRef( Reference r )
  -        throws TaskException
  -    {
  -        createClasspath().setRefid( r );
       }
   
       public void setClientjar( File clientjar )
  
  
  
  1.12      +1 -16     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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JspC.java	30 Dec 2001 00:21:52 -0000	1.11
  +++ JspC.java	4 Jan 2002 09:25:13 -0000	1.12
  @@ -16,7 +16,6 @@
   import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapter;
   import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapterFactory;
   import org.apache.tools.ant.types.Path;
  -import org.apache.tools.ant.types.Reference;
   
   /**
    * Ant task to run the jsp compiler. <p>
  @@ -57,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.11 $ $Date: 2001/12/30 00:21:52 $
  + * @version $Revision: 1.12 $ $Date: 2002/01/04 09:25:13 $
    */
   public class JspC extends MatchingTask
   {
  @@ -108,20 +107,6 @@
               classpath.append( cp );
       }
   
  -    /**
  -     * Adds a reference to a CLASSPATH defined elsewhere
  -     *
  -     * @param r The new ClasspathRef value
  -     */
  -    public void setClasspathRef( Reference r )
  -        throws TaskException
  -    {
  -        createClasspath().setRefid( r );
  -    }
  -
  -    /*
  -     * ------------------------------------------------------------
  -     */
       /**
        * Set the destination directory into which the JSP source files should be
        * compiled.
  
  
  
  1.2       +0 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/security/GenerateKey.java
  
  Index: GenerateKey.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/security/GenerateKey.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- GenerateKey.java	1 Jan 2002 08:41:28 -0000	1.1
  +++ GenerateKey.java	4 Jan 2002 09:25:13 -0000	1.2
  @@ -7,8 +7,6 @@
    */
   package org.apache.tools.ant.taskdefs.security;
   
  -import java.util.ArrayList;
  -import java.util.Iterator;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.taskdefs.exec.ExecTask;
  
  
  
  1.3       +4 -4      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/ReplaceRegExp.java
  
  Index: ReplaceRegExp.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/ReplaceRegExp.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ReplaceRegExp.java	1 Jan 2002 09:13:46 -0000	1.2
  +++ ReplaceRegExp.java	4 Jan 2002 09:25:13 -0000	1.3
  @@ -240,11 +240,11 @@
           throws TaskException
       {
           String res = input;
  -        Regexp regexp = r.getRegexp( getProject() );
  +        Regexp regexp = r.getRegexp();
   
           if( regexp.matches( input, options ) )
           {
  -            res = regexp.substitute( input, s.getExpression( getProject() ), options );
  +            res = regexp.substitute( input, s.getExpression(), options );
           }
   
           return res;
  @@ -277,8 +277,8 @@
   
               boolean changes = false;
   
  -            final String message = "Replacing pattern '" + regex.getPattern( getProject()
) +
  -                "' with '" + subs.getExpression( getProject() ) +
  +            final String message = "Replacing pattern '" + regex.getPattern() +
  +                "' with '" + subs.getExpression() +
                   "' in '" + f.getPath() + "'" +
                   ( byline ? " by line" : "" ) +
                   ( flags.length() > 0 ? " with flags: '" + flags + "'" : "" ) +
  
  
  
  1.2       +7 -55     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/Substitution.java
  
  Index: Substitution.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/Substitution.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Substitution.java	30 Dec 2001 11:09:45 -0000	1.1
  +++ Substitution.java	4 Jan 2002 09:25:13 -0000	1.2
  @@ -7,10 +7,7 @@
    */
   package org.apache.tools.ant.taskdefs.text;
   
  -import java.util.Stack;
  -import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.Project;
  -import org.apache.tools.ant.types.DataType;
  +import org.apache.tools.ant.ProjectComponent;
   
   /**
    * A regular expression substitution datatype. It is an expression that is meant
  @@ -24,65 +21,20 @@
    * @see org.apache.oro.text.regex.Perl5Substitition
    */
   public class Substitution
  -    extends DataType
  +    extends ProjectComponent
   {
  -    public final static String DATA_TYPE_NAME = "substitition";
  +    private String m_expression;
   
  -    private String expression;
  -
  -    public Substitution()
  -    {
  -        this.expression = null;
  -    }
  -
  -    public void setExpression( String expression )
  +    public void setExpression( final String expression )
       {
  -        this.expression = expression;
  +        m_expression = expression;
       }
   
       /**
        * Gets the pattern string for this RegularExpression in the given project.
  -     *
  -     * @param p Description of Parameter
  -     * @return The Expression value
        */
  -    public String getExpression( Project p )
  -        throws TaskException
  +    public String getExpression()
       {
  -        if( isReference() )
  -        {
  -            return getRef( p ).getExpression( p );
  -        }
  -
  -        return expression;
  -    }
  -
  -    /**
  -     * Get the RegularExpression this reference refers to in the given project.
  -     * Check for circular references too
  -     *
  -     * @param p Description of Parameter
  -     * @return The Ref value
  -     */
  -    public Substitution getRef( Project p )
  -        throws TaskException
  -    {
  -        if( !checked )
  -        {
  -            Stack stk = new Stack();
  -            stk.push( this );
  -            dieOnCircularReference( stk, p );
  -        }
  -
  -        Object o = ref.getReferencedObject( p );
  -        if( !( o instanceof Substitution ) )
  -        {
  -            String msg = ref.getRefId() + " doesn\'t denote a substitution";
  -            throw new TaskException( msg );
  -        }
  -        else
  -        {
  -            return (Substitution)o;
  -        }
  +        return m_expression;
       }
   }
  
  
  

--
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