You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2020/06/10 00:25:07 UTC

[groovy] branch master updated (20bc8ad -> 0caa105)

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git.


    from 20bc8ad  reduce nesting
     new 71ba1ae  GROOVY-9584: We got a GROOVY-3456 zoombie here (closes #1271)
     new 0caa105  GROOVY-9485: add comment to reduce risk of subsequent regression

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/groovy/org/apache/groovy/groovysh/Interpreter.groovy  |  3 ++-
 .../test/groovy/org/apache/groovy/groovysh/GroovyshTest.groovy | 10 ++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)


[groovy] 02/02: GROOVY-9485: add comment to reduce risk of subsequent regression

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 0caa1052af4ea715dfa3954e6b6f75b577ec13bf
Author: Paul King <pa...@asert.com.au>
AuthorDate: Wed Jun 10 10:24:21 2020 +1000

    GROOVY-9485: add comment to reduce risk of subsequent regression
---
 .../src/main/groovy/org/apache/groovy/groovysh/Interpreter.groovy        | 1 +
 1 file changed, 1 insertion(+)

diff --git a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/Interpreter.groovy b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/Interpreter.groovy
index e96e5f2..0387a9d 100644
--- a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/Interpreter.groovy
+++ b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/Interpreter.groovy
@@ -47,6 +47,7 @@ class Interpreter implements Evaluator
     }
 
     Binding getContext() {
+        // GROOVY-9584: leave as call to getter not property access to avoid potential context variable in binding
         return shell.getContext()
     }
 


[groovy] 01/02: GROOVY-9584: We got a GROOVY-3456 zoombie here (closes #1271)

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 71ba1ae7cc0fe651885adc791ab50cd5d7d67a29
Author: Urs Keller <ur...@lightspeedhq.com>
AuthorDate: Tue Jun 9 17:48:26 2020 +0200

    GROOVY-9584: We got a GROOVY-3456 zoombie here (closes #1271)
---
 .../main/groovy/org/apache/groovy/groovysh/Interpreter.groovy  |  2 +-
 .../test/groovy/org/apache/groovy/groovysh/GroovyshTest.groovy | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/Interpreter.groovy b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/Interpreter.groovy
index d158f23..e96e5f2 100644
--- a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/Interpreter.groovy
+++ b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/Interpreter.groovy
@@ -47,7 +47,7 @@ class Interpreter implements Evaluator
     }
 
     Binding getContext() {
-        return shell.context
+        return shell.getContext()
     }
 
     GroovyClassLoader getClassLoader() {
diff --git a/subprojects/groovy-groovysh/src/test/groovy/org/apache/groovy/groovysh/GroovyshTest.groovy b/subprojects/groovy-groovysh/src/test/groovy/org/apache/groovy/groovysh/GroovyshTest.groovy
index 74a5be3..316ba88 100644
--- a/subprojects/groovy-groovysh/src/test/groovy/org/apache/groovy/groovysh/GroovyshTest.groovy
+++ b/subprojects/groovy-groovysh/src/test/groovy/org/apache/groovy/groovysh/GroovyshTest.groovy
@@ -61,6 +61,16 @@ class GroovyshTest extends GroovyTestCase {
         }
     }
 
+    void testBindingContext() {
+        Binding binding = new Binding()
+        binding.setVariable("context", "bla")
+
+        Groovysh groovysh = new Groovysh(binding, testio)
+        groovysh.run('')
+        System.out.println(mockErr.toString())
+        assertTrue(mockErr.toString(), !mockErr.toString().contains("CastException"))
+    }
+
     void testClassDef() {
         Groovysh groovysh = createGroovysh()
         groovysh.execute('class MyFooTestClass{ String foo }')