[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch: ZipFile.getInputStream shouldn't throw NoSuchElement.
From: |
Mark Wielaard |
Subject: |
Re: Patch: ZipFile.getInputStream shouldn't throw NoSuchElement. |
Date: |
Fri, 25 Jun 2004 17:49:00 +0200 |
Hi,
On Wed, 2004-06-09 at 21:02, Anthony Green wrote:
> On Tue, 2004-06-08 at 22:56, Michael Koch wrote:
> > Can you backup this with a mauve testcase ? By reading SUNs javadoc it
> > can be right or wrong and this way we are sure its correct.
>
> Ok, I checked this one in.
> [...]
> // Copyright (C) 2003 Free Software Foundation
> // Contributed by Mark Wielaard (address@hidden)
Hey! I appreciate you wanting to give me lots of credit, but in this
case... :)
I looked at some code out there and it does indeed look like there are
people doing things like:
InputStream in = zipfile.getInputStream(new ZipEntry("some/file"));
if (in == null)
// Put in some defaults when file missing
else
// Read file
And they don't expect either a NoSuchEntryException,
IllegalArgumentException or Zip/IOException (interpreting the last one
as having a corrupt zip file... and of course not ever handling any of
the other two explicitly.)
So lets go for what Anthony proposes. Return null and document it.
Saw that the bug report Anthony reported against the Sun JDK docs was
just closed. Sigh.
Cheers,
Mark
signature.asc
Description: This is a digitally signed message part