Browse Source

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?


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269855 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
4eecbff517
3 changed files with 23 additions and 9 deletions
  1. +7
    -0
      build.xml
  2. +12
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
  3. +4
    -6
      src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java

+ 7
- 0
build.xml View File

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



+ 12
- 3
src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java View File

@@ -69,6 +69,7 @@ import java.io.FileWriter;
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 class ReplaceRegExp extends Task

public void addFileset(FileSet set)
{
filesets.add(set);
filesets.addElement(set);
}

public RegularExpression createRegularExpression()
@@ -258,8 +259,8 @@ public class ReplaceRegExp extends Task
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 @@ public class ReplaceRegExp extends Task
}
}
}

/**
* Creates a temporary file.
*/
private File createTempFile(File dir) {
return new File(dir, "replace" + (new Random(System.currentTimeMillis())).nextLong()+".txt");
}

}



+ 4
- 6
src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java View File

@@ -63,8 +63,6 @@ import java.net.MalformedURLException;
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 @@ public class XMLValidateTask extends Task {
/**
* 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 class XMLValidateTask extends Task {
*/
public DTDLocation createDTD() {
DTDLocation dtdLocation = new DTDLocation();
dtdLocations.add(dtdLocation);
dtdLocations.addElement(dtdLocation);

return dtdLocation;
}
@@ -235,8 +233,8 @@ public class XMLValidateTask extends Task {
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;


Loading…
Cancel
Save