commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Benedict (JIRA)" <j...@apache.org>
Subject [jira] Commented: (IO-249) Enhance closeQuietly to indicate success
Date Sat, 02 Oct 2010 00:50:32 GMT

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

Paul Benedict commented on IO-249:
----------------------------------

I definitely believe both of you are on the right track. The callback/handler strategy is
a MUCH better alternative than my original suggestion. However, I would like to avoid instantiating
a handler per resource. Is there an alternative? Otherwise, a callback will work since I can
make it a singleton.

> Enhance closeQuietly to indicate success
> ----------------------------------------
>
>                 Key: IO-249
>                 URL: https://issues.apache.org/jira/browse/IO-249
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 2.0
>            Reporter: Paul Benedict
>            Assignee: Paul Benedict
>            Priority: Minor
>             Fix For: 2.x
>
>         Attachments: CloseableHandler.java
>
>
> A convention of some programmers is to emit a log warning when a resource fails to close.
Granted, such a condition is an error, but there's no reasonable recourse to the failure.
Using IOUtils.closeQuietly() is very useful but all information about the success/failure
is hidden. Returning Throwable will give insight into the error for diagnostic purposes. This
change will be compatible with today's usage since the method currently returns void.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message