Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 75267 invoked from network); 9 Dec 2009 03:12:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Dec 2009 03:12:41 -0000 Received: (qmail 71413 invoked by uid 500); 9 Dec 2009 03:12:41 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 71354 invoked by uid 500); 9 Dec 2009 03:12:41 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 71344 invoked by uid 99); 9 Dec 2009 03:12:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2009 03:12:40 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2009 03:12:38 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 16101234C04C for ; Tue, 8 Dec 2009 19:12:18 -0800 (PST) Message-ID: <494754600.1260328338085.JavaMail.jira@brutus> Date: Wed, 9 Dec 2009 03:12:18 +0000 (UTC) From: "Ray Chen (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-6253) [classlib][archive] java.util.jar.JarInputStream.getNextJarEntry() should not throw ZipException In-Reply-To: <1076651033.1246282427372.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HARMONY-6253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12787890#action_12787890 ] Ray Chen commented on HARMONY-6253: ----------------------------------- Hi, I have attach one potential fix, please review it. > [classlib][archive] java.util.jar.JarInputStream.getNextJarEntry() should not throw ZipException > ------------------------------------------------------------------------------------------------ > > Key: HARMONY-6253 > URL: https://issues.apache.org/jira/browse/HARMONY-6253 > Project: Harmony > Issue Type: Bug > Components: Classlib > Affects Versions: 5.0M10 > Reporter: Kevin Zhou > Attachments: 6253.diff, ant.jar > > Original Estimate: 48h > Remaining Estimate: 48h > > Given a test case [1], RI passes it smoothly while HARMONY throws a java.util.zip.ZipException [2]. > [1] Test Case: > public void testJarInputStream() throws Exception { > JarInputStream jarInputStream = new JarInputStream(new FileInputStream("lib/ant.jar")); > JarOutputStream jarOutputStream = new JarOutputStream(new FileOutputStream("lib/ant.jar.gz")); > JarEntry jarEntry; > byte[] bytes = new byte[1024]; > InputStream inputStream = new BufferedInputStream(jarInputStream); > while ((jarEntry = jarInputStream.getNextJarEntry()) != null) { > jarOutputStream.putNextEntry(jarEntry); > int read = -1; > while ((read = inputStream.read(bytes)) != -1) { > jarOutputStream.write(bytes, 0, read); > } > jarOutputStream.closeEntry(); > } > jarOutputStream.close(); > } > [2] Stack Trace: > java.util.zip.ZipException: Size mismatch > at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:138) > at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:156) > at java.util.jar.JarInputStream.getNextEntry(JarInputStream.java:160) > at java.util.jar.JarInputStream.getNextJarEntry(JarInputStream.java:111) > at Test.testJarInputStream(Test.java:22) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.