pjfanning opened a new pull request, #109: URL: https://github.com/apache/poi-xmlbeans/pull/109
`XsbDumper` owns the stream it is handed — `dumpAll()` closes it through `readEnd()` on the way out. But every read goes through `error()`, which throws `IllegalStateException`, so a truncated or corrupt `.xsb` aborts the dump with the stream still open. That matters for the bulk entry points: `dump(File)` recurses over a whole directory tree opening a stream per `.xsb`, and `dumpZip`'s try-with-resources catches only `IOException`, so an `IllegalStateException` from one bad entry escapes with that entry's stream leaked. The dispatch now runs in a `try/finally` so `readEnd()` always runs. `readEnd()` gains a null guard because `dumpIndexData()` already calls it on its own success path — the same guard `XsbReader.readEnd()` has. Added `XsbDumperStreamTest`, covering index, type and pointer files truncated after the header. All three fail on trunk and pass with this change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
