groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject groovy git commit: Revert "GROOVY-7771: Exception driven control flow in groovy.lang.Script.getProperty()"
Date Mon, 29 Feb 2016 07:13:37 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X e452dbc35 -> 01ffb0bf3


Revert "GROOVY-7771: Exception driven control flow in groovy.lang.Script.getProperty()"

This reverts commit e452dbc359cdd8226cab3655e3cec0df0ff8fa67.


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/01ffb0bf
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/01ffb0bf
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/01ffb0bf

Branch: refs/heads/GROOVY_2_4_X
Commit: 01ffb0bf3dbae24c4cfe767ba2f5f7c187d1cf45
Parents: e452dbc
Author: pascalschumacher <pascalschumacher@gmx.net>
Authored: Mon Feb 29 08:13:23 2016 +0100
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Mon Feb 29 08:13:23 2016 +0100

----------------------------------------------------------------------
 src/main/groovy/lang/Script.java | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/01ffb0bf/src/main/groovy/lang/Script.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/lang/Script.java b/src/main/groovy/lang/Script.java
index 2d65813..196c74c 100644
--- a/src/main/groovy/lang/Script.java
+++ b/src/main/groovy/lang/Script.java
@@ -52,10 +52,11 @@ public abstract class Script extends GroovyObjectSupport {
     }
 
     public Object getProperty(String property) {
-      if (binding.hasVariable(property)) {
-          return binding.getVariable(property);
-      }
-      return super.getProperty(property);
+        try {
+            return binding.getVariable(property);
+        } catch (MissingPropertyException e) {
+            return super.getProperty(property);
+        }
     }
 
     public void setProperty(String property, Object newValue) {


Mime
View raw message