Marti2203 opened a new pull request, #846: URL: https://github.com/apache/commons-compress/pull/846
Fixes [COMPRESS-735](https://issues.apache.org/jira/browse/COMPRESS-735). `SevenZOutputFile` accepted `putArchiveEntry()` and `write()` after `finish()`. The late data overwrote the first entry's packed data while the header written by `finish()` still described the first entry, so the archive was corrupt without any error. A second `finish()` was already rejected. This rejects both after `finish()`: `putArchiveEntry()` throws `IllegalStateException`, because its signature declares no `IOException` and adding one would break callers, and writes throw `ArchiveException` with the message `finish()` already uses. I am happy to change the exception types if you prefer others. `SevenZOutputFileTest.testPutArchiveEntryAfterFinish` fails without the change and passes with it; `SevenZOutputFileTest` and `SevenZFileTest` pass, and so does `mvn -B -DskipTests -DskipITs`. This issue was found by an LLM-Enhanced Static Analysis Engine and verified manually. The patch and this description were prepared with AI assistance (Claude Code) and reviewed by me; the commit carries an `Assisted-By:` trailer. -- 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]
