You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2014/04/12 14:16:15 UTC

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

Sebb created IO-438:
-----------------------

             Summary: 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


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
(v6.2#6252)