Marti2203 opened a new pull request, #849: URL: https://github.com/apache/commons-compress/pull/849
Fixes [COMPRESS-738](https://issues.apache.org/jira/browse/COMPRESS-738). `SevenZFile.read()` before the first `getNextEntry()` threw `ArrayIndexOutOfBoundsException: Index -1`, because `getCurrentStream()` read `archive.files[currentEntryIndex]` before reaching its own "No current 7z entry (call getNextEntry() first)." check. This throws that `ArchiveException` when `currentEntryIndex` is negative. `SevenZFileTest.testReadBeforeGetNextEntry` (an archive with entries and one without) fails without the change and passes with it; `SevenZFileTest` and `mvn -B -DskipTests -DskipITs` pass. 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]
