commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (IO-504) Deprecated of all IOUtils.closeQuietly() methods
Date Fri, 06 May 2016 23:57:12 GMT

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

Gary Gregory edited comment on IO-504 at 5/6/16 11:57 PM:
----------------------------------------------------------

Thanks for the updated patch.

I think it is important to note that there is an important semantic change here.

With the patch, whenever [io] internally tries to close a closeable something (file, stream,
and so on), we now may get an exception when before we did not.

I'd argue that ignoring all of these close exception was bad and could cause things to get
polluted or corrupted or the call sites to be unaware that problems exists closing resources.
Not a good thing especially when other IOExceptions would be thrown on other operations within
a given method.

Testing...


was (Author: garydgregory):
Thanks for the updated patch.

I think it is important to note that there is an important semantic change here.

With the patch, whenever [io] internally tries to close a closeable something (file, stream,
and so on), we now may get an exception when before we did not.

I'd argue that ignoring all of these close exception was bad and could cause things to get
polluted or corrupted or the call sites to be unaware that problems exists closing resources.
Not a good thing especially when other IOExceptions would be thrown on other operations within
a given method.

> Deprecated of all IOUtils.closeQuietly() methods
> ------------------------------------------------
>
>                 Key: IO-504
>                 URL: https://issues.apache.org/jira/browse/IO-504
>             Project: Commons IO
>          Issue Type: Wish
>            Reporter: Christian Schulte
>         Attachments: IO-504.patch, IO-504.patch
>
>
> As soon as 'commons-io' is targetted at Java 7, all 'IOUtils.closeQuietly' methods should
be deprecated and people should be told to use the try-with-resources statement. Those methods
are way to error prone and used incorrectly almost everywhere. If 'commons-io' has  '-target
1.7', keeping those methods makes no sense anymore.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message