groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Tremblay (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8251) Implement withCloseable on AutoCloseable
Date Thu, 06 Jul 2017 18:27:01 GMT

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

Henri Tremblay commented on GROOVY-8251:
----------------------------------------

Yes. Because let's be fair, the only reason we have {{AutoCloseable}} today is because {{Closeable}}
was typed {{IOException}}. Starting from scratch, we would only have {{Closeable}} throwing
an exception.

> Implement withCloseable on AutoCloseable
> ----------------------------------------
>
>                 Key: GROOVY-8251
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8251
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-jdk
>    Affects Versions: 2.5.0-beta-1
>            Reporter: Henri Tremblay
>
> The Groovy implementation of try-with-resource is through {{withCloseable()}}. The problem
is that {{withCloseable}} only exists for classes implementing the {{Closeable}} interface.
> But a try-with-resource works with the {{AutoCloseable}} interface. So {{withCloseable}}
should probably be moved on step below to {{AutoCloseable}} (that {{Closeable}} extends).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message