ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: cvs commit: ant/src/main/org/apache/tools/ant/types ZipFileSet.java
Date Wed, 23 Apr 2003 06:24:12 GMT
On 22 Apr 2003, <antoine@apache.org> wrote:

>   +        if (o instanceof FileSet) {
>   +           return (AbstractFileSet)(new ZipFileSet((FileSet)o));

the cast is not needed here.

>   +        }
>   +        else if (!(o instanceof ZipFileSet)) {

will always be true as instanceof ZipFileSet implies instanceof
FileSet.

Maybe you really wanted something like

        if (o instanceof FileSet) {
            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);
        }

Stefan

Mime
View raw message