Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 57308 invoked from network); 3 Oct 2006 12:16:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Oct 2006 12:16:25 -0000 Received: (qmail 56021 invoked by uid 500); 3 Oct 2006 12:16:25 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 55910 invoked by uid 500); 3 Oct 2006 12:16:24 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 55894 invoked by uid 99); 3 Oct 2006 12:16:24 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2006 05:16:24 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:34499] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 36/CB-29668-34452254 for ; Tue, 03 Oct 2006 05:15:00 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 38B0A7141D1 for ; Tue, 3 Oct 2006 05:13:21 -0700 (PDT) Message-ID: <1984055.1159877601229.JavaMail.root@brutus> Date: Tue, 3 Oct 2006 05:13:21 -0700 (PDT) From: "Svetlana Samoilenko (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Commented: (HARMONY-81) java.util.zip.Inflater.infalate() throws DataFormatException instead of actual number of uncompressed bytes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-81?page=comments#action_12439471 ] Svetlana Samoilenko commented on HARMONY-81: -------------------------------------------- Mikhail/ Alexey, thank you, bug is not reproducible with latest sources. > java.util.zip.Inflater.infalate() throws DataFormatException instead of actual number of uncompressed bytes > ----------------------------------------------------------------------------------------------------------- > > Key: HARMONY-81 > URL: http://issues.apache.org/jira/browse/HARMONY-81 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Svetlana Samoilenko > Assigned To: Mikhail Loenko > Attachments: fix-JIRA-81.diff, HARMONY-81-Test.diff, HARMONY-81.diff, harmony-81.diff > > > Description: > According to the j2se 1.4 and 1.5 specification method java.util.zip.Inflater.infalate(byte [] b, int off, int length ) returns actual number of bytes uncompressed and throws DataFormatException if the compressed data format is invalid. > The test listed below shows that Harmony throws DataFormatException instead of return 0 (actual number of uncompressed bytes). > Code to reproduce: > import java.util.zip.*; > public class test2 { > public static void main(String[] args){ > Inflater inf = new Inflater(); > try { > System.out.println("Inflater.inflate() = "+inf.inflate(new byte[0], 0, 0)); > } catch(DataFormatException e) { > e.printStackTrace(); > } > } > } Steps to Reproduce: > 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. > 2. Compile test2.java using BEA 1.4 javac > > javac -d . test2.java > 3. Run java using compatible VM (J9) > > java -showversion test2 > Output: > C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) > Inflater.inflate() = 0 > C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2 > (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. > java.util.zip.DataFormatException: > at java.util.zip.Inflater.inflateImpl(Native Method) > at java.util.zip.Inflater.inflate(Inflater.java:169) > at test2.main(test2.java:7) > > Suggested junit test case: > ------------------------ InflaterTest.java ------------------------------------------------- > import java.util.zip.*; > import junit.framework.*; > public class InflaterTest extends TestCase { > public static void main(String[] args) { > junit.textui.TestRunner.run(InflaterTest.class); > } > public void test_inflate () { > Inflater inf = new Inflater(); > try { > int n=inf.inflate(new byte[0], 0, 0); > assertEquals(0, n); > } catch(DataFormatException e) { > fail("unexpected DataFormatException"); > } > } > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira