agamal026 opened a new pull request, #825:
URL: https://github.com/apache/commons-compress/pull/825

   ## Problem
   
   The framed LZ4 and Snappy readers inherit `getUncompressedCount()` from 
`CompressorInputStream`, where it reflects their historical input/framing 
counter instead of decompressed output. A valid empty frame already reports 15 
bytes for LZ4 or 10 for Snappy before returning any output.
   
   This addresses the counter finding in [COMPRESS-726 comment 
18092163](https://issues.apache.org/jira/browse/COMPRESS-726?focusedCommentId=18092163&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel).
 The size-limit proposal in #777 explicitly leaves this correction separate; 
this PR does not implement or close that broader feature.
   
   ## Change
   
   Each framed reader keeps a separate output counter and advances it once when 
a public read successfully returns bytes, after the existing checksum and 
block-dependency operations. The inherited single-byte and read-based skip 
paths use the same accounting.
   
   The tests cover empty streams, zero-length reads, single-byte and offset 
bulk reads, skipping, compressed and raw blocks, multiple chunks, concatenated 
frames, skippable metadata, and retaining prior output after a later framing 
failure. Existing compressed-byte accounting and decoder behavior are preserved.
   
   ## Validation
   
   Source: `7e6477880259d60d4dfa60a5e34e4ea7875176b1`, based on current master 
`611cad06b66842692870c6ae98f50de7ce4f25d5`.
   
   - [Unchanged-production 
baseline](https://github.com/agamal026/commons-compress/blob/191c9e8ce0fb7c478f64bd8912fc56d9747eca5d/contribution-review/framed-statistics/baseline/README.md):
 89 selected tests, 39 counter-assertion failures, zero errors or skips.
   - [Identical regression tests with the 
fix](https://github.com/agamal026/commons-compress/blob/6505ee953046ebda57a40d91d520214c1cf6b1bd/contribution-review/framed-statistics/local-verification/README.md):
 all 89 pass, with zero failures, errors or skips.
   - [Default Maven hosted validation and complete 
logs](https://github.com/agamal026/commons-compress/blob/078e0a6a958ba1cf74387031867ae3eeb4450c8d/contribution-review/framed-statistics/hosted-verification/README.md)
 ([workflow 
run](https://github.com/agamal026/commons-compress/actions/runs/39147450534)): 
all 19 jobs pass, covering Linux, Windows and macOS with Java 8/11/17/21/25/27, 
plus the experimental Linux Java 28-ea job. Each build reports 4,791 tests, 
zero failures/errors; skips are 26 on Linux, 30 on Windows and 28 on macOS. All 
89 relevant tests pass in every build.
   
   The hosted jobs use the unchanged upstream command, with no explicit goal or 
added test exclusions:
   
   ```sh
   mvn --errors --show-version --batch-mode --no-transfer-progress
   ```
   
   RAT, Checkstyle, PMD and japicmp passed throughout. Javadoc passed on Java 
11 and later; the existing Java 8 profile omits that goal. The owned test merge 
differs from this contribution only by removing two inherited weekly workflow 
schedules; all source, test and Maven build inputs match.
   
   The earlier local default build stopped on two TAR tests requiring nonzero 
fixture owner/group IDs. Both also fail on exact unchanged upstream source in 
the same UID/GID 0 environment; the linked local packet preserves that control. 
The hosted full builds resolve this validation limitation.
   
   ## Contribution checklist and AI disclosure
   
   - [x] Read the [contribution guidelines](CONTRIBUTING.md).
   - [x] Read the [ASF Generative Tooling 
Guidance](https://www.apache.org/legal/generative-tooling.html).
   - [x] AI was used: ChatGPT (GPT-6 Astra Pro) generated the implementation, 
tests, analysis and PR text. A separate automated source review is included in 
the local evidence packet; no personal human review is claimed.
   - [x] Ran the default Maven build successfully.
   - [x] Added behavioral regressions that fail without the runtime correction.
   - [x] Described the problem, change and resulting behavior.
   - [x] Kept a single focused commit with a Jira-linked subject and 
explanatory body.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to