You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2026/08/09 17:34:55 UTC
[PR] Fix #1998: use try-with-resources in test file utilities [maven-resolver]
elharo opened a new pull request, #2056:
URL: https://github.com/apache/maven-resolver/pull/2056
Fixes #1998
Convert manual `try-catch-finally` stream handling to try-with-resources in the test utilities:
- `TestFileUtils`: `copyFile`, `readBytes`, `writeBytes`, `readProps`, `writeProps`
- `TestFileProcessor`: `write(File, String)`, `write(File, InputStream)`, `copy(File, File, ProgressListener)`
Resources created inside each method are now closed reliably (with close exceptions properly suppressed), eliminating the leak when an explicit `close()` throws before the `finally` block. The caller-supplied `InputStream` in `TestFileProcessor.write/copy` remains intentionally unclosed, matching prior behavior.
No new tests required.
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix #1998: use try-with-resources in test file utilities [maven-resolver]
Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo merged PR #2056:
URL: https://github.com/apache/maven-resolver/pull/2056
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org