Hi all,

I've been looking into Issue 54967 - when you use <zip> with update=true
on an existing archive with duplicate entries Ant may throw a
NullPointerException.  The problem stems from a bug in ZipFile where
under getEntry returns a ZipEntry of the first entry found but
getInputStream expects to get passed in the last one.

The very same NullPointerException should be thrown for a <zipfileset>
where the archive contains duplicates, I haven't tested it but am sure
it is affected as well.

Over in Commons Compress I've introduced a quick fix where ZipFile will
consistently ignore all entries but the last.  But I've also raised the
question whether this is sufficient here.

As a user I may not expect that updating an existing archive removes
duplicates - this is what would happen right now.  If we want to
preserve duplicates in an existing archive, we need an API in ZipFile
that provides all entries for a given name.  Do you think this is worth
the effort (I may implement it in ZipFile anyway if the Compress peeps
think it would be nice)?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to