You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2018/02/07 00:25:00 UTC

[jira] [Created] (GROOVY-8472) Final variable analysis doesn't account for early exit

Paul King created GROOVY-8472:
---------------------------------

             Summary: Final variable analysis doesn't account for early exit
                 Key: GROOVY-8472
                 URL: https://issues.apache.org/jira/browse/GROOVY-8472
             Project: Groovy
          Issue Type: Improvement
            Reporter: Paul King


{code}
def method(String foo) {
    def str
    try {
        str = foo.trim()
    }
    catch(e) {
        println e
        return null
    }
    int exitCode = str.isInteger() ? str.toInteger() : null
    exitCode
    //str.isInteger() ? str.toInteger() : null // this doesn't trigger the error
}

println method(null)
{code}




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