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/types/optional/depend ClassfileSet.java DependScanner.java
Date Sun, 16 Dec 2001 00:38:47 GMT
donaldp     01/12/15 16:38:47

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/types
                        Commandline.java CommandlineJava.java DataType.java
                        Description.java EnumeratedAttribute.java
                        Environment.java FileList.java FileSet.java
                        FilterSet.java Mapper.java Path.java Reference.java
                        RegularExpression.java Substitution.java
                        ZipFileSet.java ZipScanner.java
               proposal/myrmidon/src/main/org/apache/tools/ant/types/optional/depend
                        ClassfileSet.java DependScanner.java
  Log:
  BuildException -> TaskException
  
  Removed uneeded imports.
  
  Processed code through style formatter.
  
  Revision  Changes    Path
  1.3       +5 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Commandline.java
  
  Index: Commandline.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Commandline.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Commandline.java	2001/12/15 15:20:24	1.2
  +++ Commandline.java	2001/12/16 00:38:47	1.3
  @@ -11,7 +11,6 @@
   import java.util.StringTokenizer;
   import java.util.Vector;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.BuildException;
   
   /**
    * Commandline objects help handling command lines specifying processes to
  @@ -40,6 +39,7 @@
       private String executable = null;
   
       public Commandline( String to_process )
  +        throws TaskException
       {
           super();
           String[] tmp = translateCommandline( to_process );
  @@ -75,7 +75,7 @@
           {
               if( argument.indexOf( "\'" ) > -1 )
               {
  -                throw new BuildException( "Can\'t handle single and double quotes in same
argument" );
  +                throw new TaskException( "Can\'t handle single and double quotes in same
argument" );
               }
               else
               {
  @@ -120,6 +120,7 @@
       }
   
       public static String[] translateCommandline( String to_process )
  +        throws TaskException
       {
           if( to_process == null || to_process.length() == 0 )
           {
  @@ -193,7 +194,7 @@
   
           if( state == inQuote || state == inDoubleQuote )
           {
  -            throw new BuildException( "unbalanced quotes in " + to_process );
  +            throw new TaskException( "unbalanced quotes in " + to_process );
           }
   
           String[] args = new String[ v.size() ];
  @@ -356,6 +357,7 @@
            * @param line line to split into several commandline arguments
            */
           public void setLine( String line )
  +            throws TaskException
           {
               parts = translateCommandline( line );
           }
  
  
  
  1.2       +39 -30    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/CommandlineJava.java
  
  Index: CommandlineJava.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/CommandlineJava.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CommandlineJava.java	2001/12/15 12:06:31	1.1
  +++ CommandlineJava.java	2001/12/16 00:38:47	1.2
  @@ -6,12 +6,13 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.types;
  +
   import java.util.Enumeration;
   import java.util.Properties;
   import java.util.Vector;
  -import org.apache.tools.ant.BuildException;
  -import org.apache.tools.ant.Project;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.Os;
  +import org.apache.tools.ant.Project;
   
   /**
    * A representation of a Java command line that is nothing more than a composite
  @@ -76,7 +77,7 @@
       }
   
       public void setSystemProperties()
  -        throws BuildException
  +        throws TaskException
       {
           sysProperties.setSystem();
       }
  @@ -116,17 +117,18 @@
        * @return the list of all arguments necessary to run the vm.
        */
       public String[] getCommandline()
  +        throws TaskException
       {
  -        String[] result = new String[size()];
  +        String[] result = new String[ size() ];
           int pos = 0;
           String[] vmArgs = getActualVMCommand().getCommandline();
           // first argument is the java.exe path...
  -        result[pos++] = vmArgs[0];
  +        result[ pos++ ] = vmArgs[ 0 ];
   
           // -jar must be the first option in the command line.
           if( executeJar )
           {
  -            result[pos++] = "-jar";
  +            result[ pos++ ] = "-jar";
           }
           // next follows the vm options
           System.arraycopy( vmArgs, 1, result, pos, vmArgs.length - 1 );
  @@ -135,20 +137,20 @@
           if( sysProperties.size() > 0 )
           {
               System.arraycopy( sysProperties.getVariables(), 0,
  -                result, pos, sysProperties.size() );
  +                              result, pos, sysProperties.size() );
               pos += sysProperties.size();
           }
           // classpath is a vm option too..
           Path fullClasspath = classpath != null ? classpath.concatSystemClasspath( "ignore"
) : null;
           if( fullClasspath != null && fullClasspath.toString().trim().length() >
0 )
           {
  -            result[pos++] = "-classpath";
  -            result[pos++] = fullClasspath.toString();
  +            result[ pos++ ] = "-classpath";
  +            result[ pos++ ] = fullClasspath.toString();
           }
           // this is the classname to run as well as its arguments.
           // in case of 'executeJar', the executable is a jar file.
           System.arraycopy( javaCommand.getCommandline(), 0,
  -            result, pos, javaCommand.size() );
  +                          result, pos, javaCommand.size() );
           return result;
       }
   
  @@ -202,13 +204,13 @@
       public Object clone()
       {
           CommandlineJava c = new CommandlineJava();
  -        c.vmCommand = ( Commandline )vmCommand.clone();
  -        c.javaCommand = ( Commandline )javaCommand.clone();
  -        c.sysProperties = ( SysProperties )sysProperties.clone();
  +        c.vmCommand = (Commandline)vmCommand.clone();
  +        c.javaCommand = (Commandline)javaCommand.clone();
  +        c.sysProperties = (SysProperties)sysProperties.clone();
           c.maxMemory = maxMemory;
           if( classpath != null )
           {
  -            c.classpath = ( Path )classpath.clone();
  +            c.classpath = (Path)classpath.clone();
           }
           c.vmVersion = vmVersion;
           c.executeJar = executeJar;
  @@ -235,7 +237,7 @@
       }
   
       public void restoreSystemProperties()
  -        throws BuildException
  +        throws TaskException
       {
           sysProperties.restoreSystem();
       }
  @@ -247,6 +249,7 @@
        * @see #getCommandline()
        */
       public int size()
  +        throws TaskException
       {
           int size = getActualVMCommand().size() + javaCommand.size() + sysProperties.size();
           // classpath is "-classpath <classpath>" -> 2 args
  @@ -263,15 +266,21 @@
           return size;
       }
   
  -
       public String toString()
       {
  -        return Commandline.toString( getCommandline() );
  +        try
  +        {
  +            return Commandline.toString( getCommandline() );
  +        }
  +        catch( TaskException e )
  +        {
  +            return e.toString();
  +        }
       }
   
       private Commandline getActualVMCommand()
       {
  -        Commandline actualVMCommand = ( Commandline )vmCommand.clone();
  +        Commandline actualVMCommand = (Commandline)vmCommand.clone();
           if( maxMemory != null )
           {
               if( vmVersion.startsWith( "1.1" ) )
  @@ -298,7 +307,7 @@
           // PATH.
           java.io.File jExecutable =
               new java.io.File( System.getProperty( "java.home" ) +
  -            "/../bin/java" + extension );
  +                              "/../bin/java" + extension );
   
           if( jExecutable.exists() && !Os.isFamily( "netware" ) )
           {
  @@ -323,27 +332,27 @@
           Properties sys = null;
   
           public void setSystem()
  -            throws BuildException
  +            throws TaskException
           {
               try
               {
                   Properties p = new Properties( sys = System.getProperties() );
   
  -                for( Enumeration e = variables.elements(); e.hasMoreElements();  )
  +                for( Enumeration e = variables.elements(); e.hasMoreElements(); )
                   {
  -                    Environment.Variable v = ( Environment.Variable )e.nextElement();
  +                    Environment.Variable v = (Environment.Variable)e.nextElement();
                       p.put( v.getKey(), v.getValue() );
                   }
                   System.setProperties( p );
               }
               catch( SecurityException e )
               {
  -                throw new BuildException( "Cannot modify system properties", e );
  +                throw new TaskException( "Cannot modify system properties", e );
               }
           }
   
           public String[] getVariables()
  -            throws BuildException
  +            throws TaskException
           {
               String props[] = super.getVariables();
   
  @@ -352,7 +361,7 @@
   
               for( int i = 0; i < props.length; i++ )
               {
  -                props[i] = "-D" + props[i];
  +                props[ i ] = "-D" + props[ i ];
               }
               return props;
           }
  @@ -361,8 +370,8 @@
           {
               try
               {
  -                SysProperties c = ( SysProperties )super.clone();
  -                c.variables = ( Vector )variables.clone();
  +                SysProperties c = (SysProperties)super.clone();
  +                c.variables = (Vector)variables.clone();
                   return c;
               }
               catch( CloneNotSupportedException e )
  @@ -372,10 +381,10 @@
           }
   
           public void restoreSystem()
  -            throws BuildException
  +            throws TaskException
           {
               if( sys == null )
  -                throw new BuildException( "Unbalanced nesting of SysProperties" );
  +                throw new TaskException( "Unbalanced nesting of SysProperties" );
   
               try
               {
  @@ -384,7 +393,7 @@
               }
               catch( SecurityException e )
               {
  -                throw new BuildException( "Cannot modify system properties", e );
  +                throw new TaskException( "Cannot modify system properties", e );
               }
           }
   
  
  
  
  1.3       +10 -11    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/DataType.java
  
  Index: DataType.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/DataType.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DataType.java	2001/12/15 14:55:59	1.2
  +++ DataType.java	2001/12/16 00:38:47	1.3
  @@ -9,7 +9,6 @@
   
   import java.util.Stack;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.ProjectComponent;
   
  @@ -135,9 +134,9 @@
        *
        * @return Description of the Returned Value
        */
  -    protected BuildException circularReference()
  +    protected TaskException circularReference()
       {
  -        return new BuildException( "This data type contains a circular reference." );
  +        return new TaskException( "This data type contains a circular reference." );
       }
   
       /**
  @@ -145,7 +144,7 @@
        * the Stack (which holds all DataType instances that directly or indirectly
        * reference this instance, including this instance itself). <p>
        *
  -     * If one is included, throw a BuildException created by {@link
  +     * If one is included, throw a TaskException created by {@link
        * #circularReference circularReference}.</p> <p>
        *
        * This implementation is appropriate only for a DataType that cannot hold
  @@ -157,10 +156,10 @@
        *
        * @param stk Description of Parameter
        * @param p Description of Parameter
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        */
       protected void dieOnCircularReference( Stack stk, Project p )
  -        throws BuildException
  +        throws TaskException
       {
   
           if( checked || !isReference() )
  @@ -191,9 +190,9 @@
        *
        * @return Description of the Returned Value
        */
  -    protected BuildException noChildrenAllowed()
  +    protected TaskException noChildrenAllowed()
       {
  -        return new BuildException( "You must not specify nested elements when using refid"
);
  +        return new TaskException( "You must not specify nested elements when using refid"
);
       }
   
       /**
  @@ -202,9 +201,9 @@
        *
        * @return Description of the Returned Value
        */
  -    protected BuildException tooManyAttributes()
  +    protected TaskException tooManyAttributes()
       {
  -        return new BuildException( "You must not specify more than one attribute" +
  -                                   " when using refid" );
  +        return new TaskException( "You must not specify more than one attribute" +
  +                                  " when using refid" );
       }
   }
  
  
  
  1.2       +1 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Description.java
  
  Index: Description.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Description.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Description.java	2001/12/15 12:06:31	1.1
  +++ Description.java	2001/12/16 00:38:47	1.2
  @@ -7,7 +7,6 @@
    */
   package org.apache.tools.ant.types;
   
  -
   /**
    * Description is used to provide a project-wide description element (that is, a
    * description that applies to a buildfile as a whole). If present, the
  @@ -17,7 +16,7 @@
    * first.
    *
    * @author <a href="mailto:cstrong@arielpartners.com">Craeg Strong</a>
  - * @version $Revision: 1.1 $ $Date: 2001/12/15 12:06:31 $
  + * @version $Revision: 1.2 $ $Date: 2001/12/16 00:38:47 $
    */
   public class Description extends DataType
   {
  
  
  
  1.2       +9 -6      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java
  
  Index: EnumeratedAttribute.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EnumeratedAttribute.java	2001/12/15 12:06:31	1.1
  +++ EnumeratedAttribute.java	2001/12/16 00:38:47	1.2
  @@ -6,8 +6,9 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.types;
  -import org.apache.tools.ant.BuildException;
   
  +import org.apache.myrmidon.api.TaskException;
  +
   /**
    * Helper class for attributes that can only take one of a fixed list of values.
    * <p>
  @@ -21,21 +22,23 @@
   
       protected String value;
   
  -    public EnumeratedAttribute() { }
  +    public EnumeratedAttribute()
  +    {
  +    }
   
       /**
        * Invoked by {@link org.apache.tools.ant.IntrospectionHelper
        * IntrospectionHelper}.
        *
        * @param value The new Value value
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        */
       public final void setValue( String value )
  -        throws BuildException
  +        throws TaskException
       {
           if( !containsValue( value ) )
           {
  -            throw new BuildException( value + " is not a legal value for this attribute"
);
  +            throw new TaskException( value + " is not a legal value for this attribute"
);
           }
           this.value = value;
       }
  @@ -73,7 +76,7 @@
   
           for( int i = 0; i < values.length; i++ )
           {
  -            if( value.equals( values[i] ) )
  +            if( value.equals( values[ i ] ) )
               {
                   return true;
               }
  
  
  
  1.2       +7 -6      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Environment.java
  
  Index: Environment.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Environment.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Environment.java	2001/12/15 12:06:31	1.1
  +++ Environment.java	2001/12/16 00:38:47	1.2
  @@ -6,8 +6,9 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.types;
  +
   import java.util.Vector;
  -import org.apache.tools.ant.BuildException;
  +import org.apache.myrmidon.api.TaskException;
   
   /**
    * Wrapper for environment variables.
  @@ -25,16 +26,16 @@
       }
   
       public String[] getVariables()
  -        throws BuildException
  +        throws TaskException
       {
           if( variables.size() == 0 )
           {
               return null;
           }
  -        String[] result = new String[variables.size()];
  +        String[] result = new String[ variables.size() ];
           for( int i = 0; i < result.length; i++ )
           {
  -            result[i] = ( ( Variable )variables.elementAt( i ) ).getContent();
  +            result[ i ] = ( (Variable)variables.elementAt( i ) ).getContent();
           }
           return result;
       }
  @@ -74,11 +75,11 @@
           }
   
           public String getContent()
  -            throws BuildException
  +            throws TaskException
           {
               if( key == null || value == null )
               {
  -                throw new BuildException( "key and value must be specified for environment
variables." );
  +                throw new TaskException( "key and value must be specified for environment
variables." );
               }
               StringBuffer sb = new StringBuffer( key.trim() );
               sb.append( "=" ).append( value.trim() );
  
  
  
  1.2       +11 -10    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FileList.java
  
  Index: FileList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FileList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileList.java	2001/12/15 12:06:31	1.1
  +++ FileList.java	2001/12/16 00:38:47	1.2
  @@ -6,11 +6,12 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.types;
  +
   import java.io.File;
   import java.util.Stack;
   import java.util.StringTokenizer;
   import java.util.Vector;
  -import org.apache.tools.ant.BuildException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
   
   /**
  @@ -20,7 +21,7 @@
    * a matched file if it currently exists in the file system.
    *
    * @author <a href="mailto:cstrong@arielpartners.com">Craeg Strong</a>
  - * @version $Revision: 1.1 $ $Date: 2001/12/15 12:06:31 $
  + * @version $Revision: 1.2 $ $Date: 2001/12/16 00:38:47 $
    */
   public class FileList extends DataType
   {
  @@ -41,7 +42,7 @@
       }
   
       public void setDir( File dir )
  -        throws BuildException
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -74,10 +75,10 @@
        * if you make it a reference.</p>
        *
        * @param r The new Refid value
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        */
       public void setRefid( Reference r )
  -        throws BuildException
  +        throws TaskException
       {
           if( ( dir != null ) || ( filenames.size() != 0 ) )
           {
  @@ -110,15 +111,15 @@
   
           if( dir == null )
           {
  -            throw new BuildException( "No directory specified for filelist." );
  +            throw new TaskException( "No directory specified for filelist." );
           }
   
           if( filenames.size() == 0 )
           {
  -            throw new BuildException( "No files specified for filelist." );
  +            throw new TaskException( "No files specified for filelist." );
           }
   
  -        String result[] = new String[filenames.size()];
  +        String result[] = new String[ filenames.size() ];
           filenames.copyInto( result );
           return result;
       }
  @@ -143,11 +144,11 @@
           if( !( o instanceof FileList ) )
           {
               String msg = ref.getRefId() + " doesn\'t denote a filelist";
  -            throw new BuildException( msg );
  +            throw new TaskException( msg );
           }
           else
           {
  -            return ( FileList )o;
  +            return (FileList)o;
           }
       }
   
  
  
  
  1.4       +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FileSet.java
  
  Index: FileSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FileSet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FileSet.java	2001/12/15 15:20:24	1.3
  +++ FileSet.java	2001/12/16 00:38:47	1.4
  @@ -11,7 +11,6 @@
   import java.util.Stack;
   import java.util.Vector;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.FileScanner;
   import org.apache.tools.ant.Project;
  @@ -185,6 +184,7 @@
       }
   
       public void setupDirectoryScanner( FileScanner ds, Project p )
  +        throws TaskException
       {
           if( ds == null )
           {
  
  
  
  1.3       +6 -7      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FilterSet.java
  
  Index: FilterSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/FilterSet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FilterSet.java	2001/12/15 14:55:59	1.2
  +++ FilterSet.java	2001/12/16 00:38:47	1.3
  @@ -15,7 +15,6 @@
   import java.util.Properties;
   import java.util.Vector;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Project;
   
   /**
  @@ -105,10 +104,10 @@
        *
        * @param filtersFile sets the filter fil to read filters for this filter
        *      set from.
  -     * @exception BuildException if there is a problem reading the filters
  +     * @exception TaskException if there is a problem reading the filters
        */
       public void setFiltersfile( File filtersFile )
  -        throws BuildException
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -253,11 +252,11 @@
        * Read the filters from the given file.
        *
        * @param filtersFile the file from which filters are read
  -     * @exception BuildException Throw a build exception when unable to read the
  +     * @exception TaskException Throw a build exception when unable to read the
        *      file.
        */
       public void readFiltersFromFile( File filtersFile )
  -        throws BuildException
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -285,7 +284,7 @@
               }
               catch( Exception e )
               {
  -                throw new BuildException( "Could not read filters from file: " + filtersFile
);
  +                throw new TaskException( "Could not read filters from file: " + filtersFile
);
               }
               finally
               {
  @@ -303,7 +302,7 @@
           }
           else
           {
  -            throw new BuildException( "Must specify a file not a directory in the filtersfile
attribute:" + filtersFile );
  +            throw new TaskException( "Must specify a file not a directory in the filtersfile
attribute:" + filtersFile );
           }
       }
   
  
  
  
  1.4       +9 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Mapper.java
  
  Index: Mapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Mapper.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Mapper.java	2001/12/15 15:20:24	1.3
  +++ Mapper.java	2001/12/16 00:38:47	1.4
  @@ -9,10 +9,10 @@
   
   import java.util.Properties;
   import java.util.Stack;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.AntClassLoader;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.util.FileNameMapper;
  -import org.apache.myrmidon.api.TaskException;
   
   /**
    * Element to define a FileNameMapper.
  @@ -43,6 +43,7 @@
        * @param classname The new Classname value
        */
       public void setClassname( String classname )
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -57,6 +58,7 @@
        * @param classpath The new Classpath value
        */
       public void setClasspath( Path classpath )
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -79,6 +81,7 @@
        * @param r The new ClasspathRef value
        */
       public void setClasspathRef( Reference r )
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -93,6 +96,7 @@
        * @param from The new From value
        */
       public void setFrom( String from )
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -125,6 +129,7 @@
        * @param to The new To value
        */
       public void setTo( String to )
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -139,6 +144,7 @@
        * @param type The new Type value
        */
       public void setType( MapperType type )
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -219,6 +225,7 @@
        * @return Description of the Returned Value
        */
       public Path createClasspath()
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -238,6 +245,7 @@
        * @return The Ref value
        */
       protected Mapper getRef()
  +        throws TaskException
       {
           if( !checked )
           {
  
  
  
  1.3       +25 -16    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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Path.java	2001/12/15 14:56:00	1.2
  +++ Path.java	2001/12/16 00:38:47	1.3
  @@ -13,7 +13,6 @@
   import java.util.Stack;
   import java.util.Vector;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.PathTokenizer;
   import org.apache.tools.ant.Project;
  @@ -193,6 +192,7 @@
        * @return Description of the Returned Value
        */
       private static String resolveFile( Project project, String relativeName )
  +        throws TaskException
       {
           if( project != null )
           {
  @@ -208,10 +208,10 @@
        *
        * @param location the location of the element to add (must not be <code>null</code>
        *      nor empty.
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        */
       public void setLocation( File location )
  -        throws BuildException
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -224,10 +224,10 @@
        * Parses a path definition and creates single PathElements.
        *
        * @param path the path definition.
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        */
       public void setPath( String path )
  -        throws BuildException
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -243,7 +243,7 @@
        * if you make it a reference.</p>
        *
        * @param r The new Refid value
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        */
       public void setRefid( Reference r )
           throws TaskException
  @@ -326,7 +326,7 @@
        * Adds a nested <code>&lt;fileset&gt;</code> element.
        *
        * @param fs The feature to be added to the Fileset attribute
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        */
       public void addFileset( FileSet fs )
           throws TaskException
  @@ -427,9 +427,17 @@
        */
       public Object clone()
       {
  -        Path p = new Path( getProject() );
  -        p.append( this );
  -        return p;
  +        try
  +        {
  +            Path p = new Path( getProject() );
  +            p.append( this );
  +            return p;
  +        }
  +        catch( TaskException e )
  +        {
  +            throw new IllegalStateException( e.getMessage() );
  +        }
  +
       }
   
       /**
  @@ -439,6 +447,7 @@
        * @return Description of the Returned Value
        */
       public Path concatSystemClasspath()
  +        throws TaskException
       {
           return concatSystemClasspath( "last" );
       }
  @@ -505,10 +514,10 @@
        * Creates a nested <code>&lt;path&gt;</code> element.
        *
        * @return Description of the Returned Value
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        */
       public Path createPath()
  -        throws BuildException
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -524,10 +533,10 @@
        * Creates the nested <code>&lt;pathelement&gt;</code> element.
        *
        * @return Description of the Returned Value
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        */
       public PathElement createPathElement()
  -        throws BuildException
  +        throws TaskException
       {
           if( isReference() )
           {
  @@ -668,10 +677,10 @@
        *
        * @param stk Description of Parameter
        * @param p Description of Parameter
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        */
       protected void dieOnCircularReference( Stack stk, Project p )
  -        throws BuildException
  +        throws TaskException
       {
   
           if( checked )
  
  
  
  1.2       +5 -4      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Reference.java
  
  Index: Reference.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Reference.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Reference.java	2001/12/15 12:06:31	1.1
  +++ Reference.java	2001/12/16 00:38:47	1.2
  @@ -6,7 +6,8 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.types;
  -import org.apache.tools.ant.BuildException;
  +
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
   
   /**
  @@ -41,17 +42,17 @@
       }
   
       public Object getReferencedObject( Project project )
  -        throws BuildException
  +        throws TaskException
       {
           if( refid == null )
           {
  -            throw new BuildException( "No reference specified" );
  +            throw new TaskException( "No reference specified" );
           }
   
           Object o = project.getReference( refid );
           if( o == null )
           {
  -            throw new BuildException( "Reference " + refid + " not found." );
  +            throw new TaskException( "Reference " + refid + " not found." );
           }
           return o;
       }
  
  
  
  1.2       +8 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/RegularExpression.java
  
  Index: RegularExpression.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/RegularExpression.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RegularExpression.java	2001/12/15 12:06:31	1.1
  +++ RegularExpression.java	2001/12/16 00:38:47	1.2
  @@ -6,8 +6,9 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.types;
  +
   import java.util.Stack;
  -import org.apache.tools.ant.BuildException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.util.regexp.Regexp;
   import org.apache.tools.ant.util.regexp.RegexpFactory;
  @@ -51,11 +52,13 @@
       private Regexp regexp;
   
       public RegularExpression()
  +        throws TaskException
       {
           this.regexp = factory.newRegexp();
       }
   
       public void setPattern( String pattern )
  +        throws TaskException
       {
           this.regexp.setPattern( pattern );
       }
  @@ -67,6 +70,7 @@
        * @return The Pattern value
        */
       public String getPattern( Project p )
  +        throws TaskException
       {
           if( isReference() )
               return getRef( p ).getPattern( p );
  @@ -82,6 +86,7 @@
        * @return The Ref value
        */
       public RegularExpression getRef( Project p )
  +        throws TaskException
       {
           if( !checked )
           {
  @@ -94,11 +99,11 @@
           if( !( o instanceof RegularExpression ) )
           {
               String msg = ref.getRefId() + " doesn\'t denote a regularexpression";
  -            throw new BuildException( msg );
  +            throw new TaskException( msg );
           }
           else
           {
  -            return ( RegularExpression )o;
  +            return (RegularExpression)o;
           }
       }
   
  
  
  
  1.2       +4 -4      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Substitution.java
  
  Index: Substitution.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/Substitution.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Substitution.java	2001/12/15 12:06:31	1.1
  +++ Substitution.java	2001/12/16 00:38:47	1.2
  @@ -6,10 +6,10 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.types;
  +
   import java.util.Stack;
  -import org.apache.tools.ant.BuildException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
  -import org.apache.tools.ant.types.DataType;
   
   /**
    * A regular expression substitution datatype. It is an expression that is meant
  @@ -72,11 +72,11 @@
           if( !( o instanceof Substitution ) )
           {
               String msg = ref.getRefId() + " doesn\'t denote a substitution";
  -            throw new BuildException( msg );
  +            throw new TaskException( msg );
           }
           else
           {
  -            return ( Substitution )o;
  +            return (Substitution)o;
           }
       }
   
  
  
  
  1.2       +7 -5      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/ZipFileSet.java
  
  Index: ZipFileSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/ZipFileSet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ZipFileSet.java	2001/12/15 12:06:31	1.1
  +++ ZipFileSet.java	2001/12/16 00:38:47	1.2
  @@ -6,8 +6,9 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.types;
  +
   import java.io.File;
  -import org.apache.tools.ant.BuildException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.Project;
   
  @@ -39,14 +40,14 @@
        * being specified.
        *
        * @param dir The new Dir value
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        */
       public void setDir( File dir )
  -        throws BuildException
  +        throws TaskException
       {
           if( srcFile != null )
           {
  -            throw new BuildException( "Cannot set both dir and src attributes" );
  +            throw new TaskException( "Cannot set both dir and src attributes" );
           }
           else
           {
  @@ -86,7 +87,7 @@
       {
           if( hasDir )
           {
  -            throw new BuildException( "Cannot set both dir and src attributes" );
  +            throw new TaskException( "Cannot set both dir and src attributes" );
           }
           this.srcFile = srcFile;
       }
  @@ -100,6 +101,7 @@
        * @return The DirectoryScanner value
        */
       public DirectoryScanner getDirectoryScanner( Project p )
  +        throws TaskException
       {
           if( isReference() )
           {
  
  
  
  1.2       +7 -6      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/ZipScanner.java
  
  Index: ZipScanner.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/ZipScanner.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ZipScanner.java	2001/12/15 12:06:31	1.1
  +++ ZipScanner.java	2001/12/16 00:38:47	1.2
  @@ -6,6 +6,7 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.types;
  +
   import java.io.File;
   import org.apache.tools.ant.DirectoryScanner;
   
  @@ -46,7 +47,7 @@
        */
       public String[] getIncludedDirectories()
       {
  -        return new String[0];
  +        return new String[ 0 ];
       }
   
       /**
  @@ -58,8 +59,8 @@
        */
       public String[] getIncludedFiles()
       {
  -        String[] result = new String[1];
  -        result[0] = srcFile.getAbsolutePath();
  +        String[] result = new String[ 1 ];
  +        result[ 0 ] = srcFile.getAbsolutePath();
           return result;
       }
   
  @@ -71,12 +72,12 @@
           if( includes == null )
           {
               // No includes supplied, so set it to 'matches all'
  -            includes = new String[1];
  -            includes[0] = "**";
  +            includes = new String[ 1 ];
  +            includes[ 0 ] = "**";
           }
           if( excludes == null )
           {
  -            excludes = new String[0];
  +            excludes = new String[ 0 ];
           }
       }
   
  
  
  
  1.2       +4 -6      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/optional/depend/ClassfileSet.java
  
  Index: ClassfileSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/optional/depend/ClassfileSet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ClassfileSet.java	2001/12/15 12:06:32	1.1
  +++ ClassfileSet.java	2001/12/16 00:38:47	1.2
  @@ -6,15 +6,13 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.types.optional.depend;
  -import java.io.File;
  +
   import java.util.ArrayList;
   import java.util.List;
  -import java.util.Stack;
  -import org.apache.tools.ant.BuildException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.types.FileSet;
  -import org.apache.tools.ant.util.depend.Dependencies;
   
   /**
    * A DepSet is a FileSet, that enlists all classes that depend on a certain
  @@ -35,7 +33,7 @@
       }
   
       public void setRootClass( String rootClass )
  -        throws BuildException
  +        throws TaskException
       {
           rootClasses.add( rootClass );
       }
  @@ -64,7 +62,7 @@
       {
           if( isReference() )
           {
  -            return new ClassfileSet( ( ClassfileSet )getRef( getProject() ) );
  +            return new ClassfileSet( (ClassfileSet)getRef( getProject() ) );
           }
           else
           {
  
  
  
  1.2       +36 -21    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java
  
  Index: DependScanner.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DependScanner.java	2001/12/15 12:06:32	1.1
  +++ DependScanner.java	2001/12/16 00:38:47	1.2
  @@ -6,8 +6,15 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.types.optional.depend;
  -import java.io.*;
  -import java.util.*;
  +
  +import java.io.File;
  +import java.io.IOException;
  +import java.util.HashSet;
  +import java.util.Iterator;
  +import java.util.LinkedList;
  +import java.util.List;
  +import java.util.Set;
  +import java.util.TreeSet;
   import org.apache.bcel.*;
   import org.apache.bcel.classfile.*;
   import org.apache.tools.ant.DirectoryScanner;
  @@ -50,11 +57,17 @@
           this.basedir = basedir;
       }
   
  -    public void setCaseSensitive( boolean isCaseSensitive ) { }
  +    public void setCaseSensitive( boolean isCaseSensitive )
  +    {
  +    }
   
  -    public void setExcludes( String[] excludes ) { }
  +    public void setExcludes( String[] excludes )
  +    {
  +    }
   
  -    public void setIncludes( String[] includes ) { }
  +    public void setIncludes( String[] includes )
  +    {
  +    }
   
       /**
        * Sets the domain, where dependant classes are searched
  @@ -88,7 +101,7 @@
   
       public String[] getIncludedDirectories()
       {
  -        return new String[0];
  +        return new String[ 0 ];
       }
   
       /**
  @@ -99,10 +112,10 @@
       public String[] getIncludedFiles()
       {
           int count = included.size();
  -        String[] files = new String[count];
  +        String[] files = new String[ count ];
           for( int i = 0; i < count; i++ )
           {
  -            files[i] = included.get( i ) + ".class";
  +            files[ i ] = included.get( i ) + ".class";
               //System.err.println("  " + files[i]);
           }
           return files;
  @@ -118,7 +131,9 @@
           return null;
       }
   
  -    public void addDefaultExcludes() { }
  +    public void addDefaultExcludes()
  +    {
  +    }
   
       /**
        * Scans the base directory for files that baseClass depends on
  @@ -140,10 +155,10 @@
               throw new IllegalArgumentException( e.getMessage() );
           }
   
  -        for( Iterator rootClassIterator = rootClasses.iterator(); rootClassIterator.hasNext();
 )
  +        for( Iterator rootClassIterator = rootClasses.iterator(); rootClassIterator.hasNext();
)
           {
               Set newSet = new HashSet();
  -            String start = ( String )rootClassIterator.next();
  +            String start = (String)rootClassIterator.next();
               start = start.replace( '.', '/' );
   
               newSet.add( start );
  @@ -154,7 +169,7 @@
                   Iterator i = newSet.iterator();
                   while( i.hasNext() )
                   {
  -                    String fileName = base + ( ( String )i.next() ).replace( '/', File.separatorChar
) + ".class";
  +                    String fileName = base + ( (String)i.next() ).replace( '/', File.separatorChar
) + ".class";
   
                       try
                       {
  @@ -171,17 +186,17 @@
                   visitor.clearDependencies();
   
                   Dependencies.applyFilter( newSet,
  -                    new Filter()
  -                    {
  -                        public boolean accept( Object object )
  -                        {
  -                            String fileName = base + ( ( String )object ).replace( '/',
File.separatorChar ) + ".class";
  -                            return new File( fileName ).exists();
  -                        }
  -                    } );
  +                                          new Filter()
  +                                          {
  +                                              public boolean accept( Object object )
  +                                              {
  +                                                  String fileName = base + ( (String)object
).replace( '/', File.separatorChar ) + ".class";
  +                                                  return new File( fileName ).exists();
  +                                              }
  +                                          } );
                   newSet.removeAll( set );
                   set.addAll( newSet );
  -            }while ( newSet.size() > 0 );
  +            } while( newSet.size() > 0 );
           }
   
           included.clear();
  
  
  

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