Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 28945 invoked from network); 14 Jun 2006 09:47:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Jun 2006 09:47:45 -0000 Received: (qmail 5823 invoked by uid 500); 14 Jun 2006 09:47:45 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 5783 invoked by uid 500); 14 Jun 2006 09:47:45 -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 5772 invoked by uid 99); 14 Jun 2006 09:47:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 02:47:44 -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; Wed, 14 Jun 2006 02:47:44 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9BD1B71428E for ; Wed, 14 Jun 2006 09:46:31 +0000 (GMT) Message-ID: <18359181.1150278391635.JavaMail.jira@brutus> Date: Wed, 14 Jun 2006 09:46:31 +0000 (GMT+00:00) From: "Mikhail Loenko (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Closed: (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 closed HARMONY-577: ---------------------------------- verified by Vladimir > [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