diff --git a/src/main/org/apache/tools/ant/taskdefs/Tar.java b/src/main/org/apache/tools/ant/taskdefs/Tar.java index 69a7f083b..db3ccec8b 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Tar.java +++ b/src/main/org/apache/tools/ant/taskdefs/Tar.java @@ -676,7 +676,7 @@ public class Tar extends MatchingTask { * @return true if the collection is a fileset. * @since Ant 1.7 */ - protected static final boolean isFileFileSet(ResourceCollection rc) { + protected static boolean isFileFileSet(ResourceCollection rc) { return rc instanceof FileSet && rc.isFilesystemOnly(); } @@ -687,7 +687,7 @@ public class Tar extends MatchingTask { * @return a list of the filenames. * @since Ant 1.7 */ - protected static final String[] getFileNames(FileSet fs) { + protected static String[] getFileNames(FileSet fs) { DirectoryScanner ds = fs.getDirectoryScanner(fs.getProject()); String[] directories = ds.getIncludedDirectories(); String[] filesPerSe = ds.getIncludedFiles(); diff --git a/src/main/org/apache/tools/ant/types/ArchiveFileSet.java b/src/main/org/apache/tools/ant/types/ArchiveFileSet.java index c3126f63f..84427b43a 100755 --- a/src/main/org/apache/tools/ant/types/ArchiveFileSet.java +++ b/src/main/org/apache/tools/ant/types/ArchiveFileSet.java @@ -196,6 +196,21 @@ public abstract class ArchiveFileSet extends FileSet { return null; } + /** + * Performs the check for circular references and returns the + * referenced object. + * This is an override which does not delegate to the superclass; instead it invokes + * {@link #getRef(Project)}, because that conains the special support for fileset + * references, which can be handled by all ArchiveFileSets. + * @param p the Ant Project instance against which to resolve references. + * @return the dereferenced object. + * @throws BuildException if the reference is invalid (circular ref, wrong class, etc). + * @since Ant 1.8 + */ + protected Object getCheckedRef(Project p) { + return getRef(p); + } + /** * Prepend this prefix to the path for each archive entry. * Prevents both prefix and fullpath from being specified diff --git a/src/tests/antunit/taskdefs/tar-test.xml b/src/tests/antunit/taskdefs/tar-test.xml new file mode 100644 index 000000000..9611c5d4b --- /dev/null +++ b/src/tests/antunit/taskdefs/tar-test.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + +