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:24:28 UTC

[groovy] branch GROOVY_3_0_X updated (24c742a -> f2e9538)

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

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


    from 24c742a  GROOVY-9580: declaring class of getter/setter should be same as property (closes #1265)
     new 7dbac09  We got a GROOVY-3456 zoombie here.
     new f2e9538  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] 01/02: We got a GROOVY-3456 zoombie here.

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

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

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

    We got a GROOVY-3456 zoombie here.
---
 .../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 5299657..905d5c0 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
@@ -51,7 +51,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 614c13a..05075e0 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 }')


[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 GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit f2e95381997f928b32c5f24a8f8526b6d7da591b
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 905d5c0..8a57dc1 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
@@ -51,6 +51,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()
     }