Repository navigation
[IO-438] Clarify when to use closeQuietly in copy examples - #940
Draft
hutiefang76 wants to merge 2 commits into
Draft
hutiefang76 wants to merge 2 commits into
hutiefang76 wants to merge 2 commits into
Conversation
Use try-with-resources in the closeQuietly copy examples so an output close failure reaches the caller. Assisted-By: OpenAI Codex
Member
|
-1 This is not better. You are documenting different methods now. |
garydgregory
marked this pull request as draft
November 21, 2026 20:45
Keep the original closeQuietly copy examples and explain when their cleanup pattern applies. Call out the risk of a buffered output stream failing during close in the single-resource overload. Assisted-By: OpenAI Codex and DeepSeek V4 Pro
Author
|
I restored the original examples in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses IO-438.
The copy examples still show the two
closeQuietlyoverloads. Their captions now say when it is appropriate to ignore close failures. The single-resource overload also explains that closing an output stream or writer can flush buffered data.The default Maven build and Javadoc generation passed on Java 25. There were 7,620 passing tests and 41 skipped. A Java 8 probe confirmed that each original copy example suppresses the simulated output close exception.
AI assistance: OpenAI Codex assisted the Javadoc revision and validation. DeepSeek reviewed the cumulative diff.