You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Pascal Schumacher (JIRA)" <ji...@apache.org> on 2016/02/29 08:19:18 UTC

[jira] [Reopened] (GROOVY-7771) Exception driven control flow in groovy.lang.Script.getProperty()

     [ https://issues.apache.org/jira/browse/GROOVY-7771?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pascal Schumacher reopened GROOVY-7771:
---------------------------------------

Patch causes two test to fail: [https://travis-ci.org/apache/groovy/jobs/112466659]. So I guess the old behavior is needed. Further investigation required. 

> Exception driven control flow in groovy.lang.Script.getProperty()
> -----------------------------------------------------------------
>
>                 Key: GROOVY-7771
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7771
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.6
>            Reporter: Benjamin Graf
>            Assignee: Pascal Schumacher
>
> groovy.lang.Script.getProperty() calls Binding.getProperty() and does therfore react on MissingPropertyException. This control flow is an antipattern causing unnecessary Throwable.fillInStackTrace() calls which cost cpu time. It might be better to check with Binding.hasProperty() first to avoid Exception flow.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)