harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6253) [classlib][archive] java.util.jar.JarInputStream.getNextJarEntry() should not throw ZipException
Date Wed, 09 Dec 2009 16:15:18 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12788142#action_12788142
] 

Tim Ellison commented on HARMONY-6253:
--------------------------------------

Ray wrote:
> It assumed that the output byte size should be equal to
> input byte size, but is this supposition right? 

I think you might be misunderstanding the test.  More info on the dev list...

> [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.


Mime
View raw message