From 6d360a5aff5ef3acfeea194f6c90f74ec3196dc6 Mon Sep 17 00:00:00 2001 From: Antoine Levy-Lambert Date: Tue, 22 Apr 2003 23:16:30 +0000 Subject: [PATCH] avoid backward compatibility problems for lib attribute of war task, so relax ZipFileSet#getRef git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274501 13f79535-47bb-0310-9956-ffa450edef68 --- src/etc/testcases/taskdefs/war.xml | 2 +- .../apache/tools/ant/types/ZipFileSet.java | 21 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/etc/testcases/taskdefs/war.xml b/src/etc/testcases/taskdefs/war.xml index d91ed2d7e..d83908cdf 100644 --- a/src/etc/testcases/taskdefs/war.xml +++ b/src/etc/testcases/taskdefs/war.xml @@ -12,7 +12,7 @@ - + diff --git a/src/main/org/apache/tools/ant/types/ZipFileSet.java b/src/main/org/apache/tools/ant/types/ZipFileSet.java index fe2061fc8..65b16c7d4 100644 --- a/src/main/org/apache/tools/ant/types/ZipFileSet.java +++ b/src/main/org/apache/tools/ant/types/ZipFileSet.java @@ -234,8 +234,8 @@ public class ZipFileSet extends FileSet { } /** - * A 3 digit octal string, specify the user, group and - * other modes in the standard Unix fashion; + * A 3 digit octal string, specify the user, group and + * other modes in the standard Unix fashion; * optional, default=0644 * * @since Ant 1.5.2 @@ -247,7 +247,7 @@ public class ZipFileSet extends FileSet { this.fileMode = UnixStat.FILE_FLAG | Integer.parseInt(octalString, 8); } - + /** * @since Ant 1.5.2 */ @@ -257,10 +257,10 @@ public class ZipFileSet extends FileSet { } return fileMode; } - + /** - * A 3 digit octal string, specify the user, group and - * other modes in the standard Unix fashion; + * A 3 digit octal string, specify the user, group and + * other modes in the standard Unix fashion; * optional, default=0755 * * @since Ant 1.6 @@ -272,7 +272,7 @@ public class ZipFileSet extends FileSet { this.dirMode = UnixStat.DIR_FLAG | Integer.parseInt(octalString, 8); } - + /** * @since Ant 1.6 */ @@ -284,7 +284,8 @@ public class ZipFileSet extends FileSet { } /** - * A ZipFileset accepts only another ZipFileSet as reference + * A ZipFileset accepts another ZipFileSet or a FileSet as reference + * FileSets are often used by the war task for the lib attribute */ protected AbstractFileSet getRef(Project p) { if (!isChecked()) { @@ -294,8 +295,8 @@ public class ZipFileSet extends FileSet { } Object o = getRefid().getReferencedObject(p); - if (!(o instanceof ZipFileSet)) { - String msg = getRefid().getRefId() + " doesn\'t denote a zipfileset"; + if (!(o instanceof ZipFileSet) && !(o instanceof FileSet)) { + String msg = getRefid().getRefId() + " doesn\'t denote a zipfileset or a fileset"; throw new BuildException(msg); } else { return (AbstractFileSet) o;