groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniil Ovchinnikov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GROOVY-8657) Resource variable is accessible from finally block
Date Thu, 21 Jun 2018 15:32:00 GMT
Daniil Ovchinnikov created GROOVY-8657:
------------------------------------------

             Summary: Resource variable is accessible from finally block
                 Key: GROOVY-8657
                 URL: https://issues.apache.org/jira/browse/GROOVY-8657
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 3.0.0-alpha-2
            Reporter: Daniil Ovchinnikov


From http://groovy-lang.org/releasenotes/groovy-3.0.html
{code:groovy}
try(
        FromResource from = new FromResource("ARM was here!")
        ToResource to = new ToResource()
) {
    to << from
} finally {
    assert from.closed // should throw MissingPropertyException
    assert to.closed
    assert to.toString() == 'ARM was here!'
}
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message