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-ffa450edef68master
@@ -278,6 +278,8 @@ | |||||
<exclude name="${optional.package}/metamata/MMetrics*" | <exclude name="${optional.package}/metamata/MMetrics*" | ||||
unless="trax.present"/> | unless="trax.present"/> | ||||
<exclude name="${optional.package}/metamata/**" unless="jdk1.2+" /> | <exclude name="${optional.package}/metamata/**" unless="jdk1.2+" /> | ||||
<exclude name="${optional.package}/ManifestFile.java" | |||||
unless="jdk1.2+" /> | |||||
</javac> | </javac> | ||||
<copy todir="${build.classes}"> | <copy todir="${build.classes}"> | ||||
@@ -767,6 +769,11 @@ | |||||
<!-- ehm, this is not really a TraX test but rather a xalan2 test..--> | <!-- 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"/> | <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> | </fileset> | ||||
</batchtest> | </batchtest> | ||||
@@ -69,6 +69,7 @@ import java.io.FileWriter; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.io.LineNumberReader; | import java.io.LineNumberReader; | ||||
import java.io.PrintWriter; | import java.io.PrintWriter; | ||||
import java.util.Random; | |||||
import java.util.Vector; | import java.util.Vector; | ||||
/*** | /*** | ||||
@@ -214,7 +215,7 @@ public class ReplaceRegExp extends Task | |||||
public void addFileset(FileSet set) | public void addFileset(FileSet set) | ||||
{ | { | ||||
filesets.add(set); | |||||
filesets.addElement(set); | |||||
} | } | ||||
public RegularExpression createRegularExpression() | public RegularExpression createRegularExpression() | ||||
@@ -258,8 +259,8 @@ public class ReplaceRegExp extends Task | |||||
protected void doReplace(File f, int options) | protected void doReplace(File f, int options) | ||||
throws IOException | 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; | FileReader r = null; | ||||
FileWriter w = 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"); | |||||
} | |||||
} | } | ||||
@@ -63,8 +63,6 @@ import java.net.MalformedURLException; | |||||
import java.net.URL; | import java.net.URL; | ||||
import java.util.Vector; | import java.util.Vector; | ||||
import java.util.Hashtable; | import java.util.Hashtable; | ||||
import java.util.ArrayList; | |||||
import java.util.Iterator; | |||||
import java.util.Enumeration; | import java.util.Enumeration; | ||||
import org.apache.tools.ant.AntClassLoader; | import org.apache.tools.ant.AntClassLoader; | ||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
@@ -127,7 +125,7 @@ public class XMLValidateTask extends Task { | |||||
/** | /** | ||||
* The list of configured DTD locations | * The list of configured DTD locations | ||||
*/ | */ | ||||
public ArrayList dtdLocations = new ArrayList(); | |||||
public Vector dtdLocations = new Vector(); | |||||
/** | /** | ||||
* Specify how parser error are to be handled. | * Specify how parser error are to be handled. | ||||
@@ -227,7 +225,7 @@ public class XMLValidateTask extends Task { | |||||
*/ | */ | ||||
public DTDLocation createDTD() { | public DTDLocation createDTD() { | ||||
DTDLocation dtdLocation = new DTDLocation(); | DTDLocation dtdLocation = new DTDLocation(); | ||||
dtdLocations.add(dtdLocation); | |||||
dtdLocations.addElement(dtdLocation); | |||||
return dtdLocation; | return dtdLocation; | ||||
} | } | ||||
@@ -235,8 +233,8 @@ public class XMLValidateTask extends Task { | |||||
protected EntityResolver getEntityResolver() { | protected EntityResolver getEntityResolver() { | ||||
LocalResolver resolver = new LocalResolver(); | 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); | resolver.registerDTD(location); | ||||
} | } | ||||
return resolver; | return resolver; | ||||