Return-Path: Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Delivered-To: mailing list dev@ant.apache.org Received: (qmail 49159 invoked from network); 23 Apr 2003 09:04:36 -0000 Received: from relay1.tiscali.de (HELO webmail.tiscali.de) (62.27.55.1) by daedalus.apache.org with SMTP; 23 Apr 2003 09:04:36 -0000 Received: from DJ0X820J (80.128.230.4) by webmail.tiscali.de (6.7.008) id 3E9FF3070022F809 for dev@ant.apache.org; Wed, 23 Apr 2003 08:28:44 +0200 Message-ID: <001101c30963$e2adf750$030200c0@DJ0X820J> From: "Antoine Levy-Lambert" To: "Ant Developers List" References: <20030422233332.29748.qmail@icarus.apache.org> Subject: Re: cvs commit: ant/src/main/org/apache/tools/ant/types ZipFileSet.java Date: Wed, 23 Apr 2003 08:45:10 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Sorry for the trouble, I will fix it. Antoine ----- Original Message ----- From: "Stefan Bodewig" To: Sent: Wednesday, April 23, 2003 8:24 AM Subject: Re: cvs commit: ant/src/main/org/apache/tools/ant/types ZipFileSet.java > On 22 Apr 2003, 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 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org >