commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Bodewig (JIRA)" <j...@apache.org>
Subject [jira] Updated: (COMPRESS-32) AbstractTestCase.createArchive method appears to use incorrect file size - cut and paste error?
Date Tue, 24 Mar 2009 05:11:51 GMT

     [ https://issues.apache.org/jira/browse/COMPRESS-32?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Stefan Bodewig updated COMPRESS-32:
-----------------------------------

    Fix Version/s: 1.0

> AbstractTestCase.createArchive method appears to use incorrect file size - cut and paste
error?
> -----------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-32
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-32
>             Project: Commons Compress
>          Issue Type: Bug
>            Reporter: Sebb
>            Priority: Minor
>             Fix For: 1.0
>
>         Attachments: patch-copypasteerror.txt
>
>
> The createArchive() method has the following code:
> {code}
> ZipArchiveEntry entry = new ZipArchiveEntry("testdata/test1.xml");
> entry.setSize(file1.length());
> out.putArchiveEntry(entry);
> IOUtils.copy(new FileInputStream(file1), out);
> out.closeArchiveEntry();
> entry = new ZipArchiveEntry("testdata/test2.xml");
> entry.setSize(file1.length());     // <== should this be file2.length?
> out.putArchiveEntry(entry);
> IOUtils.copy(new FileInputStream(file2), out);
> out.closeArchiveEntry();
> {code}
> This looks a bit odd, as the setSize() parameter does not agree with the copy() parameter.

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