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] [Resolved] (COMPRESS-293) BZip2 Compressor count bug
Date Thu, 20 Nov 2014 12:02:33 GMT

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

Stefan Bodewig resolved COMPRESS-293.
-------------------------------------
    Resolution: Not a Problem

Actually no, this is intentional.

If you look at the count method in CompressorInputStream you'll see it handles -1 in a special
way (with the same effect as using 0 as argument, only with an assignment less that may have
been optimized away anyway).

I'm not really sure we use count consistently in Compress' codebase.  Rather I'm sure we don't
use it consistently.  -1 can be used to signal EOF to count as well - in case a subclass overrides
count and needs information like that.

> BZip2 Compressor count bug
> --------------------------
>
>                 Key: COMPRESS-293
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-293
>             Project: Commons Compress
>          Issue Type: Improvement
>          Components: Compressors
>    Affects Versions: 1.9
>            Reporter: Shevek
>            Priority: Minor
>
> BZIp2CompressorInputStream
>             count(r < 0 ? -1 : 1);
> Do you mean
>    count(r < 0 ? 0 : 1);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message