ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional ReplaceRegExp.java XMLValidateTask.java
Date Fri, 02 Nov 2001 14:04:56 GMT
bodewig     01/11/02 06:04:56

  Modified:    .        build.xml
               src/main/org/apache/tools/ant/taskdefs/optional
                        ReplaceRegExp.java XMLValidateTask.java
  Log:
  I found myself compiling with 1.1 today ...
  
  Notes:
  
  (1) JUnitTestRunnerTest fails with an InvocationTargetException, I
  don't have the time to investigate why this happens right now.
  
  (2) I didn't modify ManifestFile as I couldn't figure out why Entry
  implemented Comparator.  Why doesn't this task use
  org.apache.tools.ant.taskdefs.Manifest anyway?
  
  Revision  Changes    Path
  1.193     +7 -0      jakarta-ant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/build.xml,v
  retrieving revision 1.192
  retrieving revision 1.193
  diff -u -r1.192 -r1.193
  --- build.xml	2001/10/30 14:40:14	1.192
  +++ build.xml	2001/11/02 14:04:56	1.193
  @@ -278,6 +278,8 @@
         <exclude name="${optional.package}/metamata/MMetrics*" 
                  unless="trax.present"/>
         <exclude name="${optional.package}/metamata/**" unless="jdk1.2+" />
  +      <exclude name="${optional.package}/ManifestFile.java" 
  +               unless="jdk1.2+" />
       </javac>
       
       <copy todir="${build.classes}">
  @@ -767,6 +769,11 @@
             <!-- ehm, this is not really a TraX test but rather a xalan2 test..-->
             <exclude name="org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java"
unless="xalan2.present"/>
   
  +          <!--  
  +          XXX need to figure out what's causing this InvocationTargetException
  +          -->
  +          <exclude name="${optional.package}/junit/JUnitTestRunnerTest.java" 
  +                   unless="jdk1.2+" />
           </fileset>
         </batchtest>
   
  
  
  
  1.2       +12 -3     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
  
  Index: ReplaceRegExp.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReplaceRegExp.java	2001/10/25 15:03:39	1.1
  +++ ReplaceRegExp.java	2001/11/02 14:04:56	1.2
  @@ -69,6 +69,7 @@
   import java.io.IOException;
   import java.io.LineNumberReader;
   import java.io.PrintWriter;
  +import java.util.Random;
   import java.util.Vector;
   
   /***
  @@ -214,7 +215,7 @@
   
       public void addFileset(FileSet set)
       {
  -        filesets.add(set);
  +        filesets.addElement(set);
       }
   
       public RegularExpression createRegularExpression()
  @@ -258,8 +259,8 @@
       protected void doReplace(File f, int options)
           throws IOException
       {
  -        File parentDir = new File(f.getAbsolutePath()).getParentFile();
  -        File temp = File.createTempFile("replace", ".txt", parentDir);
  +        File parentDir = new File(new File(f.getAbsolutePath()).getParent());
  +        File temp = createTempFile(parentDir);
   
           FileReader r = null;
           FileWriter w = null;
  @@ -418,6 +419,14 @@
               }
           }
       }
  +
  +    /**
  +     * Creates a temporary file.
  +     */
  +    private File createTempFile(File dir) {
  +        return new File(dir, "replace" + (new Random(System.currentTimeMillis())).nextLong()+".txt");
  +    }
  +
   }
   
   
  
  
  
  1.7       +4 -6      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
  
  Index: XMLValidateTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XMLValidateTask.java	2001/10/28 21:30:18	1.6
  +++ XMLValidateTask.java	2001/11/02 14:04:56	1.7
  @@ -63,8 +63,6 @@
   import java.net.URL;
   import java.util.Vector;
   import java.util.Hashtable;
  -import java.util.ArrayList;
  -import java.util.Iterator;
   import java.util.Enumeration;
   import org.apache.tools.ant.AntClassLoader;
   import org.apache.tools.ant.BuildException;
  @@ -127,7 +125,7 @@
       /**
        * The list of configured DTD locations
        */
  -    public ArrayList dtdLocations = new ArrayList();
  +    public Vector dtdLocations = new Vector();
   
       /**
        * Specify how parser error are to be handled.
  @@ -227,7 +225,7 @@
        */
       public DTDLocation createDTD() {
           DTDLocation dtdLocation = new DTDLocation();
  -        dtdLocations.add(dtdLocation);
  +        dtdLocations.addElement(dtdLocation);
   
           return dtdLocation;
       }
  @@ -235,8 +233,8 @@
       protected EntityResolver getEntityResolver() {
           LocalResolver resolver = new LocalResolver();
   
  -        for (Iterator i = dtdLocations.iterator(); i.hasNext();) {
  -            DTDLocation location = (DTDLocation)i.next();
  +        for (Enumeration i = dtdLocations.elements(); i.hasMoreElements();) {
  +            DTDLocation location = (DTDLocation)i.nextElement();
               resolver.registerDTD(location);
           }
           return resolver;
  
  
  

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