[PATCH] Deflater.java (for Ant)

Takashi Okamoto toraneko at kun.ne.jp
Tue May 15 03:11:15 PDT 2001


Hi, Kaffe!

I have been trying that Jakarta Ant work with Kaffe. Then, I found a 
problem at java/util/zip/Deflater.java. Exception is thrown when
setLevel() is called with default compress level 
(Deflater.DEFAULT_COMPRESSION = -1), but SUN's Deflater.java works
fine then.

It prevents Ant from working with Kaffe.  So, Default compress level 
should be permitted to set. 

I attached a patch. Please take it.

Regards.
-------------------
Takashi Okamoto

---------------------------
--- Deflater.java.orig  Tue May 15 00:24:40 2001
+++ Deflater.java       Tue May 15 00:24:23 2001
@@ -85,7 +85,7 @@
 
   public synchronized void setLevel(int lvl)
   {
-    if (lvl < 0 || lvl > 9) {
+    if ((level != DEFAULT_COMPRESSION) && (lvl < 0 || lvl > 9)) {
       throw new IllegalArgumentException("levels 0-9 supported");
     }
     level = lvl;



More information about the kaffe mailing list