Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 15808 invoked from network); 9 Jun 2006 08:18:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Jun 2006 08:18:40 -0000 Received: (qmail 24528 invoked by uid 500); 9 Jun 2006 08:18:39 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 24393 invoked by uid 500); 9 Jun 2006 08:18:38 -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 24364 invoked by uid 99); 9 Jun 2006 08:18:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jun 2006 01:18:38 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jun 2006 01:18:38 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 548EE7141FA for ; Fri, 9 Jun 2006 08:17:33 +0000 (GMT) Message-ID: <14030158.1149841053343.JavaMail.jira@brutus> Date: Fri, 9 Jun 2006 08:17:33 +0000 (GMT+00:00) From: "Mikhail Loenko (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Resolved: (HARMONY-577) [classlib][util] java.util.zip.ZipOutputStream.write(byte[]) doesn't throw IOException if an entry is not set In-Reply-To: <7155115.1149754769791.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-577?page=all ] Mikhail Loenko resolved HARMONY-577: ------------------------------------ Resolution: Fixed Assign To: Mikhail Loenko Vladimir, thanks for the test and suggested ifx. I've fixed the bug in slightly different way than you've suggested, please review my fix and let me know either it fully resolves your problem > [classlib][util] java.util.zip.ZipOutputStream.write(byte[]) doesn't throw IOException if an entry is not set > ------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-577 > URL: http://issues.apache.org/jira/browse/HARMONY-577 > Project: Harmony > Type: Bug > Components: Classlib > Reporter: Vladimir Ivanov > Assignee: Mikhail Loenko > Attachments: ZipOutputStream.diffs, ZipOutputStreamTest.diffs > > Harmony java.util.zip.ZipOutputStream.write(byte[]) doesn't throw IOException if an entry is not set while RI does. > import java.io.File; > import java.io.FileOutputStream; > import java.io.IOException; > import java.util.zip.ZipEntry; > import java.util.zip.ZipException; > import java.util.zip.ZipOutputStream; > public class Test { > public static void main(String [] args) { > try { > ZipOutputStream zip = prepareStream(); > try { > zip.putNextEntry(new ZipEntry("one")); > zip.setMethod( ZipOutputStream.STORED); > zip.setMethod( ZipEntry.STORED ); > try { > zip.putNextEntry( new ZipEntry("Second")); > System.out.println("FAILED: ZipException expected"); > } catch (ZipException e) {} //We have not set an entry > try { > zip.write( new byte[2]); // We try to write data without entry > System.out.println("FAILED: expected IOE there" ); > } catch (IOException e2) { > System.out.println("passed"); > } > } catch (IOException e1) { > System.out.println("FAILED: unexpected " + e1); > } > } catch (IOException e) { > System.out.println("ERROR: " + e); > } > } > private static ZipOutputStream prepareStream() throws IOException { > File f = File.createTempFile("testZip", "tst"); > f.deleteOnExit(); > FileOutputStream stream = new FileOutputStream(f); > return new ZipOutputStream(stream); > } > } > Steps to Reproduce: > 1.Compile Test.java using BEA 1.4.2 javac > % javac -d Test.java > 2.Run Test class > > The output on Harmony: > FAILED: expected IOE there > The output on RI: > passed -- 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