This is the mail archive of the java-patches@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: java.util.zip.InflaterInputStream


Hi,

I am trying to hunt down a bug when using gij -jar.
When you try to run gij -jar Hello.jar on the attached jar file
it gives a nasty InternalError from inside natInflater.cc.
But I think the code should have never reached that point anyway.

The following patch catches the case where there is no more
data to feed to the Inflater and throws an EOFException which
is a bit nicer and more descriptive then the InternalError.

2000-08-23  Mark Wielaard  <mark@klomp.org>

        * java/util/zip/InflaterInputStream.java (read(byte[],int,int)):
        Throw EOFException when fill has no more data for the Inflater.

--- InflaterInputStream.java	2000/08/20 21:51:19	1.7
+++ InflaterInputStream.java	2000/08/23 22:30:33
@@ -13,6 +13,7 @@
 import java.io.FilterInputStream;
 import java.io.InputStream;
 import java.io.IOException;
+import java.io.EOFException;
 
 /**
  * @author Tom Tromey
@@ -65,6 +66,9 @@
       return -1;
     if (inf.needsInput())
       fill ();
+    if (this.len == -1)
+        throw new EOFException
+          ("No more input available, but Inflater not yet finished");
     if (inf.needsDictionary())
       return -1;
     try

OK to check in?

This doesn't solve my problem though.
But maybe the jar file us just corrupt, although the java for linux
from IBM doesn't have any problem with it.

Cheers,

Mark

Hello.jar


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]