[
https://issues.apache.org/jira/browse/IO-438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17728978#comment-17728978
]
Gary D. Gregory commented on IO-438:
------------------------------------
[~sebb]
How does it look to you now? Should we change the Javadoc?
> IOUtils.closeQuietly Javadoc needs fixing
> -----------------------------------------
>
> Key: IO-438
> URL: https://issues.apache.org/jira/browse/IO-438
> Project: Commons IO
> Issue Type: Bug
> Reporter: Sebb
> Priority: Major
>
> As mentioned in a comment on IO-388, there is a danger that closeQuietly is
> used inappropriately.
> Indeed the "Closing all streams:" examples in the Javadoc for various
> closeQuietly methods are wrong.
> The IOUtils.copy() methods don't close their input and output parameters.
> It is arguably OK to ignore exceptions when closing the input, but it is a
> bad idea to ignore exceptions when closing the output, as that could mean
> that the output has not been fully written.
> The Javadoc for these examples could be dropped, but I think it would be
> better to fix it to show how it should be done properly.
> There are a lot of copies of the bad example; I suggest we agree on a sample
> replacement before updating them all.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)