You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sarankumar Baskar (Jira)" <ji...@apache.org> on 2026/06/12 05:07:00 UTC

[jira] [Commented] (IO-438) IOUtils.closeQuietly Javadoc needs fixing

    [ https://issues.apache.org/jira/browse/IO-438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18088432#comment-18088432 ] 

Sarankumar Baskar commented on IO-438:
--------------------------------------

I've updated 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)