crunch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Leacox (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CRUNCH-356) Use IOUtils.closeQuietly instead of Closeables.closeQuietly
Date Tue, 25 Feb 2014 20:04:22 GMT

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

John Leacox commented on CRUNCH-356:
------------------------------------

In the two cases I changed I don't think Closeables.close provides any value over try/catch(IOException)
since the two methods can't add a checked exception to their definition.

[~sjdurfey] What is the custom solution you have been using for IOExceptions?

I could change these two cases to do try/catch and submit another patch.
{code}
try {
  closeable.close();
} catch (IOException e) {
  LOG.error("Failed to close Closeable", e);
}
{code}



> Use IOUtils.closeQuietly instead of Closeables.closeQuietly
> -----------------------------------------------------------
>
>                 Key: CRUNCH-356
>                 URL: https://issues.apache.org/jira/browse/CRUNCH-356
>             Project: Crunch
>          Issue Type: Improvement
>          Components: Core
>            Reporter: John Leacox
>            Assignee: Josh Wills
>            Priority: Minor
>             Fix For: 0.10.0, 0.8.3
>
>         Attachments: patch.diff
>
>
> Closeables.closeQuietly was deprecated in Guava 13 and removed in Guava 16. If a consumer
of crunch-core is using Guava 16+ a NoSuchMethodError could occur where Closeables.closeQuietly
is being used.
> The other crunch components are already using IOUtils.closeQuietly, so crunch-core could
pull in common-io and use IOUtils.closeQuietly.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message