diff --git a/src/main/org/apache/tools/ant/types/ZipFileSet.java b/src/main/org/apache/tools/ant/types/ZipFileSet.java index 05c1c28b2..ca96cd9a5 100644 --- a/src/main/org/apache/tools/ant/types/ZipFileSet.java +++ b/src/main/org/apache/tools/ant/types/ZipFileSet.java @@ -293,16 +293,14 @@ public class ZipFileSet extends FileSet { stk.push(this); dieOnCircularReference(stk, p); } - Object o = getRefid().getReferencedObject(p); - if (o instanceof FileSet) { - return (AbstractFileSet)(new ZipFileSet((FileSet)o)); - } - else if (!(o instanceof ZipFileSet)) { + if (o instanceof ZipFileSet) { + return (AbstractFileSet) o; + } else if (o instanceof FileSet) { + return (new ZipFileSet((FileSet) o)); + } else { String msg = getRefid().getRefId() + " doesn\'t denote a zipfileset or a fileset"; throw new BuildException(msg); - } else { - return (AbstractFileSet) o; } } /**