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

Jochen Theodorou commented on GROOVY-7771:
------------------------------------------

This looks like a breaking change for 2.5, maybe even 3.0, or we have to reject 
the patch and close the issue as "Won't fix".  So the question is if Binding 
does imply that everything you can get through getVariable has to be true for 
hasVariable and has to appear in getVariables, at any point in time or not. If 
yes, then we can no longer support variables created on use for example.

> 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)

Reply via email to