[kaffe] [gump] NPE using Jar files w/o manifest

Adam Heath doogie at brainfood.com
Sat Dec 25 08:28:21 PST 2004


On Sat, 25 Dec 2004, Mark Wielaard wrote:

> On Fri, 2004-12-24 at 15:02 -0600, Adam Heath wrote:
> > Ah, simple.  If we can't find the named entry, return null for the input
> > stream.  Fix in cvs.
>
> hehe. Simple he calls that. For the GNU Classpath implementation we had
> a lot of debate before we made this change. And basically the only
> reason to make such a change was for how ant was relying on this
> behaviour. See this comment in the source code:
>
>    * This implementation returns null if the requested entry does not
>    * exist.  This decision is not obviously correct, however, it does
>    * appear to mirror Sun's implementation, and it is consistant with
>    * their javadoc.  On the other hand, the old JCL book, 2nd Edition,
>    * claims that this should return a "non-null ZIP entry".  We have
>    * chosen for now ignore the old book, as modern versions of Ant (an
>    * important application) depend on this behaviour.  See discussion
>    * in this thread:
>    * http://gcc.gnu.org/ml/java-patches/2004-q2/msg00602.html

Well, reading the javadocs for ZipFile.getInputStream for jdk 1.5 and 1.4,
mentioned nothing about what should happen when the entry doesn't exist.

Maybe the implementation assumes the ZipEntry that is passed was returned from
ZipFile.getEntry, which is defined as returning null when it doesn't exist.

Maybe *that* is kaffe's problem.

> BTW. Maybe it would be a good idea for kaffe to adopt the GNU Classpath
> java.util.zip implementation. We encountered a lot of subtle issues in
> this package. Sharing this kind of bugs/fixes with kaffe would be
> beneficial to both projects.

That would be Dalibor's domain.  He's good at that.




More information about the kaffe mailing list