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 2019/04/18 12:06:46 UTC

[groovy] 03/04: fix unintended illegal access

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 fb5b6a03a04edccdc637132192cb5c0912639e35
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Apr 18 21:25:58 2019 +1000

    fix unintended illegal access
---
 .../inspect/swingui/ScriptToTreeNodeAdapterTest.groovy     | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy b/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
index 29dff39..2e64fea 100644
--- a/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
+++ b/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
@@ -84,9 +84,10 @@ class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
      */
     private assertMapEntry(mapEntry, expectedKey, expectedValue) {
         assertNotNull('Could not locate 1st MapEntryExpression in AST', mapEntry)
-        assertEquals('Wrong # map entries', 2, mapEntry.children.size())
-        assertEquals('Wrong key', expectedKey, mapEntry.children[0].toString())
-        assertEquals('Wrong value', expectedValue, mapEntry.children[1].toString())
+        def children = mapEntry.children().toList()
+        assertEquals('Wrong # map entries', 2, children.size())
+        assertEquals('Wrong key', expectedKey, children[0].toString())
+        assertEquals('Wrong value', expectedValue, children[1].toString())
     }
 
     /**
@@ -222,10 +223,11 @@ class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
         }
         assertNotNull('Could not locate NamedArgumentListExpression in AST', namedArgList)
 
-        assertEquals('Wrong # named arguments', 2, namedArgList.children.size())
+        def children = namedArgList.children().toList()
+        assertEquals('Wrong # named arguments', 2, children.size())
 
-        assertMapEntry(namedArgList.children[0], 'Constant - foo : java.lang.String', 'Constant - bar : java.lang.String')
-        assertMapEntry(namedArgList.children[1], 'Constant - baz : java.lang.String', 'Constant - qux : java.lang.String')
+        assertMapEntry(children[0], 'Constant - foo : java.lang.String', 'Constant - bar : java.lang.String')
+        assertMapEntry(children[1], 'Constant - baz : java.lang.String', 'Constant - qux : java.lang.String')
     }
 
     void testDynamicVariable() {