Browse Source

JDK 1.1 fixes

incomplete in the case of XCatalog, I'll follow up on this.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271811 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
732df7532e
5 changed files with 22 additions and 16 deletions
  1. +6
    -0
      build.xml
  2. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Jar.java
  3. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  4. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/Zip.java
  5. +6
    -6
      src/main/org/apache/tools/ant/types/XCatalog.java

+ 6
- 0
build.xml View File

@@ -134,6 +134,12 @@
<!-- uses the context classloader -->
<exclude name="${optional.package}/junit/JUnitClassLoaderTest.java"
unless="jdk1.2+" />

<!-- I hope these are just temporary -->
<exclude name="${ant.package}/types/XCatalog.java"
unless="jdk1.2+" />
<exclude name="${ant.package}/taskdefs/XSLTProcess.java"
unless="jdk1.2+" />
</patternset>
<patternset id="needs.jdk1.3+">
<exclude name="${ant.package}/taskdefs/TestProcess.java"


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Jar.java View File

@@ -253,7 +253,7 @@ public class Jar extends Zip {
}

// need to set the line.separator as \r\n due to a bug with the jar verifier
System.setProperty("line.separator", "\r\n");
System.getProperties().put("line.separator", "\r\n");

zipDir(null, zOut, "META-INF/");
// time to write the manifest
@@ -271,7 +271,7 @@ public class Jar extends Zip {
throw new BuildException("Invalid Manifest", e, getLocation());
}
finally {
System.setProperty("line.separator", ls);
System.getProperties().put("line.separator", ls);
}
}



+ 4
- 4
src/main/org/apache/tools/ant/taskdefs/Javadoc.java View File

@@ -752,8 +752,8 @@ public class Javadoc extends Task {
String next = tok.nextToken().trim();
if (next.equals("all")) {
if (gotAll) {
project.log ("Repeated tag scope element: all",
Project.MSG_VERBOSE);
getProject().log ("Repeated tag scope element: all",
Project.MSG_VERBOSE);
}
gotAll=true;
}
@@ -768,8 +768,8 @@ public class Javadoc extends Task {
}
else {
if (elements[i]) {
project.log ("Repeated tag scope element: "+next,
Project.MSG_VERBOSE);
getProject().log ("Repeated tag scope element: "+next,
Project.MSG_VERBOSE);
}
elements[i]=true;
gotNotAll=true;


+ 4
- 4
src/main/org/apache/tools/ant/taskdefs/Zip.java View File

@@ -304,7 +304,7 @@ public class Zip extends MatchingTask {
log("Adding file " + files[j] + " to fileset", Project.MSG_VERBOSE);
ZipFileSet zf = new ZipFileSet();
zf.setSrc(new File(basedir, files[j]));
filesets.add(zf);
filesets.addElement(zf);
}
}

@@ -852,12 +852,12 @@ public class Zip extends MatchingTask {
*/
protected void cleanUp() {
addedDirs.clear();
addedFiles.clear();
filesets.clear();
addedFiles.removeAllElements();
filesets.removeAllElements();
zipFile = null;
baseDir = null;
entries.clear();
groupfilesets.clear();
groupfilesets.removeAllElements();
duplicate = "add";
archiveType = "zip";
doCompress = true;


+ 6
- 6
src/main/org/apache/tools/ant/types/XCatalog.java View File

@@ -59,7 +59,7 @@ import java.io.FileInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.net.URL;
import java.util.Iterator;
import java.util.Enumeration;
import java.util.Vector;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
@@ -121,7 +121,7 @@ public class XCatalog extends DataType implements Cloneable, EntityResolver {
* @param aDTD the DTDLocation instance to be aded to the catalog
*/
private void addElement(DTDLocation aDTD) {
getElements().add(aDTD);
getElements().addElement(aDTD);
}
/**
@@ -135,7 +135,7 @@ public class XCatalog extends DataType implements Cloneable, EntityResolver {
if (isReference()) {
throw noChildrenAllowed();
}
getElements().add(dtd);
getElements().addElement(dtd);
}
/**
@@ -242,10 +242,10 @@ public class XCatalog extends DataType implements Cloneable, EntityResolver {
* of the DTD or null if no such information is available
*/
private DTDLocation findMatchingDTD(String publicId) {
Iterator elements = getElements().iterator();
Enumeration elements = getElements().elements();
DTDLocation element = null;
while (elements.hasNext()) {
element = (DTDLocation)elements.next();
while (elements.hasMoreElements()) {
element = (DTDLocation)elements.nextElement();
if (element.getPublicId().equals(publicId)) {
return element;
}


Loading…
Cancel
Save